Part of
AI proof of concept
Architecture

Enterprise AI Architecture: How Agents Connect to Your ERP, CRM, and Core Data

Requests from Teams and Slack pass through an orange integration layer that acts as the user, applies rules and approvals and logs every step, before reaching SAP, Odoo and Salesforce.

An AI agent that can read your CRM and write to your ERP is useful on day one and dangerous on day two. Give it a super-user account and one misread request can post a duplicate purchase order, overwrite a customer's credit limit or email a price list to the wrong account. Limit it to read-only access and it never does enough work to pay for itself. Enterprise AI architecture is how you decide where each agent sits between those two outcomes.

The AI model is the smallest part of that decision. Most of the work sits between the agent and your systems of record, such as your ERP and CRM. That layer sets whose account the agent acts as, which fields it can change, which decisions a fixed rule makes for it, when a person signs off, and what gets written to the log.

The five layers of an enterprise AI agent architecture

The agents we run in production connect to your business systems through five layers. The tools differ from one company to the next, but the five layers stay the same. Our guide to enterprise AI agents in production follows a single run through them, from read-only lookups to the run log.

  1. Channels. Where work arrives: a Teams or Slack message, a shared inbox, a change on a CRM record, an ERP alert or a schedule.
  2. Agent. An AI language model with written instructions. It pulls the facts out of the request, picks a tool and writes the reply. It holds no database credentials and makes no final decision on money, access or customer data.
  3. Integration layer. The workflows and tools that make every system call for the agent. This layer signs in as the person who made the request, matches fields between systems, queues and retries calls, and runs the business rules and approvals.
  4. Systems of record. Your ERP, CRM and data warehouse. The agent reads from a copy in a cache or warehouse first, and every write goes back to the system that owns the record.
  5. Audit log. One row for every step: prompt, model version, records read, tool called, rule applied, approver and result.
Enterprise AI architecture
Enterprise AI agent reference architecture
Five layers
Select a layer to see which audit log fields it writes.
5 · Audit log
PromptModel and versionRecords readTool callRule and versionApproverResult
Every layer writes to one log, so each run can be traced end to end.

The integration layer, highlighted above, carries most of the risk and most of the engineering work. Our enterprise context layer page shows how the same layer lets every agent read the same company data, with each person's access rules applied.

Why AI agents fail at the ERP and CRM boundary

ERP APIs were built for people typing at a desk

ERP and CRM APIs were designed for people entering records at human speed. An agent working through a backlog can send dozens of calls a minute and hit the system's rate limits. It can also time out halfway through a multi-step update and leave a sales order with no lines. The integration layer handles that load. It queues calls, retries failed ones with a longer wait each time, and treats a multi-step update as one unit. Either every step completes, or the whole update is rolled back and someone gets an alert.

Reads are the bigger load, and most of them should never reach the ERP at all. A Dutch Odoo implementation partner had spent a full year trying to build appointment scheduling inside Odoo for a dental care group with 200 practitioners. We moved the scheduling out of Odoo. Every night, five sync workflows copy practitioners, locations and treatment series into a planning cache in Supabase. An AI agent in n8n then places 1,500 appointments a week from that cache. Any appointment it cannot place goes on a report that says why. Odoo stays the system of record and never carries the planning load. The full case is on our AI proof of concept page.

The same customer has two names

Your CRM calls a customer an Account, and your ERP calls the same company a Debtor. Each system gives it a different ID, a different address format and sometimes a different legal name. An agent asked to "check whether Acme has unpaid invoices before we renew" has to match those two records. Left to guess, a model will pick a wrong match and sound sure of it. When the agent then writes a record, that wrong match becomes a wrong invoice, credit note or dunning letter.

The fix is a field mapping kept in the integration layer. One table links each CRM ID to its ERP ID, and one definition covers each shared field, such as customer, revenue or open balance. You do not need to rebuild either database first. Map only the fields your first workflow uses, and add more with each workflow after that. Our context layer blueprint shows how those definitions grow into a semantic layer, one agreed definition for each business term.

Read before you write: a staged permission model for AI agents

Give an agent more permissions in stages. It moves to the next stage only when a measured run shows it handles the current one.

  • Read. The agent answers questions and drafts summaries from a cache or warehouse. Nothing it does changes a record.
  • Draft. The agent prepares the record, such as a purchase order, a CRM update or a credit note, and a person approves it before it posts.
  • Write within limits. The agent posts records below a threshold the business owner sets, and everything above that threshold still goes to a person.

