
AI agent architecture is the set of parts that turn a request into a result. A model can suggest the next step. The app runs tools, keeps state and checks what the agent may do. A review step lets a person decide whether a draft can leave the preview.
The main parts of AI agent architecture
This guide uses the same fictional library task as our beginner project for building an agent. A notice says when a workshop starts and if guests must book. The workflow reads the notice, builds a draft answer and asks a person if it may save.
The diagram shows which parts suggest, check and carry out each step.

Offline reference workflow with a fixed model replay and human review.
- Orchestrator. Chooses when to read, check, ask for review or stop.
- Model stand-in. Supplies a fixed proposal in the test. A real model could make a different choice.
- Read and save tools. Read only the sample and save only to one approved path.
- Policy checks. Check both facts and require approval for the exact draft.
- State. Holds the run ID, attempt count and a short code made from the draft bytes.
- Human review. Shows a preview and target before accepting a yes or no.
- Trace log. Records what ran and why, with the time and run ID.
What four runs tell you about AI agent architecture
We ran the sample on November 17, 2026, Mexico City time. It used fictional data, a fixed model reply and scripted review choices. The trace shows what the app did. You can use it to see which part made each choice.
- Success. One read found the notice. A yes let the write tool save the same bytes that were shown for review.
- Rejection. The reviewer said no. The check blocked the write and no draft was saved.
- Timeout. The simulated reply came at the 60-second limit. The workflow stopped without a draft.
- Recovery. A new run named the old run in its log. It tried one failed read again, then saved only after a fresh yes.
Recovery did not open up the timed-out run or use its old review. Each new run needs its own record. That is why the writer checks the exact draft and the time of the decision before it can save. A real app would also need to check who the reviewer is.
Put checks at the point where an action can happen
The model should only propose a tool call. Check the user, allowed tool and target outside the model. Leave requests for new access or a changed draft for a person to review. The agent permissions matrix helps define what a tool may do. Use the agent security checklist to test what happens if it asks for more.
For a more complex workflow, LangGraph’s documentation describes how a graph can store state and route work through explicit steps. On a live system, keep records where the agent cannot edit them. Save the run and review IDs, but avoid keeping raw private prompts in general logs.
How state helps a new run recover
Keep the latest draft, its path and the latest decision in state. Keep the history of earlier steps in the trace. When the run hits its stop rule, mark that state as closed. A new run can show the old run ID to an operator without taking any of its permissions or treating the old review as a new yes.
When a tool fails, record where it failed and how often it has run. A second read is safe in this sample because it does not change a file. A write may already have worked even if the response was lost. Check the result or use a request ID that lets the tool spot repeat work before you try a write again.
A local model changes one part of the design
You can run Mistral on your own PC and still use tools that contact other systems. Draw the boundary for each tool as well as the model. Our Local AI guide explains the difference between local chat, local files and cloud tools.
Start with one tool, one task and a clear stop rule. Add tools when you can name the work they do, the state they need and the new checks they require. Keep that map up to date as you change the workflow.
Review the AI agent architecture each time you add a tool. A new tool can change which data leaves your app and which actions need a fresh review.
Read also
Popular news

Good Morning AI | Anthropic slips, Claude reviews code and Tidal sets a cutoff

AI stocks slide again as Nvidia falls and Ambarella sinks 20.6%

GTA 6 on PC at 10 FPS? Inside the AI-Assisted Race to Port It

Tencent opens the AI models behind WeChat’s product search

Google’s Humanity’s First Exam Tests AI Reliability


