Working through this module?0 of 19 done
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.

2.1

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
Inside the agent: four capabilities wired to external memory and tools.
2.2

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.
2.3

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
Observe → think → do, repeated every step.
2.4

Types of Agent Architectures

TypeDescriptionUse case
Single AgentSingle LLM with tools and memorySimple tasks, personal assistant
Agent with ToolsLLM + external tools/APIsReal-time data, code execution
Multi-AgentMultiple agents collaboratingComplex workflows, large tasks
Hierarchical AgentManager agent with sub-agentsEnterprise automation
2.5

Example: Simple Agent Workflow

  1. 1User provides a goal (e.g. “Find best laptops under 50000”).
  2. 2Agent understands the task and creates a plan.
  3. 3Agent decides to use a web search tool.
  4. 4Executes the search and gets results.
  5. 5Analyzes the results and prepares a summary.
  6. 6Returns the final response to the user.
2.6

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.