At every stage the agent acts as the person who asked. When a sales rep asks it to update an opportunity, the integration layer calls the CRM with that rep's permissions. The agent can never see or change a record the rep could not. Give an agent a shared service account with access to everything, and it becomes the most powerful user in your company without anyone deciding it should be.

Enterprise AI architecture
One ERP write, end to end
Worked example
Change the proposed quantity and watch the purchase order cross the €5,000 limit.
Example triggerERP alert: SKU 1182 has 40 units left, below its reorder point of 120.
500 units
1 · ReadGather the factsAI agent, read-only access
90-day demand1,350 units
SupplierNordic Parts
Proposed quantity500
Order value€6,250
2 · CheckApply the limitRules gate in the integration layer
PO-LIMIT · v2 · owner: ProcurementOrders up to €5,000 post automatically. Above €5,000 the procurement lead approves.
Needs approval€6,250 > €5,000
3 · WritePost with sign-offIntegration layer, as the purchasing user
Draft PO created in the ERPStatus: awaiting approvalApproval card sent in TeamsWith demand data and supplierPO released on approvalRejected drafts are closed and logged
PO posted in the ERPWithin the limit, so no approval stepRun written to the audit logRule, quantity and value recorded
Audit logSKU 1182 reorderRule PO-LIMIT v2Decision: approval requestedApprover: procurement lead

In the example above, the agent did the slow part by pulling the demand history and choosing a quantity. The procurement lead then approved the spend with one click. Below the limit, the same order would have posted on its own, with the same row in the log.

Keep the decision out of the model

A language model predicts text, so it approximates a rule instead of applying it exactly. Put every decision that has one correct answer in code or in the database, where it gives the same answer every time. A discount ceiling, an approval threshold, a stock calculation and an access check all belong there. The model reads the request and explains the result.

IES Limited runs four travel insurance brands from a 25-page daily management information (MI) pack. In the system we built for them, the database calculates every figure as a PostgreSQL view. n8n decides who needs to know, and the language model gets the finished numbers and writes the sentences around them. A drop in the quote funnel that once took 20 working days to notice now reaches the right Teams channel within 30 minutes of the pack arriving. The alert thresholds live in the database, so IES changed them 34 times in six weeks without a single developer ticket. The IES Daily MI case study walks through the build. Our guide to mapping business rules into the context layer shows how to store rules as versioned records an agent can query.

AI agent security: insiders, injected prompts and least privilege

An agent with access to your ERP is a new privileged account, and it can be abused in every way a privileged account can. CISA's Insider Threat Mitigation Guide (September 2026) names the risks specific to AI. Insiders who can reach internal data stores can poison training data. They can alter a deployed model's parameters "to favor fraudulent transactions or misclassify sensitive documents". They can also expose sensitive data by entering it into an AI system that is not approved to hold it.

The architecture answers each of these with controls you can test:

  • Each agent gets its own credentials, kept in a secrets vault. You can revoke them in one step and cut off one suspicious agent without stopping every workflow.
  • Instructions, rules and model versions are kept under version control and changed only after review. Nobody edits a live system prompt by hand.
  • Text that arrives from outside, such as an email body or a supplier PDF, is treated as data. It can inform a draft, and it cannot trigger a write on its own.
  • Staff use approved AI tools that run inside your own environment, so nobody needs to paste customer data into a public chatbot.

Our enterprise AI governance page covers the policies behind these controls. The n8n consultant page covers how we review and secure workflows that are already running.

What to log for every agent action

When an agent does something wrong, your team needs to work out why. The cause might be a prompt injection (instructions hidden in text the agent reads), a wrong record, an out-of-date rule or a model that misread the request. CISA's Logging Reference Architecture (August 2026) sets the bar for AI systems: organisations "should log user prompts, system prompts, model outputs, and other parameters used when interacting with an AI model, as well as the decisions and actions taken by AI agents and any interactions with external functions or components." It also asks you to record each model's version and origin, plus the accounts that agents and other software use. Record those accounts before the short-lived servers they ran on are shut down.

