"A five-layer reference architecture for agentic AI at a mid-sized company: where work arrives, the agent, the tool layer where permissions live, your ERP and CRM, and the control layer. With the five workflow patterns, when to go multi-agent, how MCP fits, and a worked example from emailed purchase order to draft sales order."
Key Takeaways
- 1An agentic AI architecture has five layers: where work arrives, the agent, the tool layer, your systems of record, and a control layer of approvals, logs, tests and monitoring.
- 2Permissions belong in the tool layer and in the target system, not in the prompt. Instructions can be talked around; a permission the ERP refuses cannot.
- 3Anthropic separates workflows (predefined code paths) from agents (the model directs its own steps) and recommends the simplest solution that works. Most business agents are mostly workflow with one agentic step.
- 4Start with one agent and a few narrow tools. Split into several agents only when a step needs its own instructions and tests.
- 5MCP is an open standard for connecting AI applications to external systems. One MCP server in front of your ERP can expose only approved actions to any MCP-capable agent.
- 6Make every action safe to retry with an idempotency key, or the same order will land in your ERP twice.
- 7Gartner warns that integrating agents into legacy systems can be technically complex. Budget the effort for integration, not the model.
The short answer
An agentic AI architecture for a mid-sized company has five layers: where work arrives, the agent (model, instructions and the loop that picks the next step), a tool layer that exposes only approved actions, your unchanged ERP and CRM, and a control layer of approvals, logs, tests and monitoring. Most first agents need one agent and a few narrow tools, not a multi-agent system.
We design, build and support custom AI agents, so weigh this page with that in mind. The diagram is ours, drawn from the way we structure builds on ERPs and CRMs. Outside facts come from Anthropic, the Model Context Protocol documentation, OWASP and Gartner, opened on 17 October 2026 and linked where they appear. Search figures are our own DataForSEO measurement for the US on the same day.
About 720 people a month search Google in the US for "agentic ai architecture", and another 260 for a diagram of one (DataForSEO, 17 October 2026). Most of what they find is drawn for a software company building an AI product: vector stores, model routers and agent swarms. A mid-sized manufacturer, distributor or services firm has a different problem. It already runs an ERP, a CRM and a shared inbox, and it wants an agent to do work across them without breaking anything.
This guide draws that architecture. It covers the five layers, the choice between a workflow and an agent, when a second agent is worth it, how MCP fits, a worked example, and the mistakes we see most. If you are setting the rules for your first agent, read it alongside our AI agent governance policy guide.
The reference architecture: five layers
- Where work arrives. A shared inbox, a customer portal, an EDI or file drop, a Teams or Slack message, or a schedule. Pick one trigger for the first agent.
- The agent. An orchestrator that reads the request and decides the steps, a model (LLM) that does the reasoning, instructions that define the job and its limits, and context such as policies and past cases. Specialist steps, such as reading a messy PDF, can sit beside it.
- The tool layer.MCP servers, API connectors and document tools. Each exposes only the actions the job needs, signs in with the agent's own service account, and is where permissions are enforced.
- Systems of record. Your ERP (NetSuite, Odoo, SAP Business One and others), CRM (Salesforce, HubSpot), help desk and file stores. They stay as they are and keep their own permission checks.
- The control layer. An approval queue, logs of every tool call, a test set of your own past cases, monitoring and alerts, a secrets manager, and an off switch with a named owner.
Workflow or agent: decide how much the model chooses
Anthropic's engineering guide Building effective agents (19 December 2024) gives the cleanest split we know. Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents are systems where LLMs dynamically direct their own processes and tool usage. The same guide recommends finding the simplest solution possible and adding multi-step agentic systems only when simpler ones fall short.
For business work that advice is right. The order of steps in most back-office jobs is known: read the document, match it to a record, check the rules, prepare the action, get approval. The judgement sits inside one or two of those steps. So the reliable design is a workflow you can test, with the model making decisions inside it, rather than a free agent deciding the whole route each time.
The five patterns, with a mid-sized company example for each
Most agentic AI architectures in business combine two or three of these, with agentic AI orchestration deciding which step runs next.
| Pattern (Anthropic's name) | What it does | Example in a mid-sized company |
|---|---|---|
| Prompt chaining | Fixed steps in sequence, each using the last one's output | Read a supplier invoice, extract lines, match to the PO, draft the bill |
| Routing | Sort the input, then send it to the right handler | Shared inbox: new order, order change, invoice query or complaint |
| Parallelization | Run several checks side by side and combine them | Check credit limit, stock and pricing on a quote at the same time |
| Orchestrator-workers | One model splits a job and assigns the parts | An RFQ with 40 lines split by product family for pricing |
| Evaluator-optimizer | One model drafts, another critiques against rules | A customer reply checked against your returns policy before it goes to a person |

One agent or several: when a multi-agent system architecture is worth it
| Signal | One agent | Split into several |
|---|---|---|
| Number of distinct jobs | One job with a few steps | Several jobs owned by different teams |
| Instructions | Fit on a page and test well together | One step needs long, specialist instructions of its own |
| Testing | One test set covers it | Each part needs its own test set and pass mark |
| Tools | A handful, all for the same job | Different parts need different systems and permissions |
| Failure handling | One place to stop and hand to a person | Parts can fail independently without stopping the rest |
Every hand-off between agents is another place for context to be lost and another thing to test. Start with one. Our guide to multi-agent workflows with LangGraph and n8n on ERP systems covers the larger designs when you reach them.
AI agent orchestration: code, workflow tool or platform
US searches for "ai agent orchestration" run about 590 a month, and "what is ai agent orchestration" rose about 1,500% in a year (DataForSEO, 17 October 2026). Orchestration is the logic that decides what happens next: which tool, in what order, what to do with the result, when to retry and when to stop. You have three ways to build it, and most AI agent orchestration frameworks, platforms and tools fall into one of them.
| Option | Good for | Watch for |
|---|---|---|
| Code (for example LangGraph or plain code on the model APIs) | Full control, proper tests, complex rules across systems | Needs engineers to change it |
| Workflow tool (for example n8n) | Simple, visual flows staff can read | Gets hard to test as rules grow |
| Vendor platform (Salesforce Agentforce, Microsoft Copilot Studio) | Jobs that stay inside that vendor's product and data | Reaching systems the platform does not connect to |
Many companies end up with a mix: the platform agent for work inside Salesforce or Microsoft 365, plus a custom tool it can call for the system it cannot reach. We compare the code options in n8n vs LangChain vs CrewAI for enterprise, and the rent or build choice in our AI agent build versus buy guide.
The tool layer: APIs, MCP servers and where permissions live
The Model Context Protocol (MCP) documentation describes MCP as an open-source standard for connecting AI applications to external systems, and compares it to a USB-C port for AI applications. In architecture terms it is a standard shape for the tool layer. You build one MCP server in front of a system, decide exactly which actions it offers, and any MCP-capable client (the docs name Claude and ChatGPT among them) can use those actions and nothing else.
Three rules for the tool layer, taken from OWASP's guidance on Excessive Agency:
- Narrow tools. "Create draft sales order" rather than "run any query".
- Own credentials. A service account per agent, read-only unless a write action is listed.
- Check twice. The tool checks the request, and the target system refuses anything the account is not allowed to do.
We build custom MCP servers and API integrations for this layer; our custom MCP server guide lists the tools an ERP server should expose. See AI integration services for the systems we connect.
Want this diagram drawn for your systems?
Bring the job you want an agent to do and the systems it touches. In a 30-minute call with founder Bhavesh Barot we will sketch the five layers for your stack and point out where the integration effort sits. FactoryJet quotes a fixed price in writing after that call, and we can show working software on your own data before a contract.
Talk to the FounderWorked example: an emailed purchase order becomes a draft sales order
Here is one request traced through the five layers. We have built purchase and sales order generation on several ERPs, including Odoo, NetSuite, SAP Business One and ERPNext, and this is the shape it takes.
- Trigger. A customer emails a PDF purchase order to the orders inbox. The agent picks it up.
- Route. The model decides: new order, change to an existing order, or something else. Anything else goes to the orders team untouched.
- Read. A document step extracts the customer, PO number, ship-to, lines, quantities and requested dates.
- Match. Tools look up the customer and each item in the ERP. Customer part numbers are mapped to your item codes using the cross-reference table.
- Check.In parallel: price against the customer's price list, stock against the requested date, and credit status. Any mismatch is flagged, not fixed silently.
- Guard against duplicates. The tool builds an idempotency key from the customer and PO number and refuses to create a second order with the same key.
- Prepare. The tool creates a draft sales order in the ERP, with the source PDF attached and every flag noted on it.
- Approve. The draft lands in the approval queue. A person checks the flags and confirms. Only then does the order release.
- Record.Every tool call, the model's decision at each step and the approval are logged against the PO number.
Notice where the model is used: routing, reading and spotting mismatches. The order of steps, the duplicate check and the ERP write are plain code. That is what makes it testable. Our post on RFQ-to-ERP agent architecture in manufacturing goes deeper on the quoting side.
The control layer: what keeps the agent trusted
| Control | What it does | Without it |
|---|---|---|
| Approval queue | Holds actions over a limit for a named person | Every action reaches your systems unchecked |
| Logs and audit trail | Records every tool call, input, result and approval | Nobody can say why an order changed |
| Test set | Your own past cases, re-run before every change | A model update quietly changes behavior |
| Monitoring and alerts | Watches handoffs, approver edits, failures and blocked actions | Problems surface as customer complaints |
| Secrets manager | Keeps keys out of prompts and code | Keys leak into logs and repositories |
| Off switch | Lets a named owner stop the agent at once | A bad day becomes a bad week |
The policy side of these controls, including who owns each one, is in our AI agent governance guide, which comes with a free policy template. How we run them after launch is on our AI agent monitoring and support page.
Six architecture mistakes we see in mid-sized companies
- Admin credentials. The agent connects with an admin login because it was quickest. Give it its own narrow account.
- One giant prompt. Five jobs in one set of instructions, so nobody can test any of them. Split the job into steps.
- No test set. The agent is judged on a demo, then surprises everyone on real data. Test on your own past cases.
- Screen clicking where an API exists. Automation that clicks through the ERP screen breaks on every update. Use the API or an export.
- Multi-agent first. Several agents built before one has worked. Start with one.
- No retry safety. A timeout triggers a retry and the order is created twice. Add idempotency keys to every write.
Gartner's June 2025 forecast that over 40% of agentic AI projects will be canceled by the end of 2027 notes that integrating agents into legacy systems can be technically complex, often disrupting workflows and requiring costly modifications. All six mistakes above are integration mistakes. None is about the model.
Build on a platform or build custom
| If your work... | Start with | Add custom work when |
|---|---|---|
| Lives in Salesforce | Salesforce Agentforce | The job needs your ERP, EDI or a system Salesforce does not reach |
| Lives in Microsoft 365 | Microsoft Copilot Studio | Actions must run in systems outside Microsoft with your own approval rules |
| Crosses ERP, CRM, inbox and files | A custom agent with MCP servers or API tools | From the start |
| Is mostly one simple flow | A workflow tool such as n8n | Rules grow beyond what the flow can test |
We do Salesforce and Agentforce work as well as custom builds, so we are comfortable recommending either. Our comparison of Intercom Fin, Zendesk AI, Agentforce and a custom agent covers the support-desk version of this choice, and Agentforce pricing vs a custom AI agent covers the Salesforce one.
What else ranks for "agentic ai architecture", and how this guide differs
These are the business sites on Google's first page for "agentic ai architecture" in the US when we checked on 17 October 2026 (DataForSEO), with the title Google showed for each. We list them so you can compare; we have not reviewed their services, and the list leaves out forums and video sites.
| Site | Page title shown in Google |
|---|---|
| vectorize.io | Designing Agentic AI Systems, Part 1: Agent Architectures |
| tredence.com | Building Agentic AI Architectures: Blueprint for Autonomous ... |
| salesforce.com | What Is Agentic Architecture? |
| onereach.ai | Agentic AI Architecture: Building Business-Ready Systems ... |
| srajdev.com | Understanding Agentic AI Architecture - Swapan Rajdev |
| galileo.ai | AI Agent Architecture From Patterns to Governance |
Several of these describe architectures for building AI products. This guide draws the architecture for a company that already runs an ERP and a CRM, traces one real request through it, and lists the integration mistakes that sink projects.
How FactoryJet builds agentic AI for mid-sized companies
We design, build, implement and support custom AI agents, and you own what we build: the code and repository from day one. AI and hosting accounts can run in your name, at cost. We start from your systems: which ones hold the data, which have usable APIs, and where the agent should stop and hand to a person. Then we show working software on your own data before you sign. FactoryJet quotes the build, and any support you choose, as fixed prices in writing after a short scoping call.
To see the work by system, start with AI agent development, AI agents for ERP systems, NetSuite AI agents, Odoo AI agents and sales order automation. If you are still deciding whether an agent is worth building, our guide to scoping an AI proof of concept that reaches production is the next read.
Sources
All pages opened and read on 17 October 2026.
- Anthropic, Building effective agents (19 December 2024)
- Model Context Protocol, What is the Model Context Protocol (MCP)?
- OWASP GenAI Security Project, LLM06:2025 Excessive Agency
- Gartner, Gartner Predicts Over 40% of Agentic AI Projects Will Be Canceled by End of 2027 (25 June 2025)
- Our own measurement: US monthly search volumes and year-on-year change, DataForSEO, 17 October 2026
Architecture call for mid-sized US companies
See your first agent drawn on your own systems, then working on your own data
Tell us the job and the systems behind it: ERP, CRM, inbox, portal. We will tell you which pieces are workflow, which need an agent, what the tool layer should expose and what a person should approve. FactoryJet quotes a fixed price in writing after a short scoping call.
Frequently Asked Questions
What is agentic AI architecture?
What are the main components of an AI agent?
What is the difference between an agentic workflow and an AI agent?
What does orchestration mean in AI agents?
What is the best AI agent orchestration framework?
Do I need a multi-agent system?
Is multi-agent the same as agentic AI?
What are agentic AI design patterns?
What is MCP and why does it matter for AI agents?
How do AI agents connect to an ERP like NetSuite, Odoo or SAP Business One?
Can AI replace an ERP?
Where should AI agent permissions be enforced?
Do I need a vector database or RAG for an AI agent?
What is agentic RAG?
Which LLM should a business agent use?
How do you stop an AI agent from creating duplicate records?
What does an agentic AI architecture diagram usually show?
Should I build AI agents on Salesforce Agentforce or Microsoft Copilot Studio?
What is the hardest part of agentic AI architecture?
How do you test an agentic AI system?
Where should a mid-sized company host its AI agents?
What skills does a team need to build and run agentic AI?
How do you build AI agent orchestration?
What are AI agent orchestration tools?
Bhavesh Barot
Founder & CEO
Founder & CEO of FactoryJet, an ecommerce and AI services company that has served 500+ businesses since 2014. Writes about ecommerce builds, AI agents, and AI search.




