A sound AI agent architecture for a startup is a single model calling a small set of typed tools inside a loop that your own code controls, with a hard turn limit, permission gates on risky actions and a trace of every step. Anthropic, OpenAI and Microsoft all now publish guidance that points the same way: begin with the simplest pattern that solves one well-defined job, and add orchestration, extra agents or long-term memory only when tests show you need them. The rest of this guide explains each layer, what the vendor documentation actually says, and where the costs hide.

Workflows versus agents

The most useful distinction for a small team comes from Anthropic's engineering essay Building effective agents, published on 19 December 2024 by Erik Schluntz and Barry Zhang. It separates two kinds of "agentic system". Workflows are "systems where LLMs and tools are orchestrated through predefined code paths". Agents are "systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks."

That framing matters because most startup use cases are workflows in disguise. Triage an inbound email, pull the customer record, draft a reply: the steps are known in advance, so a fixed chain with checks between steps is cheaper, faster and easier to test than an open-ended agent. The same essay warns that agentic systems "often trade latency and cost for better task performance" and that for many applications "optimizing single LLM calls with retrieval and in-context examples is usually enough."

A practical rule follows. Write down the job and its definition of done in one sentence. If you can draw the steps as a flowchart, build a workflow. Reach for a true agent only when the path genuinely depends on what the model discovers along the way, as with debugging code or open-ended research.

Five patterns worth knowing before you write code

Anthropic's essay names five workflow patterns that cover most production designs:

  • Prompt chaining: each call processes the previous call's output, with programmatic "gates" in between to check the process is on track.
  • Routing: classify the input, then send it to a specialised prompt, tool set or model. The essay gives the example of sending easy questions to a smaller model and hard ones to a more capable one.
  • Parallelisation: run independent subtasks at once, or run the same task several times and vote.
  • Orchestrator-workers: a central model breaks a task down at run time and delegates pieces to worker calls.
  • Evaluator-optimiser: one call generates, another critiques, and the loop repeats.

The agent itself is described as "typically just LLMs using tools based on environmental feedback in a loop." That loop has an academic lineage. The ReAct paper by Shunyu Yao and colleagues, first submitted to arXiv on 6 October 2022, showed that interleaving reasoning traces with actions beat imitation and reinforcement learning baselines on the ALFWorld and WebShop benchmarks by absolute success rates of 34% and 10%, using only one or two in-context examples. Most agent frameworks today are refinements of that reason, act, observe cycle.

The core components and how to build each one

Model

Pick the model per step, not per product. Routing lets a cheap model handle classification while a stronger one handles the step that needs judgement. Whatever you choose, record the exact model version in your traces, because model names, prices and context windows change frequently (checked October 2026) and you will want to know which version produced which result.

Tools

Tools are where most agent failures start. Anthropic's September 2025 post on writing effective tools for agents recommends building "a few thoughtful tools targeting specific high-impact workflows" rather than wrapping every API endpoint. Its example: offer search_contacts instead of list_contacts, so the agent does not page through an entire address book. It also suggests namespacing tools by service and resource (for instance asana_projects_search versus asana_users_search) and notes that Claude Code restricts tool responses to 25,000 tokens by default to protect the context window.

Enforce schemas at the API level, too. OpenAI's function calling guide says plainly: "We recommend always enabling strict mode." Strict mode uses structured outputs so arguments match your JSON schema, which requires additionalProperties: false on every object. Anthropic's tool use documentation covers the equivalent pattern for Claude.

For connecting tools across products, the Model Context Protocol has become the common interface. Anthropic introduced MCP on 25 November 2024 as "a universal, open standard for connecting AI systems with data sources", shipping a specification, SDKs and an open-source repository of servers. Using MCP means a tool you build once can be reused by different agent hosts.

Memory and context

Treat context as a budget. Anthropic's post on context engineering for agents (29 September 2025) describes "context rot": as the number of tokens in the window rises, recall from that window falls, across all models. Its guiding principle is to find "the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome". It lists three techniques for long tasks: compaction (summarise a conversation nearing the limit and restart with the summary), structured note-taking stored outside the context window, and multi-agent designs. Start with the current conversation and tool results; add persistent notes when a task genuinely spans sessions.

Control loop

The loop belongs in your code, with limits. In the OpenAI Agents SDK, the runner calls the model, executes any tool calls, appends results and repeats; if a run exceeds `max_turns` it raises MaxTurnsExceeded, and error handlers can return a controlled message instead of crashing. Whatever framework you use, set a turn limit, a wall-clock timeout and a spending cap per task.

Single agent first, and what multi-agent really costs

