Agentic Architecture

Where AgenticWorkflowDesign focuses on the loop and AiAgentArchitectures on the named patterns (ReAct, Plan-and-Execute, etc.), this page is about how agentic components fit into a larger system. Most production deployments aren't pure agents — they're traditional services with agents embedded at specific points.

The composition spectrum

Three positions a system can take on agency:

PositionExampleWhen it fits
Tool of an agentApplication is a tool the agent calls. Agent is in charge.Open-ended assistant tasks, research helpers
Pipeline with agent stepsApplication is in charge; agent handles certain steps where flexibility is neededMost production usage; structured workflows with one or two agentic stages
Agent of a toolApplication is the system; agent is invoked when it needs help (e.g., from a help button).Mostly traditional with optional agent assistance

Most production systems are in the middle: a structured workflow where one or two steps need an agent. Pure agent-in-charge architectures are rare in production because they're hard to bound, hard to evaluate, and hard to make compliant.

Pattern: LLM-as-Router

An LLM examines incoming requests and routes them to specialised handlers (which may themselves be agents, deterministic services, or other LLMs).

User query → Classifier LLM → 
  ├─ FAQ handler (deterministic, fast)
  ├─ Account lookup (RAG agent)
  ├─ Refund request (multi-step agent with approval)
  └─ Escalate to human

Why it works: most user requests fall into a small number of categories. A cheap router classifies once; the right specialist handles the rest. Saves cost (specialists are cheaper / faster than one all-purpose agent) and improves quality (specialists are tuned for their case).

Failure modes:

Pattern: Pipeline with embedded agent

A traditional pipeline (validation → enrichment → processing → response) where one stage uses an agent:

Request → Validate → Enrich (RAG agent) → Generate response (LLM) → Audit log → Send

The validate, audit, and send stages are deterministic. The enrich and generate stages are agentic. The pipeline structure constrains the agent's scope — it doesn't have to decide when to terminate; the pipeline does.

This is the dominant pattern for chatbots, support agents, and most "smart" features. The agent is doing the open-ended work; the pipeline ensures the user gets a response in bounded time with bounded cost.

Pattern: Parallel agents with synthesiser

For tasks where multiple perspectives or modalities help, run agents in parallel; synthesise.

Question → 
  ├─ Search-the-web agent
  ├─ Search-internal-docs agent  
  ├─ Search-recent-conversations agent
  → Synthesiser LLM → Final answer

Wins on questions where the right answer is a combination of sources. Costs more (multiple agents); is fast in wall-clock if parallelised.

The synthesiser is critical. A weak synthesiser produces inconsistent or contradictory output; a good one weighs the sources and surfaces conflict. Tune the synthesiser prompt heavily; A/B against simpler "use only source N" baselines.

Pattern: Agent supervisor over deterministic workers

Inverse of the embedded-agent pattern. A long-running agent decides what to do next; specialised tools or services execute deterministically.

                    ┌──────────┐
goal ──────────────▶│  Agent   │
                    │ (planner │
                    │ + state) │
                    └────┬─────┘
                         ▼
        dispatches to one of:
        ├─ DB query tool
        ├─ HTTP fetch tool
        ├─ Email send tool
        └─ Calendar tool

The agent has the autonomy; the tools are just deterministic capabilities. Each tool has a narrow contract; the agent composes them.

This is ReAct architecturally. Productionising it requires:

Pattern: Long-running agent with checkpoints

For tasks lasting minutes to hours: research, complex code generation, multi-step business processes. The agent runs as a graph (LangGraph or similar); state is checkpointed at every transition; human can intervene.

Start ─▶ Research ─▶ Plan ─▶ Execute ─▶ Review ─▶ Submit
   │       │          │        │         │
   ▼       ▼          ▼        ▼         ▼
   checkpoint table — resumable, inspectable, interruptible

Difference from embedded-agent pattern: the agent is the system, not a step inside one. Production examples: code-generation agents (Devin and similar), research agents, customer-support agents handling complex multi-turn cases.

Operational requirements:

Where to draw the autonomy line

For each decision the system makes, ask: deterministic logic, agent decision, or human approval?

Decision classBest mechanism
Data validation against fixed schemaDeterministic
Routing user request to categoryAgent (LLM router)
Selecting which tool to callAgent
Executing a known operationDeterministic
Composing a responseAgent
Triggering a refund > $thresholdHuman approval
Modifying production dataDeterministic + audit
Acknowledging an alertAgent or human depending on severity

The pattern: agents handle ambiguous decisions; deterministic code handles unambiguous ones; humans handle decisions with stakes you wouldn't put in code.

This decomposition is the work. Draw the boundaries badly (agent making decisions that should be deterministic, deterministic code where flexibility is needed) and the system disappoints.

The cost equation

Agentic architectures cost more than their non-agentic equivalents:

The savings (relative to fully-coded equivalents) come from:

For tasks where the variation is small and the logic is simple, agentic architecture is overkill. For tasks where the variation is large or the logic is genuinely hard to specify, agents earn their keep.

Anti-patterns

A pragmatic decision tree

For a new feature where agentic might fit:

  1. Can this be solved with a query / template / coded logic? Try first; baseline.
  2. Can it be solved with a single LLM call (no tools)? Try second.
  3. Does it need RAG? Add retrieval; still single-LLM-call.
  4. Does it need tool use? Add tool use; single agent.
  5. Does it need multi-step planning? Add a graph orchestrator.
  6. Does it need multiple specialists? Add supervisor / parallel agents.

Stop at the simplest level that works. Don't skip levels.

Further reading