AI agent architecture is the way a language model is connected to instructions, a knowledge source, tools, memory and a set of controls so that it can finish a task on its own. The model reads the situation and picks the next step; the architecture around it decides what the model can see, which actions it may take, what it remembers and when a person has to approve.
Two agents built on the same model can behave very differently because of that surrounding design. This guide breaks an agent into its layers, follows one customer message through them, compares the common single-agent and multi-agent patterns, and lists the runtime details that separate a demo from an agent a business can leave running.
The layers of an AI agent
Most production agents, whatever framework they use, can be described in seven layers. A weak layer shows up as a specific kind of failure, which makes this a useful checklist when an agent misbehaves.
| Layer | Its job | Typical failure when it is weak |
|---|---|---|
| Channel | Receives messages from WhatsApp, email, web chat or another surface and sends replies back | Lost messages, duplicate replies, rules of the channel broken |
| Model | Reads the context and decides what to do or say next | Slow or costly replies, poor judgment on hard cases |
| Instructions | States the role, tone, scope and limits in plain language | Answers in the wrong voice, wanders off topic |
| Knowledge | Holds the facts the agent should answer from and lets it search them | Confident answers that are out of date or invented |
| Tools | Lets the agent act in other systems: book, look up, update, create | An agent that can describe a task but not finish it |
| Memory | Keeps the conversation, notes on each customer and lessons from staff | Customers repeat themselves, corrected mistakes come back |
| Control | Permissions, approvals, handover to people, logs and evaluation | Actions nobody authorised, no way to see what happened |
The first six layers are what most diagrams show. The seventh is the one that decides whether a business will let the agent near a paying customer, so it gets its own section further down. If you want the gentler introduction first, what AI agents are and how they work covers the basic loop.
One message, followed through the layers
Architecture is easier to see in motion. Take a customer of a physiotherapy practice who sends this on WhatsApp at 10pm: "Can I move my Thursday session to Friday morning?"
The channel layer receives the webhook from WhatsApp, checks that it is genuine and stores the message against the right conversation. If the customer sends three messages in a row, a well-built system waits a moment and treats them as one request.
The runtime starts a bounded run for this conversation and loads the context: the instructions for this inbox, the recent messages, and what memory holds about this customer, such as their name and existing booking.
The model reads all of that and decides it needs facts. It calls a tool to look up the customer's Thursday appointment and another to list open Friday morning slots.
The tool layer runs both calls against the booking system and returns the results. The model now sees that 9am and 11am are free.
The model replies offering both times. The customer picks 9am, which starts a new run.
The model asks to call the reschedule tool. The control layer checks the action against the agent's permissions and the business's rules. Moving a booking is allowed without approval here, so it goes through.
The agent confirms the new time, writes a note to the customer's record, and the whole exchange, every tool call included, lands in the log.
Every step outside the model is ordinary software: webhooks, queries, permission checks, database writes. That is why architecture matters more than model choice for most business agents. The model is one decision point inside a system that is mostly plumbing and policy.
Single-agent and multi-agent patterns
The next design question is how many model-driven parts the system has and how they relate. Four arrangements cover nearly everything in use.
One agent with tools
A single agent holds the whole conversation and calls tools as it needs them. It is the simplest to reason about, test and govern, because there is one set of instructions and one log per conversation. Most customer service, booking and lead qualification agents work well this way, provided the tool list is tidy and each tool has a clear description.
Router plus specialists
A first step classifies the request and sends it to a specialist prompt or agent: billing questions one way, technical support another. This helps when request types need very different instructions or knowledge. The cost is a second point of failure: a misrouted message gets a confident answer from the wrong specialist.
Orchestrator and workers
A lead agent breaks a large task into parts, hands each to a worker with only the context that part needs, and assembles the results. Research tasks and long document jobs suit this. For a five-message customer chat it usually adds delay and cost without improving the answer.
Doer plus reviewer
One model produces an output and a second, often a larger model, checks it against rules before it is used. This is useful where an error is expensive, for example an automation that will message hundreds of customers or a document that sets a price. Keep the reviewer's job narrow and written down, or it will approve and reject inconsistently.
A practical rule: start with one agent and add structure only when a test shows a specific failure that the extra part fixes. Each added agent multiplies the places a request can go wrong and the logs you have to read to find out why. Anthropic's engineering team makes a similar argument in its guide to building effective agents, which recommends the simplest design that works. Types of AI agents covers the older academic classification if you meet those terms in a vendor's material.
Where knowledge lives
The knowledge layer is usually retrieval: your documents are split into passages, indexed, and the passages that match a question are added to the model's context before it answers. That keeps the answer tied to your own source and lets you update a fact by editing a file instead of retraining anything. How retrieval makes chatbots accurate explains the mechanism in more depth.
Three design choices matter more than the search algorithm:
Keep instructions and knowledge apart. Rules about behaviour belong in the instructions; facts about prices and policies belong in the knowledge. Mixing them makes both harder to audit.
Version the knowledge. When an answer goes wrong, you need to know which version of which file the agent read at that moment.
Name an owner for each source. A price list nobody owns will be wrong within a quarter, and the agent cannot tell.
Memory: short term and long term
A language model keeps nothing between calls. Everything an agent "remembers" is something the architecture saved and loads again. There are three useful kinds.
Conversation memory: the recent messages in this thread, trimmed or summarised once the thread gets long.
Customer memory: durable notes on one person, such as their preferred branch or the product they bought, written by the agent or staff and read at the start of each conversation.
Team memory: lessons from staff corrections, stored as rules the agent follows next time.
Decide early when a conversation ends. If the context of a closed case carries into a new request weeks later, the agent may answer the new question with the old problem in mind.
Tools and the control layer
Tools are what let an agent finish a task, and they are where most of the risk sits. A tool is a named action with typed inputs, such as reschedule_booking(booking_id, new_time), and a description the model reads to decide when to use it. The Model Context Protocol (MCP) is now a common standard for exposing a system's actions as tools in this way.
The control layer wraps every tool call. A sound one does five things:
Gives the agent only the tools its job needs.
Checks each call against the role the agent is acting under, every time, on every path. A tool that is safe in a staff-facing chat may not be safe when a customer message triggers it.
Grades actions by impact. Reading a booking is low risk; issuing a refund or messaging many customers at once should wait for a person.
Hands the conversation to a person with the context attached when the agent is unsure or the topic is sensitive.
Logs the input, the decision, the tool call and the result so anyone can reconstruct what happened.
The guardrails that sit in this layer get a full treatment in AI guardrails for agents.
Runtime details that decide reliability
Diagrams rarely show the runtime, yet this is where demos fall over in production. Check these before you call an agent ready.
One run per conversation at a time, so the agent never answers the same thread twice in parallel.
Debouncing, so a burst of short messages produces one reply.
Durable steps, so a crash mid-run resumes from the last saved point instead of repeating a tool call such as a payment link.
A back-off when staff are replying, so the agent does not talk over a person.
A fallback model, so an outage at one provider does not stop replies.
Cost and usage recorded per run, with limits that stop a loop from running up a bill.
Evaluation on your own scenarios, graded by what changed in your systems, rerun whenever the instructions, knowledge or model change.
Build it or run it on a platform
The core loop is short to write. The layers around it are where the time goes. This comparison helps decide where your effort is best spent.
| Question | Build your own | Run on a platform |
|---|---|---|
| Who maintains channels and their rules | Your developers | The platform |
| Who designs permissions, approvals and logs | Your developers | The platform, configured by you |
| How much control over the model and prompts | Complete | Within the platform's settings |
| Who handles failover and model changes | Your team | The platform |
| Best fit | Unusual workflows, a team with engineers to spare | Customer messaging, booking, lead handling, follow-up |
How to build AI agents for a business walks through both routes step by step.
What the architecture looks like at a real business
Cake Inspiration, a custom cake studio, uses Volty on WhatsApp to qualify every lead (name, number, birthday, group size, theme) before a designer takes over. According to the Cake Inspiration case study, Volty resolved 91% of conversations without a human, handling 800+ customer messages in one week with the rest handed off to a designer, and the median reply fell to 5 seconds from 9 hours. Each layer is visible in that setup: the knowledge layer is the shop's own website, catalog and FAQ; the control layer hands real orders to a designer; and the memory layer turns staff corrections into lessons the owner approves, with Volty self-learning about 7 staff-taught policies each week. Founder Kai Yang described the last part like this: "I can fix the agent myself now, without waiting on an engineer. I just tell it what I didn't like about a reply, and it learns. Sometimes it will automatically suggest improvements and it will ask me to approve it. I think that's pretty cool."

