Working through this module?
Module 09 · Page 10 of 20 · 8 sections
AI Agents Architecture
What an agent is made of, how its planner, memory and tools fit together, and the step-by-step workflow it follows.
What is an AI Agent?
- A system that can perceive its environment, reason, take actions using tools and learn from feedback to achieve a specific goal.
- Unlike traditional LLMs, agents can interact with external tools, access real-time data and execute multi-step tasks.
- Agents are goal-driven, autonomous and capable of planning, executing and adapting based on the results.
Key Components
- Planner
- Breaks down the goal into steps.
- LLM
- Reasoning and decision making.
- Memory
- Stores past interactions and context.
- Tools
- External systems (APIs, DB, search, etc.).
- Executor
- Executes the chosen actions.
- Feedback Loop
- Learns and adapts from results.
- Guardrails
- Safety, validation and error handling.
- Observability
- Logging, monitoring and evaluation.
1
2
3
4
5
6
7
8
High Level Architecture
UserGoal / query
PlannerUnderstand goal, break into steps, create plan
Agent Core
LLMReasoning & decision
MemoryShort-term / long-term
ToolsAPIs, search, DB, etc.
ExecutorCall tools, execute actions, handle errors, get results
Response to UserFinal answer, citations, intermediate steps
1. Planner (Task Decomposition)
- 1Understand user intent and goal.
- 2Break a complex task into smaller steps.
- 3Decide which tools are required.
- 4Maintain and update the execution plan.
- 5Re-plan if a step fails or new information is found.
Related08Agentic AI System Design
2. Memory
- Short-term Memory
- Current conversation context.
- Long-term Memory
- Past interactions and user preferences.
- Types
- Conversation history, vector memory, database.
- Purpose
- Helps maintain context across multiple steps and improves personalization and decision making.
1
2
3
4
3. Tools (External Systems)
- Web Search
- Real-time information (e.g. SerpAPI).
- Database
- Query enterprise data.
- APIs
- Call external services (e.g. weather, email).
- Code Interpreter
- Run and analyze code.
- File System
- Read and write files and documents.
- Other Tools
- Calculator, browser, custom tools.
1
2
3
4
5
6
4. Agent Workflow (Step-by-Step)
- 1Receive goal: the user provides a goal or query.
- 2Plan: break the goal into steps and create an execution plan.
- 3Select tool: choose the appropriate tool for the current step.
- 4Execute: call the tool and execute the action.
- 5Observe: analyze the results and update memory.
- 6Reflect: decide the next step (continue, re-plan or finish).
- 7Respond: return the final answer with citations and summary.
5. Design Considerations
- 1Tool selection and integration.
- 2Memory management and context handling.
- 3Error handling and self-correction.
- 4Security and access control.
- 5Monitoring, logging and evaluation.
- 6Human-in-the-loop for critical tasks.
- 7Cost optimization and latency management.
- 8Scalability for multi-agent systems.