Key takeaways

  • Agentic systems decide their next step; workflows follow a path you define. Most production systems combine both.
  • Seven patterns cover most needs: prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer, autonomous agents and multi-agent systems.
  • Start with the simplest pattern that works and add autonomy only where it adds value.
  • Tools, memory and guardrails matter more than the choice of model.
  • Evaluate task success, tool-call accuracy, cost and escalations, not just answer quality.

A year ago, most “AI agents” were chatbots with a new label. Today, agents book meetings, reconcile invoices, triage support tickets and write reports that people actually use. The difference isn’t a smarter model. It’s architecture: how the model is connected to tools, memory and checks, and how much freedom it’s given at each step.

This guide covers the agentic AI architecture patterns we use in client projects, when each one fits, and the guardrails that keep agents reliable once real users and real systems are involved.

What makes an AI system agentic?

An AI system is agentic when it decides what to do next instead of following a fixed script. Give it a goal, and it chooses which tools to call, in what order, and when the job is done.

It helps to separate two families of systems. Workflows are LLM-powered steps arranged in a path you define in code: predictable, testable and cheap. Agents let the model direct its own process, which makes them more flexible and better at open-ended tasks, but also harder to predict. Most successful production systems use a mix: workflows wherever the path is known, and agent autonomy only where it genuinely adds value.

Start with the simplest design that solves the problem. Add autonomy only when a fixed workflow can’t handle the variety of real requests.

The core agent loop

Under the hood, almost every agent runs the same loop. It takes in the request and context, plans a next step, acts by calling a tool, observes the result, updates its memory, and repeats until the goal is met or it needs a person.

Figure 1. The agent loop. The model cycles through perceiving, planning, acting, observing and remembering until the goal is met or a person needs to step in.
  1. PerceiveRead the request plus relevant context: user details, conversation history and retrieved knowledge.
  2. PlanDecide the next step, or break the goal into a short plan.
  3. ActCall a tool: query a database, search documents, update a CRM record or send a draft for approval.
  4. ObserveRead the tool result, check for errors and decide whether the step worked.
  5. RememberStore what matters in working or long-term memory so later steps, and later conversations, benefit.

This loop is often implemented with the ReAct pattern, short for reason and act: the model writes a short reasoning step, picks a tool, reads the result, and reasons again. The important design work is in what surrounds the loop: which tools exist, what they’re allowed to do, how many iterations are permitted, and when control passes to a human.

7 agentic design patterns, from simple to autonomous

These patterns build on each other. The first five are workflows; the last two give the model real autonomy.

1. Prompt chaining

Break a task into fixed steps, where each LLM call works on the output of the previous one, with checks in between. Example: extract data from an invoice, validate it against the purchase order, then draft the approval email. Simple, reliable and easy to debug.

2. Routing

Classify the request first, then send it to the right specialised prompt, tool or model. A support system might route billing questions to one flow, technical issues to another and complaints straight to a person. Routing also cuts cost by sending easy requests to smaller, faster models.

3. Parallelization

Run several LLM calls at the same time and combine them. Either split a task into independent parts (sectioning), or ask the same question several ways and compare answers (voting). Useful for reviewing long documents or checking content against several policies at once.

4. Orchestrator-workers

A central orchestrator breaks a goal into subtasks it can’t predict in advance, hands them to worker agents, and combines their results. This is the backbone of research assistants and report generators.

5. Evaluator-optimizer

One model produces an answer; another reviews it against clear criteria and sends it back with feedback until it passes. It works well when quality is easy to judge but hard to get right first time, such as translations, proposals or code.

Figure 2. Orchestrator-workers combined with an evaluator-optimizer loop. Workers run in parallel; the evaluator sends work back to the orchestrator until it meets the quality bar.
  1. RequestA goal with constraints, for example “prepare a renewal proposal for this account”.
  2. OrchestratorPlans the subtasks dynamically and assigns each to the right worker.
  3. WorkersSpecialised agents with their own tools, running in parallel to save time.
  4. SynthesizerCombines worker outputs into one coherent result.
  5. EvaluatorScores the result against clear criteria and returns specific feedback when it falls short.
  6. Approved outputPasses to a person for sign-off before anything is sent or changed.

6. Autonomous tool-using agent

The full agent loop: the model decides which tools to use and when it’s finished. Best for open-ended tasks where the number of steps varies, such as resolving a support case that might need two lookups or ten. Needs firm limits on steps, spend and permissions.

7. Multi-agent systems

Several specialised agents work together, usually under a supervisor that delegates and resolves conflicts, or in a hierarchy of teams. Powerful for complex processes, but every extra agent adds latency, cost and new ways to fail. We only reach for multi-agent designs when a single agent with good tools clearly isn’t enough. Our guide to types of AI agents covers the main multi-agent topologies in detail.

PatternUse it whenWatch out for
Prompt chainingThe steps are known and always the sameErrors early in the chain carry through
RoutingRequests fall into distinct categoriesMisclassified requests; add a fallback route
ParallelizationParts of the task are independentMerging conflicting results
Orchestrator-workersSubtasks depend on the requestCost and latency of many calls
Evaluator-optimizerQuality is easy to judge but hard to hit first timeEndless loops; cap the number of revisions
Autonomous agentThe number and order of steps is unpredictableNeeds strict step, spend and permission limits
Multi-agent systemDistinct expertise must work togetherCoordination overhead and harder debugging

