How to build an AI agent: patterns and components
How to build an AI agent: start from the business need, choose a workflow or an orchestrator, decide the agent count, then pick model, tools and memory.
Teams often start by asking which framework to use, or whether they need one agent or several. Those questions matter, and they come second. The first question is what business need the agentic system has to serve.
A deep understanding of the problem, its context and the goal is the first step toward a working agentic solution. Patterns, components and every other design decision follow from it. (For a short definition of the term, see how to create an AI agent in our glossary.)
Take an example. A marketing team needs to publish long-form articles every week. Each one has to follow the brand voice, rely on verified sources and hold up to an expert reader. Writing them by hand takes too long, and generic AI output falls short of the standard. The team decides to build an agentic system that takes a brief and delivers a publication-ready text.
The rest of this article uses that need to show how the choice of pattern and components follows from it.
Patterns and their impact #
A pattern is the approach the system uses to decide what to do next. There are two broad patterns, and in practice they are often combined. Strictly speaking, a workflow is not an agent. Both are agentic systems, though, and "AI agent" is often used loosely for both.
Workflow
In a workflow, the builder defines the path in advance. The system goes through set steps in a set order, and finishing the last step delivers the result. A workflow can include rules, such as retrying a step that fails a check, but the model does not decide the sequence. Pre-defined, hard-coded rules guide the LLM along the path.
For the writing system, a workflow could look like this. Starting from the brief, the system:
- Runs research.
- Outlines the text.
- Writes each section.
- Edits and checks grammar.
- Finalizes the text.
A workflow can also be a multi-agent system, which runs against common intuition. In that case one or more steps are executed by a separate agent instead of a tool, and the order of steps stays fixed.
Agent
The more sophisticated pattern gives up the fixed sequence in favor of agent autonomy. More sophisticated does not always mean better. In agent orchestration, an orchestrator agent decides which step to run next. The steps from the workflow example become tools or sub-agents, each responsible for one job.
This pattern suits non-linear, less predictable problems that a workflow handles poorly. With no fixed sequence, the orchestrator can go back and re-run steps. For example:
- The orchestrator runs the research.
- Based on the research, it prepares the outline.
- It writes the text from the outline and, while writing, spots a gap in the narrative.
- It returns to research and gathers the missing information.
- It finishes the text according to the outline.
- During editing, it spots inconsistencies left over from steps 4 and 5.
- It returns to writing and updates the text.
- It finalizes the text.
The system can adjust in real time as problems surface, which can produce better results on tasks where those problems only appear mid-process. The cost is predictability. The path differs from run to run, so the system is harder to test and audit. That is why regulated processes, for example in finance or healthcare, often favor workflows, or orchestrators with tight guardrails.
Choosing a pattern
The business need decides which pattern fits. Three questions help:
- How predictable is the task? If the steps and their order are known in advance, a workflow is enough. If problems surface only while the work is being done, an orchestrator can respond to them.
- How much auditability is required? The more a process must be traceable and repeatable, the stronger the case for a workflow.
- What costs more: an error or a missed improvement? Where a wrong action is expensive, a fixed path limits risk. Where quality depends on iteration, the freedom to re-run steps pays off.
In the writing example, research gaps usually appear only during writing, and quality matters more than a fixed path. That points toward an orchestrator.
Single-agent vs multi-agent architectures #
Pattern and agent count are separate decisions. A single-agent system runs one reasoning loop on one model, with all context and tools in one place. A multi-agent architecture splits the work between agents, each with its own instructions and context, and sometimes its own model. As the workflow section shows, either pattern can be built either way.
Splitting the work has a price. Every handoff adds coordination overhead, because outputs must be passed on, checked and reconciled. Anthropic reported that in its data, agents typically use about four times more tokens than chat interactions, and multi-agent systems about 15 times more (Anthropic). The same report found that a multi-agent setup outperformed a single agent by 90.2% on Anthropic's internal research evaluation, a task that split into independent, parallel threads. When agents depend heavily on each other's context, coordination becomes a bottleneck. Anthropic's engineering guidance on agents recommends "finding the simplest solution possible, and only increasing complexity when needed" (Anthropic).
In real projects, the number of agents follows the task. For Mixam, we built a three-agent advisor that uses 15 tools to guide customers through more than a billion print product combinations, reaching a 95.4% success rate.
Components #
The pattern describes how the problem is solved. The core components turn it from an abstract plan into a working system: the language model, tools and memory.
Language model
The language model is the reasoning engine of the system. It interprets the task and decides how to approach it. In an orchestrator, it also chooses which tool or sub-agent to use next. This is usually a large language model, and the choice depends on constraints. Systems that must run on a company's own infrastructure, such as sovereign AI deployments, may use smaller models that are easier to host.
Tools
Tools are what the system uses to act beyond generating text.
External connections are integrations with outside systems, such as a CRM, a database, email, search or internal APIs. They let the agent read live data and take actions, like creating a ticket or updating a record.
Sub-agents take a job that needs its own context and judgment. A sub-agent is a separate agent with its own instructions and memory.
Skills are instructions the agent loads for a specific kind of work, such as how to format a report, which checks to run on a draft, or which house rules apply. A skill gives the agent no new access. It tells the agent how to use what it already has. Skills extend what the agent knows how to do, and tools extend what it can do.
Every tool adds a choice the agent has to make on each step. A small set of clearly described tools produces more reliable behavior than a large set with overlapping purposes. Each connection also needs defined permissions, because the agent can only do what its access allows.
For example, an agent given PowerShell access on Windows can run in FullLanguage mode, which permits all language elements (Microsoft). ConstrainedLanguage mode limits the object types the agent can use, but Microsoft notes it can be bypassed unless it is enforced through App Control for Business. Without that, the stronger control is the account the agent runs under: give it only the permissions the task needs. We describe this risk in Prompt injection is not the vulnerability. Your agent's tools are.
Memory
Memory is where the system stores what it needs across steps and sessions: facts about the user or client, decisions already made and intermediate results.
Working memory holds the current task: the conversation, retrieved documents and outputs from earlier steps. Persistent memory carries information from one session to the next, so the system does not start from zero each time.
Too much memory can be a liability, because the system loses its fresh sight. Old assumptions, outdated facts and early mistakes get carried into every new task, and the agent keeps building on what it stored instead of looking at the problem again. A useful memory design decides what is worth keeping, removes what has gone stale and lets some steps run without history.
Example: components in the writing system
In the writing example, the components could work like this:
- Memory stores the brief and the working version of the text. A separate "sketchbook" holds the findings from the research phase.
- Research goes to a sub-agent with web search access, because it produces a lot of raw material the orchestrator does not need in its context.
- Writing and editing stay with the orchestrator as skills, since they need the full picture of the text.
- Review can be a skill of the orchestrator or a separate agent. A separate agent has one advantage: it has not seen the reasoning that produced the draft, so it reads the text with fresh sight.
Summary #
Patterns and components are available technology. The starting point is the need. In the example, the need came first: publication-ready articles in a fixed voice, with verified sources. That need pointed to an orchestrator, and the orchestrator determined which components the system required. Building an AI agent follows the same order: analyze the core problem, choose the pattern, then assemble the components.
Sources (4)
- Anthropic, How we built our multi-agent research system (token use of agents and multi-agent systems versus chat; 90.2% result on the internal research evaluation), June 2025
- Anthropic, Building effective agents (recommendation to start with the simplest solution), December 2024
- Microsoft Learn, about_Language_Modes (PowerShell FullLanguage and ConstrainedLanguage modes; App Control for Business requirement)
- Vstorm, Mixam case study (three agents, 15 tools, more than a billion product combinations, 95.4% success rate)