In practice that is one log row per step with these fields:

  • Timestamp, the requesting user and the agent's own identity
  • System prompt version, model name and model version
  • IDs of every record read and every record written
  • Tool or workflow called, with inputs and outputs
  • Rule ID and version applied, with the verdict
  • Approver and approval time, where a person signed off

Send those rows to the security monitoring system (SIEM) your security team already uses. Keep them in storage that nobody can edit after the fact. A log that only says "agent queried ERP" cannot tell you whether a specific customer record was touched at a specific time. Keeping that logging and alerting running after launch is part of our AI managed services.

Where MCP and n8n fit in the integration layer

The Model Context Protocol (MCP), which Anthropic released as an open standard in November 2024, gives agents one standard way to find and use tools. You describe a tool once, for example "look up open invoices for a customer", and any agent that supports MCP can call it. Every agent can then reuse the same tool, and each tool's permissions and logging sit in one place.

MCP is only the connection standard, and something still has to do the work behind it. We use n8n for that work. It signs in to SAP, Odoo, Salesforce or HubSpot, converts fields, queues calls, retries failed ones and posts approval cards. Self-hosted n8n runs inside your own cloud, so customer records never pass through an outside automation platform. Ovidius is an n8n Select Partner, and n8n for enterprise covers deployment, scaling and which plan to choose. If you are still choosing a platform, our AI agent platform comparison sets eight of them side by side.

Start with one workflow and grow the foundation from it

The usual architecture-first plan says to bring every data source together, standardise every schema and only then build the first use case. Run that way, a project can spend a year or more before anyone sees an agent do useful work.

The faster path builds the five layers for one workflow, then extends them with each workflow after it:

  1. Pick the workflow. Choose one with a measurable cost today, such as order triage, invoice matching, field-service scheduling or procurement approvals.
  2. Measure the baseline. Record hours per week, error rate and time to completion before anything is built.
  3. Build the layers it needs. Map only the fields it touches, start with read access, and put its rules and approvals in the integration layer.
  4. Run it in draft mode. Let people approve every write until the numbers show where a limit is safe.
  5. Reuse the foundation. The next workflow reuses the same sign-in setup, log format and field mappings, so it ships faster than the first.

Our AI Audit ranks the workflows you could automate by return and by how hard each is to build, and ends in a 90-day roadmap. The AI agent cost estimator shows what an agent will cost to run before you build one.

Frequently asked questions

What is enterprise AI architecture?

Enterprise AI architecture is the design that connects AI models and agents to a company's systems, data and people. It covers where requests come from, whose account the agent acts as and how it reads and writes records. It also covers which decisions fixed rules make, when a person approves and what gets logged.

How do AI agents connect to an ERP like SAP or Odoo?

They connect through an integration layer, never with direct database access. Workflows in a tool such as n8n call the ERP's API as the person who asked. They match fields between systems, queue and retry calls, and run approval rules. Most reads go to a synced copy in a cache or warehouse, so the ERP is not overloaded.

Should an AI agent have write access to our CRM?

Yes, within limits. Start with read access, then move to drafts that a person approves. Allow direct writes only below limits the record owner sets, and log every write with the rule and the user behind it.

Do we need to clean all our data before deploying AI agents?

No. You need clean definitions and ID mappings for the fields the first workflow uses. Each new workflow extends the mapping, which is how the data foundation improves without a separate multi-year project.

What should we log when an AI agent acts in production?

For every step, log the prompt, system prompt version, model version, records read and written, tools called, rule and rule version applied, approver and result. Send the log to your SIEM. CISA's Logging Reference Architecture (August 2026) says organisations should log prompts, model outputs and agent actions for AI systems.

Map the first workflow your agents should run

In a 30-minute discovery call you speak directly with an engineer about the workflow, the systems it touches and the approvals it needs. If an audit is the right first step, we will tell you and scope it on the call. How we work shows what happens after that.

Book a Discovery Call

Sources

  1. Cybersecurity and Infrastructure Security Agency (August 2026). Logging Reference Architecture (LRA).
  2. Cybersecurity and Infrastructure Security Agency (September 2026). Insider Threat Mitigation Guide.
  3. Anthropic (November 2024). Introducing the Model Context Protocol.

More on this topic

Put your first workflow on the board

Answer a few questions about your team and what you want automated, then a senior partner scopes it with you on the call.