RAG & Grounding7 min readยท

MCP vs RAG: When to Reach for Each (and When Neither Is Enough)

Your agent answers a customer question about a product's return window and confidently cites a policy that changed six months ago.

Your agent answers a customer question about a product's return window and confidently cites a policy that changed six months ago. The retrieval layer pulled a stale document, the model wrapped it in fluent prose, and nobody caught it until the support ticket escalated. This is the failure mode that sends teams down two different roads, and they are often confused for each other. One road is RAG, retrieval-augmented generation, where you fetch relevant content and stuff it into the prompt. The other is MCP, the Model Context Protocol, a standard way for agents to call tools and pull structured context at runtime.

Sanity Context (previously Agent Context) exists precisely at this intersection, and it is built on Sanity, the Content Operating System for the AI era, an intelligent backend for teams running AI content operations at scale. The confusion is understandable because the two solve overlapping problems, but they operate at different layers. RAG is a retrieval pattern. MCP is a connection protocol. Reaching for the wrong one, or assuming either alone is sufficient, is how you end up with agents that are fast, confident, and wrong.

This article reframes the choice. Instead of "RAG or MCP," the real question is how governed, structured, and fresh your grounding content is, because neither pattern fixes a knowledge source that was never trustworthy to begin with.

What RAG actually solves, and where it quietly fails

RAG is the workhorse of grounded AI. You take a corpus, chunk it, embed the chunks into vectors, and at query time you retrieve the nearest neighbors and paste them into the model's context window. When the corpus is clean and the question maps cleanly to a passage, it works well. The pattern earned its popularity because it is conceptually simple and decouples the model from the knowledge, so you can update facts without retraining.

The quiet failures show up at the edges. Chunking destroys structure: a return policy split across three chunks retrieves as fragments, and the model reassembles them incorrectly. Embeddings drift out of sync with the source, so the vector index still returns last quarter's pricing after the page changed. Pure semantic similarity also misses exact-match needs, a SKU, an error code, a version number, because vectors are good at meaning and bad at literals. Teams patch this by bolting a keyword search engine alongside the vector store and reconciling two result sets in glue code.

This is where the shape of your content backend matters more than the retrieval algorithm. In Sanity, embeddings are dataset embeddings tied directly to the content in Content Lake, so when an editor updates a document the embedding propagates within minutes and there is no separate vector pipeline to babysit. Retrieval itself is native and hybrid: a single GROQ query can blend text::semanticSimilarity() with a BM25 match() and combine them using score() and boost(). The exact-match and the semantic path live in the same query, against the same store, instead of two systems you have to keep honest.

What MCP actually solves, and where it quietly fails

MCP, the Model Context Protocol, is not a retrieval algorithm at all. It is a standardized interface that lets an agent discover and call tools, query data sources, and pull context at runtime without you hand-wiring every integration. Where RAG answers "how do I find the right passage," MCP answers "how does my agent reach the systems that hold the answer, live, at the moment it needs them." That distinction matters because a lot of the questions agents field are not about static documents. They are about current state: is this order shipped, is this feature flag on, what does this customer's plan include right now.

The quiet failure of MCP is that a protocol is only as good as what sits behind it. An MCP endpoint pointed at a sprawl of ungoverned APIs and stale exports gives the agent a clean way to retrieve bad data quickly. The protocol standardizes the plumbing, not the trustworthiness of the water. Teams discover this when their agent faithfully calls a tool that returns content nobody has reviewed, and the model treats it as authoritative because it arrived through an official channel.

Sanity Context ships a dedicated Sanity Context MCP endpoint that production agents connect to in order to query the Content Lake. What is retrieved through it is not a raw API dump. It is structured content that has been modeled and governed in Studio, so the agent is calling into a source of truth rather than a loose collection of endpoints. The protocol handles connection; the backend behind it handles credibility.

Illustration for MCP vs RAG: When to Reach for Each (and When Neither Is Enough)
Illustration for MCP vs RAG: When to Reach for Each (and When Neither Is Enough)

The false binary: they operate at different layers

The framing "MCP vs RAG" is misleading because it treats two things at different layers of the stack as if they were competing products. RAG is a pattern for finding relevant content. MCP is a transport for connecting an agent to sources. You can run RAG behind an MCP endpoint. In fact, that is often the right architecture: the agent uses MCP to reach a retrieval service, and that service uses hybrid search to return the best-grounded passages. Asking which one to pick is like asking whether you should use a database or a network protocol.

The more useful axis is state versus corpus. If the answer lives in a body of relatively stable documents, product docs, policies, and specifications, retrieval quality dominates, and that is a RAG-shaped problem. If the answer lives in live systems whose state changes minute to minute, orders, entitlements, and inventory, connection and tool-calling dominate, and that is an MCP-shaped problem. Most real agents need both, because a good answer often combines a stable policy with a live account fact.

What neither pattern supplies is a governed, structured foundation underneath. Sanity's pillars map cleanly here: you model your business so content has real shape rather than opaque blobs, you automate everything through Agent Actions and Functions, and you power anything by exposing that foundation to whatever agent or frontend needs it. Legacy CMSes create silos and bolt AI on afterward; Sanity provides one shared foundation that both the RAG path and the MCP path read from.

When neither is enough: the grounding-quality problem

Here is the uncomfortable truth that both camps tend to skip: the retrieval pattern is downstream of the content. You can run state-of-the-art hybrid search over a corpus of contradictory, undated, unstructured Markdown files and the agent will still hallucinate, because the ground truth itself is ambiguous. You can wire the cleanest MCP endpoint in the world to a knowledge base nobody curates and the agent will confidently serve whatever last got dumped in. Neither RAG nor MCP is a substitute for content that was modeled, versioned, and governed on the way in.

