Agent Anatomy: Components of an Agentic System¶
Definition¶
An agent is an autonomous software system composed of four core components working together to perceive an environment, reason about it, take action, and learn from outcomes.
Formal Definition: A situated, goal-directed system capable of perceiving its environment, maintaining internal state, deciding on actions, and executing those actions to change the environment.
The Four Core Components¶
1. The Large Language Model (LLM)¶
Purpose: The cognitive engine providing reasoning and decision-making
| Aspect | Details |
|---|---|
| Role | Reasoning, planning, decision-making |
| Input | Current state + history + goal |
| Output | Next action(s) or decision |
| 2025 Status | Frontier models (Claude 3.5, GPT-4o, Gemini 2.0) |
What it does: - Interprets the current situation - Considers available actions - Chooses actions based on goals and constraints - Generates explanations and reasoning traces
Key insight: The LLM is NOT doing reasoning through hidden weightsβit's generating reasoning step-by-step through tokens, making it debuggable and verifiable.
# Example: LLM decision-making
system_prompt = """You are a research agent. Given a goal and available tools,
decide what action to take next."""
response = llm.generate(
system_prompt=system_prompt,
user_message=f"Goal: {goal}\nAvailable tools: {tools}\nCurrent state: {state}"
)
# Output: "I should use the search tool to find recent papers on..."
2. Memory System¶
Purpose: Maintain context, store experiences, enable learning across time
| Type | Duration | Purpose | Storage |
|---|---|---|---|
| Short-term | Current task | Current context window | LLM context |
| Episodic | Hours/days | What happened before | Vector DB |
| Procedural | Long-term | How to do things | Learned patterns |
| Semantic | Persistent | General knowledge | External KB |
What it does: - Maintains the agent's "working memory" (current task state) - Stores past interactions for learning and context - Enables information retrieval when needed - Provides grounding in reality
# Example: Multi-tier memory
class AgentMemory:
def __init__(self):
self.context_window = [] # Short-term
self.episodic_store = VectorDB() # What happened
self.knowledge_base = RAGSystem() # What to know
self.procedures = ProcedureCache() # How to do things
def remember(self, event: str):
"""Store an event"""
self.episodic_store.add(event)
def recall(self, query: str):
"""Retrieve relevant memories"""
return self.episodic_store.retrieve(query)
3. Planning System¶
Purpose: Decompose complex goals into executable action sequences
| Component | Function |
|---|---|
| Goal Parser | Understand what the user wants |
| Task Decomposer | Break goals into sub-goals |
| Action Planner | Decide sequence of actions |
| Constraint Handler | Apply limitations and rules |
What it does: - Takes high-level goals and breaks them into sub-tasks - Determines action sequences - Handles dependencies between tasks - Adjusts plans when obstacles arise
# Example: Planning
planner = AgentPlanner()
goal = "Find and summarize recent research on quantum error correction"
plan = planner.decompose(goal)
# Output:
# 1. Search for recent papers on quantum error correction
# 2. Filter results for last 6 months
# 3. Retrieve full texts
# 4. Summarize key findings
# 5. Compile report
4. Tool Use / Action Execution¶
Purpose: Interact with external systems and environments
| Type | Examples |
|---|---|
| APIs | Web search, database query, LLM calls |
| File systems | Read/write documents, code |
| Computational | Math, code execution, data analysis |
| Communication | Email, messaging, notifications |
What it does: - Translates LLM decisions into executable actions - Calls external APIs and tools - Handles tool responses and errors - Grounds reasoning in reality
# Example: Tool use
tools = {
"search": lambda query: google_search(query),
"fetch": lambda url: fetch_content(url),
"summarize": lambda text: llm.summarize(text),
"save": lambda file, content: save_to_file(file, content)
}
# Agent uses tools:
result = tools["search"]("quantum error correction 2024")
content = tools["fetch"](result[0]["url"])
summary = tools["summarize"](content)
tools["save"]("report.md", summary)
System Architecture Diagram¶
- βββββββββββββββββββββββββββββββββββββββββββββββ
- USER GOAL / ENVIRONMENT β
- β¬βββββββββββββββββββββββββββ
β
- ββββββββββββΌβββββββββββ
- PERCEPTION β
- (Parse goal, state) β
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- MEMORY β ββββ Store/Retrieve
- (Context mgmt) β Past experiences
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- LLM REASONING β ββββ Cognitive engine
- (What should I do?) β
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- PLANNING β ββββ Decomposition
- (Action sequence) β
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- ACTION / TOOLS β ββββ External systems
- (Execute decision) β
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- REFLECTION β
- (Did it work?) β
- β¬βββββββββββ
β
- ββββββββββββΌβββββββββββ
- FEEDBACK LOOP β βββ
- (Update context) β β
- β β
- β² β
- β
Agent vs Other System Types¶
Chat Application¶
User Input β LLM Response β User Output
(No internal state, no tools, responds to queries)
RAG System¶
User Query β Retrieve Docs β Augment Prompt β LLM Response
(Better answers through retrieval, but still just responds)
Agentic System¶
Goal β Perceive β Reason β Plan β Act β Reflect β Loop
(Autonomous, goal-directed, takes initiative)
Anatomy Checklist¶
Before claiming a system is "agentic," verify:
β
Has an LLM - Core reasoning engine
β
Has memory - Maintains state across time
β
Has planning - Decomposes goals
β
Has tools - Can take action
β
Has a loop - Repeats until goal achieved
β
Is autonomous - Doesn't wait for prompts
β
Has goals - Works toward objectives
β
Can reflect - Evaluates results
If it only responds to queries = Chat/RAG
If it has all above = Agent
The Minimum Viable Agent¶
A minimal agentic system needs:
class MinimalAgent:
def __init__(self, llm, tools):
self.llm = llm
self.tools = tools
self.memory = []
def run(self, goal):
"""Execute agent loop until goal achieved"""
while not self.done(goal):
# Perceive: What's the current state?
state = self.get_state()
# Reason: What should I do?
action = self.llm.decide(goal, state, self.memory)
# Act: Execute the action
result = self.tools[action.tool](*action.args)
# Reflect: Did it work?
self.memory.append((state, action, result))
if self.goal_achieved(goal, result):
return result
Complexity Spectrum¶
| Complexity | Components | Use Case |
|---|---|---|
| Minimal | LLM + Simple tools | Prototypes |
| Basic | LLM + Memory + Tools | Production agents |
| Advanced | + Planning + Reflection | Complex tasks |
| Enterprise | + Multi-agent + Safety | Mission-critical |
Key Takeaways¶
- Agents are not monolithic - They're systems of 4 distinct components
- Each component matters - Missing any one breaks agency
- LLM is the brain, not the whole organism - Other parts are critical
- Memory is often underestimated - Context management is hard
- Tools ground reasoning - Without tools, agents can only talk
Next Steps¶
- Read About The Agent Loop - Understand the execution flow
- Jump To Patterns - See how these components interact
Last Updated: August 9, 2026