Agent architecture

Who owns each agent step, and how can a reviewer verify what actually happened?

Choose a delegation topology, contract tool effects, vet MCP servers and plugin lifecycles, guard the loop, keep memory correctable, and inspect or resume long runs.

AI VISTA / DECISION01 / 03
WORKING DECISIONGive external connections, effects, budgets, memory, and handoffs named owners; connect each executed step to reviewable evidence.
01INPUT
02CHECK
03BOUNDARY
RETURN TO THE REAL TASK✓

DECISION BRANCH

Answer the decision this topic actually owns.

  1. ASK FIRST↓

    Which steps can be reviewed independently, and who chooses the next step after handoff?

  2. IF↓

    Delegation reduces rework with clear control, split by tool effects and shared state.

  3. OTHERWISE✓

    Keep one agent or a fixed workflow, with less shared state and durable memory.

WORKED CASE

Does a refund investigation need two specialist agents?

A support assistant must check order facts and the current refund policy before drafting a reply. Those read-only checks can be delegated, but the parent must own ticket state. A one-off request must not silently become cross-session memory.

WORKING ARTIFACTA delegation map, tool contract, loop guard, and rules for writing, correcting, and deleting memory.
01WEAK SHORTCUT

Give several agents shared CRM write access, let them relay each other's latest claims, and save the entire conversation as long-term memory.

02BETTER JUDGMENT

Delegate only reads with independent acceptance checks. Specialists return sources, versions, and uncertainty; the parent owns tool effects, run budgets, and handoff state. Save a stable preference only after confirmation, with correction and deletion paths.

03ACCEPTANCE

Replay a policy-version conflict, a slow tool, a repeated query, and a memory correction and deletion. The parent can explain each handoff, stops at the budget, and cannot retrieve the deleted preference.

ENTRY & EXIT SIGNALS

Know when to enter—and when the decision is good enough to leave.

A topic is not an endless knowledge directory. Entry signals tell you whether the problem belongs at this layer. Exit signals decide whether to continue instead of substituting time spent reading for work completed.

AI VISTA / DECISION STATUSAgent architecture
01ENTER HERE
  • The task now has specialist checks that can be reviewed separately
  • Tool feedback must determine the next useful step
  • The agent may keep user information across sessions
02LEAVE WHEN
  • Each delegation names its owner, evidence, and shared state
  • Tool effects, turn limits, and spending limits have enforceable boundaries
  • Memory writes, corrections, and deletions pass a replay

Carry control ownership, tool contracts, and durable state into action-level approval, human review, and recovery design.

12 PRACTICES

Build the judgment, make the artifact, then review it with real cases.

01 Design an AI agent tool contract before exposing the functionSpecify an agent tool's input schema, preconditions, authorization, side effects, idempotency, timeout results, and trace before making it callable. Agent architecture 02 How to implement an AI agent tool-calling loopBuild a provider-aware round trip that assembles complete calls, validates before execution, pairs every result, and resumes from durable state. Agent architecture 03 When should an AI agent continue, retry, or stop?Use observable progress, separate turn and cost budgets, error classes, and duplicate-action checks to govern each step of an agent run. Agent architecture 04 Subagent or multi-agent? Choose the delegation topologyCompare one agent, a manager calling specialists, a conversation handoff, and parallel delegation by control ownership, shared state, cost, and failure recovery. Agent architecture 05 When should an AI agent save, correct, or delete long-term memory?Design a cross-session memory rule for what to save, how to handle a changed preference, and how to verify deletion across retrieval and retained copies. Agent architecture 06 How can a long-running AI agent task resume without repeating work?Design a durable checkpoint, approval and operation ledger, and single-owner resume gate for agent jobs that outlive one process or wait for a person. Agent architecture 07 How to debug one AI agent run from its observable traceReconstruct a single agent run with spans, tool call IDs, approval changes, and external state to find the first evidenced divergence without exposing sensitive trace data. Agent architecture 08 What should you check before connecting a third-party MCP server?Vet a third-party MCP server's discovered tools, OAuth or local credentials, data destinations, version changes, failure behavior, and revocation before an agent can use it. Agent architecture 09 When should a repeated AI task become an agent skill?Decide whether a recurring task has a stable trigger, inputs, steps, acceptance test, and owner before packaging it as a reusable agent skill. Agent architecture 10 How do you load and unload an agent plugin safely?Test registrations, event errors, resource cleanup, two hot reloads, disablement, partial initialization, and external effects before shipping an agent extension. Agent architecture 11 Your MCP server works locally. What breaks when a team depends on it?A production-readiness review for MCP servers covering per-user credentials, tool allowlists, tenant boundaries, rate limits, audit logs, and failure isolation. Agent architecture 12 Log the decision, not the prompt: a trace schema for AI agentsA practical trace schema for agent runs that records identity, tool effects, approvals, state changes, and costs—without storing secrets or full prompts. Agent architecture

BOUNDARY

What this topic page will not do

A delegation topology, tool contract, and memory rule describe execution; they do not grant authority to act in an external system.

01Do not add agents to steps a fixed workflow can perform02Do not give several agents shared write access without coordination03Do not store an inferred preference as a confirmed user fact
When delegation, tool effects, run budgets, and memory lifecycle can be reviewed, set permission and human gates for each external action.