Agent Architecture · Track 4 & 7

Ship Production AI Agents from Simple Loops to Multi-Agent

From simple loops to networked agent systems.

An AI agent is a system where a language model decides what actions to take, executes them using tools, observes the results, and iterates — without a human steering each step. Claude's 200K context window, native tool use, and reliable instruction-following make it one of the strongest foundations for production agent systems available today.

What makes a system an “agent”?

Three things separate agents from regular LLM calls:

  1. 1
    Autonomous decision-making: The model decides what to do next — which tool to call, what parameters to use, whether to continue or stop — without a human specifying each action.
  2. 2
    Tool access and action execution: The agent can interact with the world: query APIs, read and write files, send messages, execute code. Actions have real effects beyond generating text.
  3. 3
    Multi-step iteration: The agent observes the result of each action and uses that to inform the next decision. It runs in a loop until the task is complete, handling intermediate failures along the way.

Architecture Patterns

6 agent architectures, from simple to advanced

Start here
Single-agent loop
One Claude instance with access to a set of tools. It receives a task, calls tools as needed, reads results, and continues looping until the task is complete or it determines it cannot proceed. The foundation of every agent architecture.
Most common
Orchestrator + subagent
An orchestrator Claude breaks a complex task into subtasks and delegates each to a specialized subagent. The subagent runs its own loop, reports back, and the orchestrator synthesizes the results. Scales well for tasks with parallelizable steps.
High throughput
Parallel subagents
The orchestrator fans out identical or similar tasks to multiple subagent instances simultaneously — research on 10 companies, translate into 7 languages, run 5 experiments. Results converge back to the orchestrator for synthesis.
Production-grade
Specialist network
A router agent classifies incoming tasks and dispatches them to domain-specialist agents — one for finance, one for code, one for legal. Each specialist has its own tools and system prompt. No single agent tries to do everything.
Safety-first
Human-in-the-loop
The agent pauses at defined checkpoints and surfaces a decision or approval request to a human before continuing. Essential for high-stakes or irreversible actions — sending emails, committing code, executing payments.
Async / automation
Event-driven pipeline
Agents triggered by external events — a new file in S3, a webhook from Stripe, a Slack message — rather than direct user input. The agent runs, completes its task, and exits. Ideal for automation and background processing.

Memory Systems

How agents remember things

In-context memory

Ephemeral — cleared on session end

The conversation history within a single session. Claude can reference everything said so far. Limited by the context window (200K tokens) but requires no external storage.

External memory (vector store)

Retrieval quality determines effectiveness

Relevant documents and past interactions retrieved via semantic search and injected into the context window. Enables memory that spans sessions and scales beyond context limits.

Structured state (database)

Requires explicit state schema design

Agent state written to a database between steps. The agent reads its own state at the start of each turn. Enables complex multi-step workflows that survive interruptions and restarts.

Episodic summaries

Lossy — fine detail may be dropped

At the end of each session, a summarization pass condenses the conversation into a compact memory entry. Future sessions load the summary, not the full history.

Code Pattern

The agentic loop in Python

agent_loop.py
def run_agent(task: str, tools: list, max_turns: int = 10):
    messages = [{"role": "user", "content": task}]

    for turn in range(max_turns):
        response = client.messages.create(
            model="claude-opus-4-5",
            tools=tools,
            messages=messages,
        )

        # Task complete — no tool calls
        if response.stop_reason == "end_turn":
            return response.content[0].text

        # Execute tool calls and collect results
        tool_results = []
        for block in response.content:
            if block.type == "tool_use":
                result = execute_tool(block.name, block.input)
                tool_results.append({
                    "type": "tool_result",
                    "tool_use_id": block.id,
                    "content": json.dumps(result),
                })

        # Add assistant turn + tool results to history
        messages.append({"role": "assistant", "content": response.content})
        messages.append({"role": "user", "content": tool_results})

    raise RuntimeError(f"Agent did not complete in {max_turns} turns")

Agent safety: what to get right early

Set a max_turns limit on every agentic loop — never allow unbounded iteration

Flag irreversible actions (send email, delete record, execute payment) for human confirmation

Log every tool call with inputs and outputs — agents are hard to debug without a full action trace

Use a minimal permission model — give the agent only the tools it needs for the current task

Return structured errors from tools, not exceptions — let the agent read and respond to failures

Test with low-stakes variants of production tools before connecting to real systems

Build your first Claude agent

Track 4 covers tool use, agentic loops, and multi-step workflows end-to-end.