LLM Agent Architecture Patterns
- title: LLM Agent Architecture Patternscreated: 2026-06-01updated: 2026-06-01type: concepttags: [agent, pattern, architecture]sources: [raw/articles/anthropic-building-effective-agents-2024.md, raw/articles/lilianweng-llm-agents-2023.md]
- LLM Agent Architecture Patterns
title: LLM Agent Architecture Patterns created: 2026-06-01 updated: 2026-06-01 type: concept tags: [agent, pattern, architecture] sources: [raw/articles/anthropic-building-effective-agents-2024.md, raw/articles/lilianweng-llm-agents-2023.md]
LLM Agent Architecture Patterns
Canonical patterns for building LLM-powered agents, synthesized from Anthropic’s “Building Effective Agents” (2024) and Lilian Weng’s “LLM Powered Autonomous Agents” (2023).
Core Distinction: Workflows vs Agents
Workflows: LLMs and tools orchestrated through predefined code paths. Predictable, consistent, good for well-defined tasks.
Agents: LLMs dynamically direct their own processes and tool usage. Flexible, good for open-ended problems where you can’t predict the path.
Anthropic’s advice: start with the simplest solution. Don’t use agents unless the problem demands it.
The Augmented LLM (Foundation Block)
Every agent builds on an LLM augmented with:
- Retrieval — access external knowledge
- Tools — call APIs, execute code, interact with environment
- Memory — retain information across calls
Model Context Protocol (MCP) is one standardized way to expose tools.
Workflow Patterns
1. Prompt Chaining
Decompose task into sequence of steps. Each LLM call processes previous output. Add programmatic “gate” checks. Trade latency for accuracy. Best for fixed subtasks. 1
2. Routing
Classify input → direct to specialized handler. Separation of concerns. Example: route easy questions to small models, hard questions to large models. 2
3. Parallelization
Two variations:
- Sectioning: independent subtasks run simultaneously, results aggregated
- Voting: same task run multiple times, diverse outputs for confidence 3
4. Orchestrator-Workers
Central LLM dynamically breaks down tasks, delegates to worker LLMs, synthesizes results. Subtasks NOT pre-defined — determined at runtime. Example: coding tools that modify multiple files. 4
5. Evaluator-Optimizer
Generator LLM produces output, evaluator LLM provides feedback, loop until quality threshold. Best when evaluation criteria are clear and refinement is measurable. 5
Agent Design Principles (Anthropic)
- Maintain simplicity — resist complexity unless it demonstrably improves outcomes
- Prioritize transparency — show the agent’s planning steps explicitly
- Craft the ACI (agent-computer interface) — invest in tool documentation like you would in HCI. Test extensively. Poka-yoke your tools to make mistakes harder.
Agent Components (Weng)
Three pillars:
- Planning — task decomposition (CoT, Tree of Thoughts), self-reflection (ReAct, Reflexion)
- Memory — short-term (context window), long-term (vector store + retrieval)
- Tool Use — MRKL architecture, function calling, toolformer patterns 6
Memory Architecture
| Human Memory | LLM Equivalent | Implementation |
|---|---|---|
| Sensory | Embedding representations | Text/image/audio → vectors |
| Short-term / Working | In-context learning | Context window (finite) |
| Long-term | External vector store | ANN retrieval (HNSW, FAISS, ScaNN) |
Retrieval metrics: relevance, recency, importance (Generative Agents paper). 7
Key Challenges
- Finite context length — limits history, instructions, API context. Vector stores help but lose representation power vs full attention.
- Long-term planning — LLMs struggle to adjust plans on unexpected errors.
- Natural language interface reliability — formatting errors, rebellious behavior. Much agent demo code is format parsing.
- Compounding errors — autonomous agents can drift. Need guardrails, checkpoints, human-in-the-loop.
Relevance to Pluronymous
These patterns directly inform the HermQube + MKCTP agent design. Key considerations:
- The substrate IS the shared memory + communication ground between agents
- Agent-computer interface design (ACI) matters as much as the agents themselves
- The chatroom is an agent-computer interface — tool definitions for messaging, presence, rooms need the same rigor
- Field-deployed agents need sandboxing, guardrails, and human oversight checkpoints
raw/articles/anthropic-building-effective-agents-2024.md ↩
raw/articles/anthropic-building-effective-agents-2024.md ↩
raw/articles/anthropic-building-effective-agents-2024.md ↩
raw/articles/anthropic-building-effective-agents-2024.md ↩
raw/articles/anthropic-building-effective-agents-2024.md ↩
raw/articles/lilianweng-llm-agents-2023.md ↩
raw/articles/lilianweng-llm-agents-2023.md ↩
Write a comment