How Volty is put together
Volty is an AI helpdesk that runs one agent per business across WhatsApp, Instagram, Messenger, web chat and email, with every conversation in one shared inbox. Mapped to the layers above:
Instructions are placed where they apply: organisation-wide, per team and per inbox.
Knowledge sits in a versioned drive that staff and the agent share, so every change has a history.
Every action is a declared operation with a role and a risk class, checked on every call. Anything that spends money, sends to many people at once or cannot be reverted waits for an owner or admin.
Each inbox chooses whether Volty replies on its own, writes drafts for the team to send, or stays out.
Runs are scoped to one conversation at a time, bursts of messages are debounced, and a staff reply makes the agent step back.
Each task runs on a model chosen and tested for it, with backups from a second AI company.
The full design, including data isolation and model routing, is in Volty's platform architecture paper. To see the agent layer working on your own channels, start with Volty's WhatsApp AI agent.
Frequently asked questions
What is AI agent architecture?
AI agent architecture is the design that connects a language model to everything it needs to complete a task: instructions, a knowledge source, tools that act in other systems, memory, and controls such as permissions, approvals and logs. The model decides each step, and the rest of the architecture decides what it can see and do.
What are the main components of an AI agent?
The main components are a language model that reads and decides, instructions that set its role and limits, a knowledge layer it searches for facts, tools that let it take actions, memory of the conversation and the customer, and a control layer of permissions, approvals, handover and logging. A channel layer connects it to where customers write, such as WhatsApp or email.
Is a multi-agent architecture better than a single agent?
A multi-agent architecture is better only when a task splits into parts that need very different context or skills. For most customer-facing work, one agent with a good set of tools is easier to test, cheaper to run and simpler to govern. Add a second agent, such as a reviewer, when you can measure the gain.
How does an AI agent remember things between conversations?
An AI agent remembers by writing facts to storage outside the model, such as notes on a customer record or a knowledge file, and reading them back at the start of the next conversation. The model itself keeps nothing between calls, so memory is a design choice about what to save, where, and who can see it.
How do you stop an AI agent from taking the wrong action?
You stop an AI agent from taking the wrong action by giving it only the tools its job needs, checking each action against the caller's role, and making costly or irreversible actions wait for a person's approval. Logging every action and starting the agent in draft mode lets you catch mistakes before customers see them.

















