In the previous article, we built the Perception Module, which enables an AI agent to observe, clean, and understand the messy real world. However, understanding a user's request is only the beginning.
Real users don't ask agents to perform single actions. They ask for complex goals like "Book my trip to London next week" or "Analyze this report and email the summary to my manager".
Before an agent can execute anything, it must answer a critical question:
What should I do first, and what should I do next?
This is exactly the responsibility of the Planning Module.
In this post, we'll explore how AI agents transform high-level goals into structured execution plans, compare static and dynamic planning strategies, and clarify one of the biggest misconceptions in agent architecture, whether planning is a prompt, an LLM capability, or an independent architectural component.
1. Why AI Agents Need a Planning Module
In the previous post, we built the Perception Module, which acts as the agent's senses. Its responsibility is to observe the outside world, clean noisy inputs, extract useful information, and convert everything into a structured goal that the agent can understand.
However, understanding a request is not the same as knowing how to accomplish it. Imagine someone asks, "Book my complete trip to London next week". The Perception Module can successfully understand that:
· The destination is London.
· The travel period is next week.
· The user's intent is to book an entire trip.
But after extracting this information, an important question still remains, "What should the agent do first?".
· Should it search for flights before hotels?
· Should it check visa requirements?
· Should it ask the user for a preferred airline?
· Should it book everything immediately or first present available options?
Perception cannot answer these questions because its responsibility ends with understanding the request. Another component is required to determine how the goal should be achieved. This is exactly where the Planning Module comes into the picture.
1.1 The Problem with Complex User Goals
Real users rarely give AI agents simple, one-step instructions. Instead of saying "Search for flight AI123", they usually say things like:
Book my family vacation.
Plan my business trip.
Analyze this report and email the summary to my manager.
Find the cheapest laptop under ₹80,000 and compare the best options.
These are high-level goals, not individual actions. A single API call or tool invocation cannot complete these requests. Each goal requires multiple decisions, multiple tools, and often interaction with the user along the way.
Before the agent can execute anything, it must first transform the user's objective into a series of smaller, manageable tasks. This process is called task decomposition.
1.2 From One Big Goal to Many Small Tasks
Humans naturally break large problems into smaller pieces before solving them. Suppose you're planning your own vacation to London. You wouldn't attempt to do everything simultaneously.
Instead, your thought process might look like this:
· Decide the travel dates
· Search for available flights
· Compare flight prices
· Book the selected flight
· Find nearby hotels
· Compare hotel ratings
· Reserve the hotel
· Arrange airport transportation
· Send the itinerary to your family
Although the original request was only one sentence, "Book my London trip". You mentally converted it into several smaller tasks. An AI agent follows the same principle.
The Planning Module performs this decomposition automatically, producing an ordered list of executable steps that other components can carry out.
1.3 What Does the Planning Module Actually Solve?
The Planning Module acts as the strategist of the AI agent. Instead of executing actions directly, it answers questions such as:
· What needs to be done?
· In what order should tasks be performed?
· Which tools are required?
· Which tasks depend on previous results?
· What information is still missing?
· Should the agent ask the user for clarification before proceeding?
Rather than immediately calling APIs or external tools, the planner first creates a blueprint for execution. You can think of it as the architect preparing a construction plan before workers begin building.
Without this planning phase, the agent would have no clear strategy for achieving complex objectives.
1.4 Chatbots vs AI Agents
This distinction becomes much clearer when we compare a traditional chatbot with an AI agent.
|
Traditional Chatbot |
AI Agent |
|
Responds directly to user prompts |
Plans before acting |
|
Produces a single response |
Produces a sequence of actions |
|
Limited reasoning across multiple steps |
Breaks goals into smaller tasks |
|
Usually has no understanding of execution order |
Understands dependencies between tasks |
|
Cannot autonomously coordinate multiple tools |
Coordinates multiple tools to achieve a goal |
For example, if you ask a chatbot, "Book my trip to London". It will likely respond with something like:
"Sure! You should first search for flights and then reserve a hotel."
It gives advice, but it doesn't actually perform the work.
An AI agent behaves differently. Instead of explaining what should happen, it generates a structured execution plan such as:
· Search available flights
· Ask the user to choose a preferred flight
· Book the selected flight
· Search hotels near the destination
· Reserve the selected hotel
· Arrange airport transportation
· Email the complete itinerary
This plan is then handed over to the Action Module, which executes each step using the appropriate tools.
1.5 Real-World Example: Booking a Trip to London
Let's follow the journey of a request through the first two modules of our AI agent.
User Goal: Book my trip to London next week.
Step 1: Perception Module
The Perception Module extracts structured information such as:
Intent: Book a trip
Destination: London
Travel Time: Next week
At this stage, the agent understands what the user wants.
Step 2: Planning Module
The planner transforms this goal into an execution blueprint:
Goal:
Book my trip to London next week
Execution Plan:
· Search available flights
· Present flight options
· Wait for user selection
· Book selected flight
· Search available hotels
· Present hotel options
· Book selected hotel
· Arrange airport transportation
· Send booking confirmation email
Notice that nothing has been executed yet.
· No flights have been booked
· No hotels have been reserved
The Planning Module has only produced a structured sequence of future actions. The actual execution will happen later when the Action Module receives this plan and begins invoking tools one step at a time.
In summary, the Planning Module is the strategist of an AI agent. While the Perception Module understands what the user wants, the Planning Module determines how that goal can be achieved. It breaks complex objectives into smaller, ordered, and executable tasks, creating a blueprint that guides the rest of the agent. Without planning, an AI system may understand the user's request but lacks the structured strategy needed to accomplish it effectively.
2. How an LLM Becomes a Planner
One of the most common questions developers ask when learning AI agents is: "If Large Language Models can already reason, why do we need a separate Planning Module?"
Or another variation, "Isn't planning just another prompt?". The short answer is
· Operationally, yes. We use prompts to instruct the LLM to generate a plan.
· Architecturally, no. The Planning Module is an independent software component responsible for producing, validating, and managing that plan.
Understanding this distinction is crucial because it separates what the LLM does from what the application architecture is responsible for.
2.1 Planning Is Not Magic
Many people imagine that an LLM somehow "knows" how to become an AI planner. It doesn't. An LLM is simply a language model trained to predict the next token. Left on its own, it has no built-in understanding that it should create execution plans, invoke tools, or coordinate workflows.
For example, suppose we ask the model, "Book my trip to London next week". A standard chatbot will most likely generate something like: "Certainly! You should first search for flights, then reserve a hotel, and finally arrange transportation."
While this response sounds helpful, it is still just text. The model has not produced a machine readable execution plan.
· It has not decided which APIs should be called.
· It has not considered available tools.
· It has not generated structured data that another software component can execute.
In other words, it answered the user instead of planning for the agent. To transform an LLM into a planner, we must explicitly instruct it to think like one.
2.2 Prompt Engineering Turns an LLM into a Planner
The Planning Module uses prompt engineering to assign a completely different role to the LLM.
Instead of asking: "Answer the user's question."
we instruct it: "You are an AI planner. Break this goal into executable steps using only the available tools. Return the result as structured JSON."
This small change completely changes the behaviour of the model.
Rather than generating conversational text, the LLM begins producing a structured execution blueprint.
In other words, we are not changing the model itself, we are changing the role it plays within our architecture.
2.3 What Information Does the Planner Receive?
The quality of a plan depends heavily on the information provided to the LLM. The Planning Module gathers context from different parts of the agent and packages it into a prompt.
Typically, the planner receives the following inputs.
a. Goal from the Perception Module
The first input is the structured goal extracted by the Perception Module.
Goal: Book my trip to London next week.
Notice that the planner does not receive raw user input filled with spelling mistakes, unnecessary conversation, or irrelevant context. Instead, it receives a cleaned and normalized objective.
b. Available Tools
The planner also needs to know what actions are actually possible.
Available Tools
searchFlights()
bookFlight()
searchHotels()
bookHotel()
sendEmail()
Without this information, the planner might invent actions that the agent cannot perform.
For example, it could generate: Reserve a rental car, even though no rental-car tool exists.
By explicitly listing available tools, we constrain the planner to produce only executable steps.
c. Constraints
Real-world applications always have limitations. The planner must know these rules before generating a plan.
Examples include:
· Use only approved tools.
· Never perform payments automatically.
· Ask for user confirmation before booking.
· Maximum travel budget is ₹1,50,000.
· Do not expose sensitive information.
These constraints prevent the planner from creating unsafe or invalid workflows.
d. System Instructions
Finally, the Planning Module provides instructions describing exactly what kind of output is expected.
For example:
· You are an AI Planning Engine.
· Break the user's goal into executable tasks.
· Use only the provided tools.
· Do not execute anything.
· Return the plan as JSON.
These instructions define the planner's behaviour and ensure consistency across different requests.
The Prompt Is the Blueprint for Reasoning
When we combine all these inputs together, the prompt looks conceptually like this:
System:
You are an AI Planning Engine.
Goal:
Book my trip to London next week.
Available Tools:
- searchFlights
- bookFlight
- searchHotels
- bookHotel
- sendEmail
Constraints:
- Use only these tools.
- Ask for user confirmation before booking.
Task:
Create an execution plan as JSON.
This prompt does not ask the LLM to solve the user's problem directly. Instead, it asks the LLM to design a strategy for solving the problem. This is the essence of planning.
2.4 The Output Is NOT the Final Answer
One of the biggest misconceptions about planning is that the planner should generate the final response for the user. It should not. The Planning Module never books flights. It never sends emails. It never reserves hotels.
Its only responsibility is to produce a structured plan describing what should happen next. Think of it like an architect creating a blueprint. The blueprint is not the building itself. It simply describes how the building should be constructed.
Similarly, the Planning Module creates an execution blueprint that another component, the Action Module will later execute.
2.5 The Plan Is a Data Structure
Architecturally, a plan is not just text. It is a structured piece of data that software can understand and process. Depending on the complexity of the application, a plan might be represented as:
· A JSON document
· A task list
· A directed graph (DAG)
· A workflow definition
· A state machine
For many AI agents, JSON is the most common representation because it is easy for both humans and machines to read.
{
"planId": "PLAN-20260721-001",
"goal": "Book my trip to London next week",
"planningStrategy": "Static",
"status": "PLANNED",
"createdBy": "PlanningModule",
"steps": [
{
"step": 1,
"id": "search_flights",
"description": "Search for available flights to London for the requested travel dates.",
"tool": "searchFlights",
"parameters": {
"destination": "London",
"departureDate": "Next Week",
"passengers": 1,
"cabinClass": "Economy"
},
"dependsOn": [],
"requiresUserInput": false,
"expectedOutput": "List of available flights",
"status": "PENDING"
},
{
"step": 2,
"id": "select_flight",
"description": "Ask the user to choose one of the available flights.",
"tool": "askUser",
"parameters": {
"question": "Please select your preferred flight."
},
"dependsOn": [1],
"requiresUserInput": true,
"expectedOutput": "Selected Flight ID",
"status": "PENDING"
},
{
"step": 3,
"id": "book_flight",
"description": "Book the flight selected by the user.",
"tool": "bookFlight",
"parameters": {
"flightId": "{{step2.selectedFlightId}}"
},
"dependsOn": [2],
"requiresUserInput": false,
"expectedOutput": "Flight Booking Reference",
"status": "PENDING"
},
{
"step": 4,
"id": "search_hotels",
"description": "Search hotels near Central London.",
"tool": "searchHotels",
"parameters": {
"city": "London",
"location": "Central London",
"checkIn": "Next Week",
"nights": 5
},
"dependsOn": [3],
"requiresUserInput": false,
"expectedOutput": "Hotel List",
"status": "PENDING"
},
{
"step": 5,
"id": "select_hotel",
"description": "Ask the user to choose a hotel.",
"tool": "askUser",
"parameters": {
"question": "Which hotel would you like to book?"
},
"dependsOn": [4],
"requiresUserInput": true,
"expectedOutput": "Selected Hotel ID",
"status": "PENDING"
},
{
"step": 6,
"id": "book_hotel",
"description": "Reserve the selected hotel.",
"tool": "bookHotel",
"parameters": {
"hotelId": "{{step5.selectedHotelId}}"
},
"dependsOn": [5],
"requiresUserInput": false,
"expectedOutput": "Hotel Booking Reference",
"status": "PENDING"
},
{
"step": 7,
"id": "generate_itinerary",
"description": "Generate a complete travel itinerary.",
"tool": "createItinerary",
"parameters": {},
"dependsOn": [3, 6],
"requiresUserInput": false,
"expectedOutput": "Travel Itinerary PDF",
"status": "PENDING"
},
{
"step": 8,
"id": "send_confirmation",
"description": "Email the booking confirmations and itinerary to the user.",
"tool": "sendEmail",
"parameters": {
"template": "TRAVEL_CONFIRMATION"
},
"dependsOn": [7],
"requiresUserInput": false,
"expectedOutput": "Confirmation Email Sent",
"status": "PENDING"
}
]
}
Notice that this is not conversational text. It is structured data that another software component can validate, inspect, modify, log, or execute.
This separation between reasoning and execution is one of the fundamental principles of agent architecture.
3. Planning Strategies: Static vs Dynamic Planning
Once we understand how an LLM generates a plan, the next question is, Should the agent generate the entire plan at once, or should it plan as it goes?
The answer depends on the complexity and predictability of the task. Modern AI agents generally use one of two planning strategies:
· Static Planning (Chain of Thought)
· Dynamic Planning (ReAct - Reason + Act)
Both approaches use the reasoning capabilities of an LLM, but they differ significantly in when and how the planning happens.
3.1 Static Planning (Chain of Thought)
Static Planning is the simplest planning strategy. The agent receives the user's goal, reasons about the complete problem, and generates the entire execution plan before performing any action. In other words, the planner thinks once and produces a full blueprint.
User Goal
│
▼
Reason
│
▼
Generate Complete Plan
│
▼
Action Module Executes
For example, consider the request "Book my trip to London next week". The Planning Module may produce the following sequence:
Book Flight
↓
Book Hotel
↓
Reserve Taxi
↓
Send Confirmation Email
The Action Module then executes these steps in order. No additional planning occurs unless something goes wrong.
a. Why Is It Called Chain of Thought?
The term Chain of Thought (CoT) refers to prompting the LLM to reason step by step before producing an answer. In the context of planning, this reasoning process is used to create a complete execution plan.
For example, the model might internally reason:
· I need transportation
· Flights should be booked first
· Hotels depend on travel dates
· Transportation depends on hotel location
· Finally, send confirmation
The planner converts this reasoning into a structured sequence of tasks for execution.
Note: Chain of Thought is a reasoning technique, while Static Planning is an architectural strategy. Static Planning often uses Chain of Thought internally, but the two terms are not interchangeable.
b. When Should You Use Static Planning?
Static planning works best when:
· The workflow is predictable
· All required information is available upfront
· Tasks follow a fixed sequence
· External conditions are unlikely to change
Typical examples include:
· Data processing pipelines
· Document summarization workflows
· Image generation pipelines
· ETL jobs
· Automated report generation
· Batch processing
Since the planner generates the entire workflow in one reasoning pass, execution is straightforward.
c. Advantages of Static Planning
· Simplicity: The complete roadmap is available before execution begins, making the workflow easy to understand and debug.
· Faster Execution: The planner runs only once, reducing the number of LLM calls.
· Lower Cost: Because planning happens a single time, fewer tokens are consumed compared to iterative planning.
· Easy Validation: The entire plan can be reviewed, validated, or even approved by a human before execution starts.
d. Limitations of Static Planning
Static planning assumes that the world remains unchanged after the plan is created. Unfortunately, real-world systems rarely behave that way.
Consider the following situations:
· The selected flight becomes unavailable
· Hotel prices suddenly increase
· The user changes travel dates
· A booking API fails
A static planner cannot automatically adapt to these new situations without generating a completely new plan. This limitation led to a more powerful strategy known as Dynamic Planning.
3.2 Dynamic Planning (ReAct)
Dynamic Planning takes a completely different approach. Instead of planning everything upfront, the agent plans only the next best action. After executing that action, it observes the result, updates its understanding of the environment, and plans again.
This continuous cycle is known as the ReAct (Reason + Act) pattern.
Think
↓
Plan One Step
↓
Execute
↓
Observe
↓
Re-plan
↓
Repeat until goal achieved
Rather than assuming everything will go according to plan, the agent continuously adapts based on new information. This makes Dynamic Planning significantly more flexible than Static Planning.
a. The ReAct Loop Explained
The ReAct loop consists of five stages.
Step 1: Think
The agent examines the current goal and the latest information available. At the beginning, it only knows:
Goal: Book my trip to London next week.
It does not yet know which flights are available.
Step 2: Plan One Step
Instead of creating the entire workflow, the planner decides only the immediate next action.
Next Action: Search available flights.
Step 3: Execute
The Action Module executes the selected tool "searchFlights()". The booking service returns available flights.
Step 4: Observe
The Perception Module processes the execution result.
For example:
Flight A: ₹42,000
Flight B: ₹46,500
Flight C: ₹39,800
The agent now possesses information it did not have during the initial planning phase.
Step 5: Re-plan
Using the newly acquired information, the Planning Module generates the next action. Instead of continuing automatically, it may decide:
· Ask the user to choose one of the available flights.
· Notice how the planner changed its strategy based on new information.
· After the user selects a flight, the cycle repeats.
b. Why Dynamic Planning Is So Powerful
Unlike Static Planning, Dynamic Planning does not assume that the environment is fixed. It continuously adapts as new information becomes available.
Handles Uncertainty
Many real-world tasks involve incomplete or changing information. Dynamic Planning allows the agent to respond intelligently as conditions evolve.
Handles User Interaction
Some decisions require user input.
For example:
· Which airline do you prefer?
· Would you like a window seat?
· Which hotel should I reserve?
The planner naturally pauses, waits for the user's response, and then continues planning.
Adapts to Failures
Suppose the booking API returns "Flight Sold Out". A static plan may simply fail. A ReAct-based planner immediately reasons, search for alternative flights. No manual intervention is required.
Supports Long-Running Workflows
Dynamic Planning is ideal for workflows that may last several minutes, hours, or even days.
Examples include:
· Travel booking
· Customer support
· Research assistants
· Autonomous coding agents
· IT operations
· Multi-step business workflows
3.3 Static vs Dynamic Planning
|
Feature |
Static Planning |
Dynamic Planning |
|
Planning Style |
Entire plan generated upfront |
Plan one step at a time |
|
LLM Calls |
Usually one |
Multiple iterative calls |
|
Adaptability |
Low |
High |
|
User Interaction |
Difficult |
Natural |
|
Failure Recovery |
Requires replanning |
Built into the loop |
|
Best For |
Predictable workflows |
Real-world autonomous agents |
3.4 Which Strategy Should You Choose?
Neither strategy is universally better, they solve different problems.
If your workflow is predictable, deterministic, and unlikely to change, Static Planning is often simpler, faster, and more cost-effective.
However, if your agent must interact with users, respond to changing environments, recover from failures, or make decisions based on new information, Dynamic Planning with the ReAct pattern is the preferred choice. This iterative Think → Plan → Execute → Observe → Re-plan cycle has become the foundation of most modern autonomous AI agents because it enables them to behave intelligently in complex, real-world scenarios.
In summary, Static Planning creates a complete execution blueprint before any work begins, making it ideal for predictable tasks. Dynamic Planning (ReAct), on the other hand, continuously reasons, executes, observes outcomes, and replans based on new information. While Static Planning prioritizes simplicity and efficiency, Dynamic Planning prioritizes adaptability and resilience, making it the dominant strategy for today's AI agents operating in uncertain and interactive environments.
4. Architectural Boundaries: Planning vs Action
One of the biggest misconceptions in AI agent development is confusing thinking with doing. Many developers assume that when the LLM decides to call a tool, it is also executing that tool. Others believe that the Planning Module directly books flights, updates databases, or sends emails.
This misunderstanding often comes from working with simple chatbot examples where everything appears to happen in a single prompt.
However, a well-designed AI agent follows the Separation of Concerns principle. Each module has a single responsibility, making the system easier to understand, test, maintain, and extend.
The Planning Module is responsible for deciding what should be done, while the Action Module is responsible for actually doing it.
Understanding this architectural boundary is one of the most important concepts in agent engineering.
4.1 The Planning Module Only Thinks
The Planning Module is the strategist of the AI agent. Its responsibility is to analyze the user's goal, reason about the problem, understand available tools, respect business constraints, and produce a structured execution plan.
It never performs any real-world action. For example, given the request "Book my trip to London next week". The planner may generate something like:
Step 1: Search Flights
Step 2: Ask User to Select Flight
Step 3: Book Flight
Step 4: Search Hotels
Step 5: Book Hotel
Step 6: Send Confirmation Email
At this point:
· No flight has been searched.
· No hotel has been booked.
· No email has been sent.
The planner has simply created a blueprint describing what should happen next. Think of it as an architect drawing the blueprint of a house. The blueprint explains how the house should be built, but it doesn't lay a single brick.
4.2 The Action Module Executes the Plan
Once the planner produces a validated plan, responsibility shifts to the Action Module. Unlike the planner, the Action Module doesn't decide what should happen. Instead, it asks, "What is the next step in the plan?". It then executes that step by invoking the appropriate tool.
Example:
Step 1
Tool: searchFlights()
↓
Receive Results
↓
Update Memory
↓
Move to Step 2
The Action Module acts as the worker that follows the planner's instructions. It is responsible for:
· Calling APIs
· Executing functions
· Reading and writing databases
· Sending emails
· Querying external services
· Uploading files
· Performing calculations
· Handling execution failures
· Returning execution results
Notice that none of these responsibilities belong to the Planning Module.
4.3 What the Planner NEVER Does
A useful way to remember the planner's role is to understand what it never does.
The Planning Module never:
❌ Calls REST APIs
❌ Executes SQL queries
❌ Books flights
❌ Reserves hotels
❌ Updates databases
❌ Sends emails
❌ Writes files
❌ Makes payments
❌ Invokes external tools
Instead, it simply says, "These are the actions that should be executed". This distinction keeps reasoning completely independent from execution.
4.4 What the Action Module NEVER Does
Similarly, the Action Module has its own boundaries. It never decides:
· Which tool should be used
· What order tasks should execute
· Whether the workflow needs replanning
· How to decompose a complex goal
Instead, it simply executes the instructions provided by the planner. This makes each component significantly simpler.
4.5 Why Is This Separation Important?
Separating planning from execution may initially seem unnecessary, especially for small projects. However, as AI agents become more autonomous, this separation provides enormous architectural benefits.
a. Easier Testing
Suppose the planner generates this plan:
{
"steps": [
"Search Flights",
"Book Flight",
"Book Hotel"
]
}
You can test whether the planner generated the correct plan without actually booking anything. Likewise, you can test the Action Module using a predefined plan without involving the LLM at all. Each module can be tested independently.
b. Better Reliability
Execution often fails. Examples include:
· Flight booking service unavailable
· Payment gateway timeout
· Database connection lost
· Network interruption
The Action Module handles these failures and reports them back. The Planning Module can then decide whether to:
· Retry
· Choose an alternative tool
· Ask the user for help, or
· Generate a new plan.
This feedback loop is much easier to manage when planning and execution are separate concerns.
c. Easier Maintenance
Suppose you replace your flight booking API. The planner doesn't care. It still generates:
Book Flight
Only the Action Module changes. Similarly, if you decide to use a different LLM for planning, the Action Module remains untouched. Loose coupling makes the system easier to evolve over time.
4.6 Common Misconceptions
Because many AI frameworks hide the orchestration behind a single API call, developers often misunderstand how planning actually works.
Let's address some of the most common myths.
|
Myth |
Reality |
|
Planning is just a prompt. |
The prompt helps the LLM reason, but the Planning Module is an architectural component that gathers context, builds prompts, validates plans, applies business rules, and hands the plan to the Action Module. |
|
The LLM automatically plans. |
An LLM has no inherent planning capability. It plans only because the Planning Module provides the right context, tools, constraints, and instructions. |
|
Planning executes tools. |
No. The planner only decides what should be executed. The Action Module performs the actual execution. |
|
Chain of Thought and Planning are the same. |
Chain of Thought is a reasoning technique used by the LLM. Planning is the structured architectural output produced from that reasoning. |
|
Every AI application needs a planner. |
Not necessarily. A simple chatbot that answers questions may not require planning. Autonomous agents that coordinate multiple tools, handle long-running workflows, or adapt to changing environments almost always benefit from a dedicated Planning Module. |
4.7 Putting Everything Together
Let's follow the complete lifecycle of a user's request through the architecture. Suppose the user asks, Book my trip to London next week.
The request flows through the agent as follows:
User Goal
│
▼
Perception Module
(Clean • Understand • Extract Intent)
│
▼
Planning Module
(Reason • Decompose • Generate Plan)
│
▼
Structured Plan (JSON)
│
▼
Action Module
(Execute One Step at a Time)
│
▼
Tool Execution
(APIs • Databases • External Services)
│
▼
Memory + Perception
(Store Results • Observe Outcomes)
│
└──────────────►
Re-plan (if needed)
Notice the clear division of responsibilities:
· Perception understands the user's request
· Planning decides how to achieve it
· Action executes the plan
· Memory and Perception capture the results.
· If the environment changes or a task fails, the updated state is fed back to the planner, enabling the agent to adapt through dynamic replanning.
This modular architecture is what distinguishes a true AI agent from a simple chatbot.
In summary, the Planning Module and the Action Module serve fundamentally different purposes. The Planning Module thinks, it analyzes goals, reasons about available tools, respects constraints, and produces a structured execution blueprint. The Action Module acts, it invokes APIs, executes tools, interacts with external systems, and reports the results. Keeping these responsibilities separate leads to systems that are more secure, testable, reliable, and maintainable. It also lays the foundation for advanced agent capabilities such as dynamic replanning, human-in-the-loop approvals, and robust error recovery.
Conclusion
In this post, we explored one of the most important components of an AI agent architecture, the Planning Module. While the Perception Module enables an agent to understand the user's intent, it is the Planning Module that transforms that understanding into a structured strategy for execution.
We began by examining why planning is necessary in the first place. Real-world user requests are rarely simple one-step commands, they are high-level goals that must be broken down into smaller, executable tasks. This process of task decomposition is what enables an AI agent to tackle complex, multi-step problems.
Next, we looked at how a Large Language Model becomes a planner. An LLM does not automatically know how to generate execution plans. It becomes a planning engine only when guided with the right goal, available tools, constraints, and system instructions. More importantly, we clarified a common misconception, the prompt enables planning, but the Planning Module is the architectural component that orchestrates the entire planning process.
We then explored the two major planning strategies used in modern AI agents. Static Planning (Chain of Thought) generates the complete execution plan upfront, making it suitable for predictable workflows. In contrast, Dynamic Planning (ReAct) continuously reasons, executes, observes, and replans based on new information, allowing agents to operate effectively in uncertain and interactive environments.
Finally, we established the architectural boundary between Planning and Action. The Planning Module is responsible for thinking, analyzing the goal and producing a structured execution blueprint. The Action Module is responsible for doing like executing tools, interacting with external systems, and carrying out the plan. This separation of concerns makes AI agents more modular, secure, testable, and maintainable.
As our AI agent architecture continues to evolve, we now have three foundational building blocks:
· The LLM, which provides reasoning and language understanding.
· The Perception Module, which converts messy real-world input into structured goals.
· The Planning Module, which transforms those goals into an executable blueprint.
However, at this stage, the agent still hasn't performed a single real-world action. It knows what needs to be done, but not how to interact with external systems to accomplish those tasks.
In the next post, we'll build the Action & Tool Calling Module, the component that brings the plan to life by invoking APIs, executing tools, managing execution state, handling failures, and enabling the agent to safely interact with the real world. This is where an AI agent moves beyond reasoning and begins taking meaningful action.
Previous Next Home
No comments:
Post a Comment