Working through this module?
Module 02 · Page 3 of 20 · 6 sections
Agent Architecture and Components
The parts every agent is built from: LLM, memory, tools, planning, execution and feedback.
High Level Architecture of an Agent
An AI agent consists of an LLM as the core reasoning engine, memory to store context, tools to interact with external systems and a planning mechanism to break down tasks and take actions.
User Query / Goal
MemoryShort-term & long-term
Agent
Planning & ReasoningLLM
Memory
Tool Use / Function Calling
Action Execution
ToolsAPIs, database, search, code, external systems
Response / Final Output
Core Components
1LLM (Reasoning Engine)
- Understands the goal, plans steps and decides actions.
- Examples: GPT-4, Claude, Llama, Gemini.
2Memory
- Stores conversation history, user preferences and domain knowledge.
- Types: short-term (in-context), long-term (vector database), episodic memory.
3Tools (Function Calling)
- Allows the agent to interact with external systems like APIs, databases, web, code execution, etc.
- Examples: Search API, Weather API, calculator, database query, email.
4Planning & Reasoning
- Breaks down complex tasks into smaller steps.
- Selects appropriate tools and decides the next action.
- Techniques: CoT, ReAct, Plan-and-Execute, Reflection.
5Action Execution
- Executes the selected tool or generates a response.
- Handles errors and retries if needed.
6Feedback & Learning
- Learns from past interactions and improves over time.
- Uses techniques like self-reflection, reinforcement and human feedback.
Agent Perception, Cognition and Action
PerceptionObserve
- Read user input
- Get data from tools
- Observe environment
CognitionThink
- Understand goal
- Plan and reason
- Decide next action
ActionDo
- Use tools
- Generate response
- Update memory
Types of Agent Architectures
| Type | Description | Use case |
|---|---|---|
| Single Agent | Single LLM with tools and memory | Simple tasks, personal assistant |
| Agent with Tools | LLM + external tools/APIs | Real-time data, code execution |
| Multi-Agent | Multiple agents collaborating | Complex workflows, large tasks |
| Hierarchical Agent | Manager agent with sub-agents | Enterprise automation |
Example: Simple Agent Workflow
- 1User provides a goal (e.g. “Find best laptops under 50000”).
- 2Agent understands the task and creates a plan.
- 3Agent decides to use a web search tool.
- 4Executes the search and gets results.
- 5Analyzes the results and prepares a summary.
- 6Returns the final response to the user.
Key Takeaways
- An agent is more than just an LLM; it can plan, reason, use tools and learn.
- Core components: LLM, memory, tools, planning and action execution.
- Different architectures are used based on the complexity of tasks.
- Agents enable automation of real-world, multi-step tasks.