Adoption & Strategy7 min readβ€’

Real-World RAG Patterns That Use Editorial Content as the Source

A support bot answers a customer with a policy that was retired three release cycles ago. The text was accurate when it got embedded into the vector store, then the editorial team rewrote the page, and nothing re-indexed.

A support bot answers a customer with a policy that was retired three release cycles ago. The text was accurate when it got embedded into the vector store, then the editorial team rewrote the page, and nothing re-indexed. The retrieval layer was still confidently serving the stale chunk, footnoted and formatted, which is worse than no answer because it looks authoritative.

That gap between "content changed" and "index knows it changed" is where most editorial-content RAG breaks. Teams tend to blame the model, then the prompt, then the reranker, when the real failure sits upstream: the source of truth and the retrieval index drifted apart, and there was no event to reconcile them.

This article walks through the RAG patterns that actually hold up when the source is living editorial content rather than a frozen document dump: change-driven re-embedding, structure-preserving chunking, governed retrieval, and freshness you can audit. Sanity, the AI-native content platform, shows up as the exemplar because embeddings tied to content, rather than to a separate pipeline, is what closes that drift gap.

What makes editorial content harder to RAG than a document dump?

Editorial content is the hard case for retrieval-augmented generation because it changes, it is structured, and someone is accountable for what it says. A static PDF corpus you can embed once and forget. A living help center, product catalog, or policy library changes daily, and every edit silently invalidates whatever you embedded from it.

The three failure modes stack. First, freshness: a nightly batch re-embed means your index can lag reality by up to 24 hours, and during an incident or a pricing change that window is exactly when the bot is busiest and most wrong. Second, structure: naive chunking splits a table from its caption, a step from its numbered list, or a warning callout from the procedure it warns about, so the model retrieves a fragment that reads plausibly but has lost the constraint that made it correct. Third, governance: editorial content has owners, review states, and locales, and a retrieval layer that ignores draft versus published will happily serve an unapproved draft to a customer.

The reframe is that these are not model problems, they are content-system problems. You cannot prompt your way out of a stale index or a mid-table split. The fix is to treat retrieval as a downstream consumer of a content system that emits change events, preserves structure, and enforces publish state. In Sanity, that content system is the Content Lake, and because embeddings are derived from the same content model rather than copied into a disconnected store, the source of truth and what the model retrieves stay describing the same thing.

Illustration for Real-World RAG Patterns That Use Editorial Content as the Source
Illustration for Real-World RAG Patterns That Use Editorial Content as the Source

How do you keep a RAG index fresh when the source content keeps changing?

You keep a RAG index fresh by making re-embedding event-driven, so the index reflects an edit within seconds of publish rather than on a nightly schedule. The mechanism is a change event: the content system fires a signal the moment a document is published, and that signal triggers re-embedding of exactly the affected content instead of a full rebuild.

The alternative that most teams start with, a cron job that re-embeds everything at 2 a.m., fails on both freshness and cost. It is stale all day, and it re-embeds thousands of unchanged documents to catch the handful that moved. Change-driven re-embedding inverts that: no edit, no work; an edit, a targeted update.

In Sanity, this is native rather than assembled. Content Lake real-time subscriptions and Functions give you the publish hook, so a translate-on-publish or enrich-on-publish pipeline is the same shape as a re-embed-on-publish pipeline. More directly, dataset embeddings and the Embeddings Index API tie embeddings to the content itself, which means freshness is a property of the platform rather than a job you maintain. When an editor corrects a policy page, the embedding for that page updates because it is bound to that document, not because a separate scheduler happened to run. That is the difference between hoping your index is current and being able to state, with a timestamp, when it last reconciled with the source. For a deeper treatment of grounding agents against this kind of live content, Sanity Context is the surface built for it.

Why does chunking strategy decide whether editorial retrieval works?

Chunking decides retrieval quality because the chunk is the unit the model actually sees, and a badly cut chunk destroys the context that made the original content correct. Split a 500-token page into fixed 200-token windows and you will routinely sever a table header from its rows, a numbered step from its prerequisite, or a legal caveat from the clause it modifies.

The root cause is chunking on characters instead of on structure. Plain markdown or HTML flattened to a string has already lost the signal about where a safe boundary is. What you want is to chunk on the semantic structure of the document: keep a list intact, keep a table with its caption, keep an annotation attached to the span it annotates.

