How AI agents work: the six parts of a production agent
An AI agent is not a chatbot with a longer prompt. It is a system: a model for reasoning wrapped in perception, memory, tools, orchestration and monitoring. We build agents for clients and for our own products — this is the architecture behind them.
1. Perception & input
Everything the agent will act on enters here: chat messages, emails, documents, images, API events, database rows. The layer parses, validates and routes — extracts text from PDFs, classifies intent, attaches the user, the account and the permissions — so the model sees clean, structured context instead of raw noise. A thin, strict perception layer is the difference between an agent that handles edge cases and one that hallucinates on them.
2. Reasoning & planning
The LLM is the cognitive engine: it interprets the goal, breaks it into steps, decides which tool to call next and when the task is done. Good agents plan explicitly, re-plan when a step fails and keep a budget on loops and cost. Model choice and prompt design live here — and are evaluated on a test set, not by feel.
3. Memory & knowledge
Short-term memory keeps the current conversation and intermediate results; long-term memory stores facts, preferences and past outcomes. Retrieval (RAG) connects the agent to your documents, CRM and databases through a vector index and structured queries, so answers are grounded in your data and cite their source.
4. Tools & actions
Tools are how the agent changes the world: search, read and write records in CRM/ERP, send an email, create an invoice, run code, call another agent. Each tool has a typed contract, an access scope and an audit log. Anything irreversible — payments, deletions, outbound messages — goes through a confirmation or a human approval.
5. Orchestration & guardrails
The control loop runs the agent: sequences steps, handles retries and timeouts, enforces limits on cost, time and permitted actions, coordinates several specialised agents when one is not enough. Guardrails validate inputs and outputs, filter sensitive data and stop the loop when confidence is low. This is the layer that makes agents boring and reliable.
6. Reflection, evaluation & monitoring
Before it answers, the agent checks its own output against the goal and the rules; after it answers, every run is traced — prompts, tool calls, cost, latency, outcome. An evaluation set replays real cases on every change, and production metrics (task success, escalations, corrections) feed the next iteration. Human feedback closes the loop.
Build an agent with us
We build agents for clients and for our own products: retrieval assistants, document-processing agents, support and sales agents with human approval on irreversible actions. Start with a pilot on one process — you get a number, not a demo — or read the long-form guide and our case studies.