Writing · 18 Aug 2026
RAG, MCP and AI agents in enterprise applications
How retrieval-augmented generation, the Model Context Protocol and AI agents fit together in real enterprise systems — and where each one actually earns its keep.
Three layers, not three buzzwords
Most enterprise AI projects fail on architecture, not on model quality. It helps to separate the stack into three concerns: retrieval (what the model knows), tooling (what the model can do), and orchestration (how far it is allowed to go on its own). RAG, MCP and agents map cleanly onto those three layers.
RAG: grounding answers in your own data
Retrieval-augmented generation puts your documents, tickets, policies or product data in front of the model at query time instead of relying on what it memorised during training. In practice the hard work is not the vector database — it is chunking strategy, metadata and access control. Every retrieved chunk has to respect the same permissions as the source system, otherwise the assistant becomes a very efficient data-leak.
RAG is the right choice when the question is "what does our organisation say about X?" — knowledge bases, contract and policy search, support deflection, onboarding. Add citations to source documents from day one; without them, business users never trust the output.
MCP: a standard socket for tools and data
The Model Context Protocol standardises how a model connects to external tools, resources and data sources. Instead of writing a bespoke integration for every model or framework, you expose your CRM, ERP, ticketing system or internal API once as an MCP server and reuse it across clients.
For enterprises the real value is boring and important: a single place to define what a tool does, what it accepts, and who may call it. That means auditing, rate limiting and authorisation live in your own infrastructure — in a Laravel or Symfony service you already operate — rather than being scattered across prompt text.
Agents: orchestration with limits
An agent is a loop: the model plans, calls a tool, reads the result, and decides what to do next. That loop is powerful for multi-step work such as reconciling records, triaging incoming documents or preparing a quote across several systems. It is also where cost, latency and unpredictability come from.
The pattern that holds up in production is a narrow agent: a limited tool set, an explicit step budget, structured output that your application validates, and a human approval step in front of anything irreversible. Deterministic code should still handle anything deterministic — the model decides, your application enforces.
How they fit together
A realistic enterprise setup looks like this: the user asks a question; the agent decides whether it needs knowledge or action; retrieval brings back permission-filtered context; MCP tools read or write in the systems of record; every call is logged with the acting user's identity. RAG supplies the facts, MCP supplies the hands, the agent supplies the sequencing.
What to get right first
Start with one workflow that has a measurable cost today. Put evaluation in place before scaling — a fixed set of real questions with expected answers catches regressions that eyeballing never will. Keep identity and authorisation in your existing backend, treat prompts and tool definitions as versioned code, and log every model call so you can explain any answer afterwards. The teams that do this ship AI features that survive an audit; the teams that skip it ship demos.
Want to see how this maps onto your stack? Read more about my AI engineering work or get in touch.