The strongest public evidence on multi-agent systems is Anthropic's June 2025 write-up of how it built its multi-agent research system. A lead agent on Claude Opus 4 with Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2% on its internal research evaluation. The bill was steep: in its data, agents used about four times more tokens than chat interactions, and multi-agent systems about 15 times more. Token usage alone explained 80% of performance variance on the BrowseComp evaluation.

The authors are explicit about fit. Domains where agents must share the same context or have many dependencies "are not a good fit for multi-agent systems today", and "most coding tasks involve fewer truly parallelizable tasks than research." For a startup, that translates into a test: split into multiple agents only when subtasks are genuinely independent, the work exceeds one context window, and the value of a completed task justifies paying many times more per run.

When you do split, the framework vocabulary helps. The OpenAI Agents SDK offers "agents as tools" and handoffs as its delegation primitives. Microsoft's Agent Framework describes itself as "the direct successor" to Semantic Kernel and AutoGen, adding graph-based workflows for explicit multi-agent orchestration. AWS offers managed Amazon Bedrock Agents that call APIs and query knowledge bases. Anthropic's advice on frameworks is a useful counterweight: they help you start quickly, "but don't hesitate to reduce abstraction layers and build with basic components as you move to production."

Guardrails and permission design

Security people have a name for the most common architectural mistake. The OWASP entry on Excessive Agency (LLM06:2025) traces it to three root causes: excessive functionality, excessive permissions and excessive autonomy. Its examples are familiar to anyone who has wired up an agent quickly: an extension that only needs to read data but connects with an identity that can also update and delete, or a tool meant to run one shell command that accepts arbitrary input.

Mitigations map directly onto architecture choices:

  1. Give each tool the narrowest function it needs, so a mail agent that reads messages has no send capability.
  2. Authenticate tools with the end user's scoped credentials (for example an OAuth read-only scope) rather than a shared admin account.
  3. Require human approval for irreversible actions such as payments, deletions or outbound messages.
  4. Validate inputs before they reach the model and outputs before they reach a tool.

The OpenAI Agents SDK builds input and output guardrails and human-in-the-loop approval into its primitives, which is a reasonable model to copy even if you use another stack. Make "hand to a human" a normal end state of the loop, logged like any other outcome.

For governance beyond engineering, the NIST AI Risk Management Framework, released on 26 January 2023, and its Generative AI Profile (NIST-AI-600-1, 26 July 2024) give a vocabulary for mapping and managing risk that investors and enterprise buyers increasingly recognise. It is voluntary guidance, and this article is not legal advice.

Tracing and evaluation from the first commit

Record every model call, tool call, argument, result, token count and latency against a task ID, so any failed run can be replayed. The OpenAI Agents SDK ships with built-in tracing, and most other frameworks offer an equivalent or an OpenTelemetry export.

Then build a small evaluation set early. Anthropic's research team began with "a set of about 20 queries representing real usage patterns", noting that in early development "a prompt tweak might boost success rates from 30% to 80%", so effect sizes are large enough to spot with few cases. Track at least task completion rate, steps per completed task and cost per completed task, and rerun the set on every prompt, tool or model change.

A minimal reference stack

LayerJobSensible starting choice
InterfaceReceive the request, return the resultAPI endpoint, chat widget or Slack app
OrchestratorRun the loop, enforce turn, time and cost limitsYour own code or a light SDK
ModelReason and choose toolsOne hosted model, with routing added later
ToolsAct on systemsThree to five narrow, schema-checked tools
ContextHold what the task needsConversation plus tool results, compaction later
GuardrailsCheck inputs, outputs and actionsSchema validation, scoped credentials, approval gates
Tracing and evalsSee and measure behaviourFull traces plus a 20-case test set

George Bregman writes about running AI operations in young companies on georgebregman.com, and that operational view is the right lens here: an architecture is good when the team can see what the agent did, stop it, and measure whether a change made it better.

FAQ

How should a startup architect its first AI agent?

Define one job with a clear finish line, then check whether a fixed workflow would do it. If you need an agent, use one model, a handful of narrow tools with strict schemas, a loop with turn and cost limits, approval gates on irreversible actions and full tracing. Add more only when evaluations show a specific failure.

When is a multi-agent system worth it?

When subtasks are independent enough to run in parallel, the material exceeds one context window and the task is valuable enough to absorb roughly 15 times the token usage of a chat, the figure Anthropic reported for its own research system.

Do I need a framework?

No. The OpenAI Agents SDK, Microsoft Agent Framework and Amazon Bedrock Agents can speed up early work, but the core loop is short enough to write yourself, and doing so makes debugging easier.