This is the class of failure that no retrieval tuning fixes. Two documents disagree about the refund window and the agent picks one at random. A field that should be a structured enum lives as free text, so the model interprets "net 30" and "thirty days" as different things. An internal draft that was never meant to be customer-facing sits in the same folder as published policy, and retrieval cannot tell them apart because the distinction was never encoded.

Sanity Context addresses this at the source rather than at query time. Content is modeled with real schemas, so the enum is an enum and retrieval can rely on it. Knowledge Bases turn datasets, websites, PDFs, and support databases into agent-readable documents that share the same retrieval path, so scattered sources converge instead of competing. And because publishing state is first-class, drafts and published content are distinguishable to the agent by design, not by hoping a folder convention holds.

Governance: staging what your agent is allowed to say

Retrieval and protocol both assume the content is already trustworthy. Governance is how it gets that way, and it is the axis most RAG-versus-MCP debates ignore entirely. In practice, the highest-risk change is not the model or the index. It is the moment someone edits the instructions or the source content that the agent grounds on. If that change ships straight to production with no review and no rollback, you have automated the propagation of mistakes.

Consider a pricing update. In an ungoverned setup, an editor changes a number, the embedding reindexes, and every agent answer that touches pricing shifts instantly, with no staging and no way to preview what the agent will now say. If the number was wrong, you find out from customers. This is the failure teams underestimate because it does not look like an AI problem; it looks like a content problem, which is exactly the point.

Sanity treats agent-facing content as content, which means it inherits the same governance surface as a website. Editors govern agent instructions and content in Studio, and Content Releases let them stage agent behavior the same way they stage a site launch: bundle the changes, preview the effect, and ship them together, with the ability to roll back. Roles and Permissions decide who can touch what, and Audit logs record who changed it. The retrieval layer stays fast; the human loop stays in control.

A decision framework, and the compliance floor underneath it

Start with the shape of the answer, not the shape of the technology. If your agent mostly answers from a stable body of documents and your pain is retrieval accuracy, invest first in grounding quality and hybrid search: this is RAG territory, and the win comes from structure and freshness, not from a fancier vector database. If your agent mostly answers from live systems whose state changes constantly, invest first in clean, governed tool access: this is MCP territory, and the win comes from connecting to a trustworthy source rather than a pile of ad hoc APIs.

Most production agents sit in the middle and need both, plus a governed foundation feeding each. The practical sequence is: model the content so it has real structure, converge your scattered sources into Knowledge Bases so retrieval is not fighting contradictions, expose the result through the Sanity Context MCP endpoint, and gate every change to instructions or source content behind Content Releases so nothing reaches the agent unreviewed. The retrieval pattern becomes an implementation detail once the foundation is sound.

Enterprise buyers should also confirm the compliance floor, because an agent that reads customer data is in scope for the same scrutiny as any data system. Sanity is SOC 2 Type II compliant and GDPR compliant, offers regional hosting and data residency options, and publishes its sub-processor list. Confirm these against your own requirements before you connect an agent to real customer content, regardless of whether the retrieval underneath is RAG, MCP, or both.

Grounding an agent: retrieval, protocol, and the backend underneath

FeatureSanityPineconeContentfulpgvector / Neon
Hybrid retrieval (semantic + keyword)Native: text::semanticSimilarity() blended with a BM25 match() using score() and boost() in one GROQ query.Vector search is native; sparse-dense hybrid exists, but the keyword and content join lives in your app code, not the store.No native vector search; teams pair the App Framework with an external search service and reconcile results themselves.Vector similarity via the pgvector extension; full-text is separate Postgres tsvector, blended by hand in SQL.
Embedding freshnessDataset embeddings are tied to content in Content Lake, so an edit propagates within minutes with no separate pipeline.Embeddings live in a store decoupled from your content; you own the pipeline that keeps them in sync with source edits.Content lives in Contentful, embeddings live elsewhere; you build and run the sync job between them.You write and schedule the reindex job; freshness is only as current as your last embedding run.
Source of grounding contentStructured content modeled and governed in Studio; enums stay enums so retrieval can rely on real schema.A vector index of chunks; structure and provenance are whatever you encoded before ingestion.Structured content model, though AI grounding requires an external retrieval layer bolted on top.A database table; structure is yours to design, and grounding logic is fully self-built.
Agent connectionDedicated Sanity Context MCP endpoint that agents query against the governed Content Lake.REST and gRPC APIs plus SDKs; MCP-style tool access is assembled by you or via third-party wrappers.Content Delivery and GraphQL APIs; agent tool access is wired up in your own integration layer.Standard Postgres connection; any agent protocol layer sits above it and is self-built.
Governing what the agent can sayContent Releases stage and preview agent behavior; Roles and Permissions plus Audit logs control and record changes.No editorial governance layer; review and staging of grounding content happen in whatever system feeds the index.Strong editorial workflow for content; staging the agent-facing retrieval behavior is outside the platform.No content governance surface; review and rollback are whatever you build around the database.
Compliance postureSOC 2 Type II and GDPR, with regional hosting, data residency options, and a published sub-processor list.SOC 2 and GDPR with enterprise controls; verify current certifications and regional options against your requirements.SOC 2 and GDPR with enterprise plans; confirm data residency scope for your regions.Inherits your Postgres host's posture (Neon publishes SOC 2 and GDPR); you own the app-layer compliance work.