A reference architecture for enterprise agents

Patterns describe how an agent thinks. A platform architecture describes everything it needs to run safely in a business. This is the layered model we start from.

Figure 3. A six-layer reference architecture for enterprise AI agents. Guardrails and observability sit beneath every layer, so each action can be checked, traced and measured.
  1. InterfacesWhere work arrives: chat, voice, email, Slack, APIs and scheduled triggers.
  2. OrchestrationRuns the patterns above, keeps state between steps, applies budgets and retries failed calls.
  3. Tools and integrationsMCP servers and APIs for your business systems, RAG search and sandboxed code execution.
  4. Memory and knowledgeSession state, long-term memory and vector stores for retrieved knowledge.
  5. ModelsA mix of frontier and open-source models, with routing to balance quality, speed and cost.
  6. Guardrails and observabilityApproval rules, policy checks, tracing, evaluation and cost tracking across every layer.

Tools, memory and the Model Context Protocol

An agent is only as useful as its tools. Good tools have clear names, tight input schemas and helpful error messages, because the model reads all of them. We treat tool design like API design for a new colleague: if a person would find it confusing, so will the model.

The Model Context Protocol (MCP) has become a common way to expose tools and data to agents through a standard interface, so the same CRM or database connector can serve many agents and models. For agents that need to talk to other agents across systems, protocols such as Agent2Agent (A2A) are emerging for the same reason.

Memory usually comes in three layers: working memory for the current task, long-term memory for facts about users and past decisions, and knowledge retrieved from documents through RAG. If you’re designing the knowledge layer, our article on RAG architecture goes deeper.

Guardrails and human-in-the-loop

The question we hear most from clients isn’t “can an agent do this?” It’s “what happens when it gets it wrong?” Good agent architecture answers that up front.

  • Action tiers. Reading data is automatic, drafting needs no approval, but sending, paying, deleting or changing records requires a person or a strict rule.
  • Limits. Maximum steps, maximum spend and timeouts per task, so a confused agent can’t loop forever.
  • Least privilege. Each tool gets only the permissions it needs, ideally scoped to the current user.
  • Input and output checks. Filters for prompt injection, PII and policy violations on the way in and out.
  • Full traces. Every reasoning step, tool call and result is logged, so any decision can be reviewed and reversed.
Watch out for prompt injection. Any text an agent reads, such as an email, web page or document, can contain instructions. Treat tool outputs as untrusted data, never as commands, and keep sensitive actions behind approvals.

How to evaluate AI agents

Agents need different metrics from chatbots, because the path matters as much as the answer.

  • Task success rate on a realistic test set of requests.
  • Tool-call accuracy: right tool, right arguments, no unnecessary calls.
  • Steps, latency and cost per completed task.
  • Escalation rate: how often it hands over to a person, and whether those hand-offs were justified.
  • Safety incidents: blocked actions, policy violations and near misses.

Replay the test set whenever you change prompts, tools or models. Agent behaviour can shift in surprising ways after what looks like a small change.

How to choose the right pattern

A simple decision path works for most projects. If the steps are always the same, use prompt chaining. If requests fall into clear categories, add routing. If parts can run independently, parallelize. If the subtasks depend on the request, use orchestrator-workers. If quality needs iteration, add an evaluator. Only when the path is truly unpredictable should you hand control to an autonomous agent, and only when one agent can’t cope should you add more.

If you’d like help choosing, we build custom AI agents for support, sales, operations and document processing, usually starting with a two-week proof of concept. You can see a real example in our ThreadTrace compliance agent case study.

Frequently asked questions

What is agentic AI architecture?

Agentic AI architecture is the design of systems where an AI model plans and takes actions toward a goal, using tools, memory and feedback, rather than producing a single response. It covers the agent loop, orchestration patterns, tool integrations, memory and guardrails.

What is the difference between an AI agent and an AI workflow?

A workflow follows steps defined in code, even if each step uses an LLM. An agent decides its own steps and tool calls at run time. Workflows are more predictable; agents are more flexible for open-ended tasks.

When should I use a multi-agent system?

Use multiple agents when a task genuinely needs distinct expertise or parallel work that a single agent with good tools can’t handle. Start with one agent and add more only when you can measure the benefit, because each agent adds cost, latency and complexity.

What is the Model Context Protocol (MCP)?

MCP is an open standard for connecting AI models and agents to tools and data sources through a common interface, so one connector can serve many agents and models.

How do you keep AI agents safe?

Combine least-privilege tool permissions, approval steps for sensitive actions, limits on steps and spend, input and output checks for prompt injection and sensitive data, and full logging of every action.

NPMCODE Engineering TeamWe design, build and run AI agents, RAG systems and machine-learning models for SMBs and enterprises. About us

Keep reading

All articles

Ready to put an agent to work?

Tell us which process eats the most time. We’ll design the right pattern and build a working proof of concept in two weeks.