This is where structured rich text earns its place. Portable Text represents content as an array of typed blocks with marks, annotations, and nested structure preserved as data rather than baked into a string. Because the structure survives as data, a chunking pass can respect it: split on block boundaries, carry an annotation with its text, and keep a callout whole. The model then retrieves a fragment that still contains the constraint. Contrast a CMS that stores body copy as an HTML blob, where every consumer has to re-parse the markup and guess where the meaningful boundaries were. Portable Text is the difference between chunking that guesses and chunking that reads the document the way its author structured it, which is exactly the property you want when an LLM is going to quote the fragment back to a customer.

How do you stop RAG from retrieving unpublished or unapproved content?

You stop RAG from leaking drafts by making publish state and permissions part of the retrieval query, not an afterthought bolted on downstream. The failure mode is blunt: a team embeds everything in the dataset, including drafts and internal notes, and the retriever has no way to tell an approved published answer from a half-written one, so it serves whichever scores highest on similarity.

Governance has to live where the content lives. That means the retrieval layer needs to know a document's workflow state, its owning role, its locale, and whether it is embargoed, and it needs to filter on those attributes before similarity ranking ever runs. Retrieval that is semantically excellent but governance-blind is a compliance incident waiting for its moment.

In Sanity, the governance primitives are the same ones editors already use: Studio Workspaces, Roles and Permissions, and Content Releases stage, review, and schedule what goes live, and Audit logs record who changed what. Because embeddings and retrieval read from the same Content Lake that enforces those states, you can constrain retrieval to published, approved, in-locale content rather than reconstructing that logic in a separate vector store that has no concept of a review state. Agent Actions extend this by making LLM-driven workflows schema-aware, so a generate or transform step operates inside the same permission and validation model as a human editor. The point is that a draft never becomes a retrievable answer, because the same system that governs publishing governs what the model can see. On compliance posture, Sanity maintains SOC 2 Type II, GDPR alignment, regional data residency options, and a published sub-processor list.

What does a production editorial-RAG pipeline actually look like end to end?

A production editorial-RAG pipeline has five stages, and each one maps to a content-system capability rather than a model tweak. Walking them in order shows where the leverage is.

One, model the content. Define the schema so a policy, a product, and a help article are distinct types with owners, locales, and review states, because retrieval quality starts with content that knows what it is. Two, index on change. A publish event triggers targeted re-embedding of the affected documents, so the index tracks the source in near real time instead of overnight. Three, chunk on structure. Split on Portable Text block boundaries so tables, lists, and annotations survive into the vector store intact. Four, retrieve with governance. Filter to published, approved, in-locale content before similarity ranking, then blend semantic and keyword signals for precision. Five, generate and evaluate. Ground the model in the retrieved chunks, cite the source documents, and log what was retrieved so you can audit an answer after the fact.

Sanity's three pillars line up with this pipeline directly: model your business covers stage one, automate everything covers stages two through four through Functions, the Embeddings Index API, and Agent Actions, and power anything covers stage five where the same governed content feeds a support bot, a search box, and an internal agent from one shared foundation rather than three divergent copies. This is what it means to call Sanity the Content Operating System for the AI era: retrieval is not a separate stack you glue on, it is a consumer of the same governed, structured, event-emitting content that editors already work in. That shared foundation is why an answer served to a customer and the page an editor just corrected describe the same reality.

Should the CMS own the embeddings, or should you bolt on a vector database?

The CMS should own the embeddings when your source is editorial content, because the hardest problem in editorial RAG is keeping embeddings in sync with content, and a bolt-on vector database makes that sync your problem forever. The trade is real, so it is worth stating honestly.

A dedicated vector database like Pinecone gives you scale, tunable indexes, and mature operations, and for a frozen or externally-owned corpus that is often the right call. The cost shows up when the corpus is living content you also edit: now you run two systems of record, and every edit needs a pipeline to copy the change from the content store into the vector store, detect deletions, reconcile failures, and prove the two agree. That reconciliation layer is the thing that silently rots and starts serving stale chunks.

When embeddings are tied to content, that entire class of drift disappears because there is only one place the content lives. Sanity's dataset embeddings and Embeddings Index API keep embeddings bound to the documents they describe, so a delete is a delete and an edit re-embeds without a copy pipeline in between. You give up some of a specialist vector database's index-level tuning; you gain the guarantee that the index cannot silently disagree with the source. For editorial content specifically, that guarantee is usually worth more than the tuning, because the failure you actually ship is a stale answer, not a slow one. The decision rule: own the embeddings in the CMS when you own and edit the content, reach for a standalone vector store when the corpus is large, static, or lives somewhere you do not control.