Planning in AI Agents: Problem Formulation
What you'll learn: How to translate real-world agent tasks into formal planning problems with clearly defined states, actions, and goals.
The Core Idea
Before an AI agent can solve a problem, you must frame it as a planning problem. This means defining three essential components:
- States: All possible configurations of the world the agent might encounter
- Actions: Operations the agent can perform that transition between states
- Goals: Target states or conditions the agent should achieve
Think of it like planning a road trip. Your state is your current location and fuel level. Your actions are driving to connected cities or refueling. Your goal is reaching your destination with enough fuel.
Why This Matters
Without proper problem formulation, agents flail aimlessly. A well-formulated problem gives the agent:
- A clear understanding of what success looks like
- A structured action space to search through
- Metrics to evaluate progress toward the goal
For example, in a tool-using agent (building on concepts like action space and tool registry from earlier lessons), you might formulate:
- State: Current conversation context, available tools, previous tool results
- Actions: Call a specific tool with specific parameters, respond to user
- Goal: Answer the user's question with verified information
From Formulation to Execution
Once formulated, the planning problem connects to your agent's ReAct loop. The agent uses the state to decide which action to take next, observes the result (new state), and checks if the goal is met—triggering termination conditions when successful.
Key Takeaway: Problem formulation is the bridge between a vague task ("help the user") and a solvable planning problem with concrete states, actions, and goals that your agent can reason about systematically.