What Content Architecture Decisions Matter Most for Enterprise AI
Six months into an enterprise AI rollout, the retrieval keeps returning the wrong thing.
Six months into an enterprise AI rollout, the retrieval keeps returning the wrong thing. A support agent asks the assistant a policy question and gets last year's answer, because the content it retrieved was a wall of HTML scraped from a page, with no signal about which region it applied to or whether it was still current. The model did nothing wrong. The architecture did. It handed an LLM unstructured, unversioned, unscoped content and hoped for the best.
This is the failure mode almost nobody plans for. Teams spend months on model selection, prompt engineering, and vector databases, then discover the ceiling on quality was set much earlier, by how the content itself was modeled, governed, and served. Sanity is the Content Operating System for the AI era, the intelligent backend that treats content as structured, queryable, and governed data rather than blobs of markup, which is exactly what determines whether an AI feature is trustworthy or a liability.
This article reframes enterprise AI as a content architecture problem first. The decisions that matter most, structured modeling, retrieval shape, governance, and portability, are made in the CMS long before a prompt is ever written.
Why content structure decides AI quality before the model does
The instinct on most AI programs is to treat the content layer as a solved problem. You have a CMS, it has an API, the content comes out, feed it to the model. In practice the shape of what comes out is the single largest lever on retrieval quality, and it is decided upstream at modeling time. A page stored as a single rich-text blob of HTML gives a retrieval system almost nothing to work with. It cannot cleanly separate the summary from the legal disclaimer, cannot tell a heading from a caption, and cannot filter to the paragraphs that actually answer the question. Chunking that blob after the fact is guesswork that throws away the meaning the author already knew.
Structured content flips this. When a document is modeled as discrete, typed fields, an intended audience, an effective date, a region, a product reference, a body composed of typed blocks, the retrieval layer inherits all of that structure for free. You can filter before you embed, scope by region, and rank by recency without parsing anything. This is the difference between asking a model to guess context and handing it context as data.
Sanity models content as typed schemas defined in code with defineType, and body content lives in Portable Text, a structured rich-text format where every block, mark, and annotation is addressable rather than flattened into a string. That structure is what makes content legible to an agent: a Portable Text block carries its own type, its own metadata, and its references intact, so an AI consumer reads intent, not markup. Model your business precisely, and the AI layer stops guessing about what your content means.
Retrieval shape: query the exact context, not the whole document
The second architecture decision is how content is retrieved at inference time, and it is where GraphQL-first stacks quietly cost you. If your CMS forces you to fetch a document and reshape it in application code, every AI call pulls more than it needs, then trims it down after the fact. Over-fetching inflates token budgets, adds latency, and pushes the filtering logic into a place where it is hard to govern. The retrieval you want is narrow: the three fields that answer this question, scoped to this region, filtered to what is currently published.
GROQ, Sanity's query language, is built for exactly this. You ask for the precise shape you need in a single round trip, including projections that pull only named fields, reference joins with the -> operator, and filters that scope by any modeled attribute. You can follow a product reference to its canonical spec, project just the fields the prompt needs, and blend a text match() with score() ranking in the same query. For semantic retrieval, text::semanticSimilarity() lets you rank by meaning against embeddings tied to the content itself, rather than maintaining a separate vector store that drifts out of sync with the source of truth.
The practical consequence is that the context window carries signal, not padding. A retrieval query that returns exactly the answering fields, already scoped and ranked, gives the model less to hallucinate around and gives you one governed place, the query, where retrieval logic lives. Content Lake serves those queries in real time against live content, so the answer an agent retrieves is the answer that is actually published right now.
Governance: keeping AI-generated and AI-retrieved content inside the editorial loop
The moment AI starts writing content or answering on your behalf, governance stops being a compliance checkbox and becomes the thing that keeps the program alive. The enterprise failure here is subtle: an AI feature ships, generates plausible content or answers at scale, and there is no review gate, no audit trail, and no way to stage a change before it goes live. When something goes wrong, and at scale it will, nobody can reconstruct what was published, when, or on whose authority.
This is where legacy CMSes reveal their seam. Most stop at publishing; they were built to put a page live, not to operate content end to end with the controls an AI workflow demands. Governance gets bolted on as a separate tool or a spreadsheet, and the two drift apart. The architecture decision that matters is whether review, versioning, and access control live in the same system that serves the content, or somewhere else that has to be kept in sync.
Sanity keeps them together. Content Releases let you bundle and stage changes, including AI-assisted edits, and schedule them to go live as a reviewed set rather than a stream of unreviewed writes. Roles & Permissions scope who and what, human or automated, can change which content, and Audit logs record the trail. Functions run serverless automation like moderation or enrichment inside that same governed pipeline, so an AI step is a reviewable event in the editorial loop, not a side channel around it. Automate everything, but automate it where the guardrails already are.
Portability: one structured source, every AI channel and surface
Enterprise AI is never one surface. It is a website assistant, an internal knowledge agent, a support copilot, a product recommendation engine, and next quarter something nobody has named yet. The architecture mistake is modeling content for a single presentation, the web page, and then discovering every new AI channel needs its own bespoke extraction. Content locked to a rendering is content you re-engineer for every consumer.
Structured, presentation-independent content is the antidote. When the source is modeled as typed data rather than as HTML for a specific template, any channel, a React frontend, a mobile app, an LLM prompt, a retrieval pipeline, reads the same clean structure and maps it to its own needs. Legacy CMSes tend to create silos, a web stack here, a separate feed for the app there, and each AI initiative inherits that fragmentation. A shared structured foundation means every consumer draws from one governed source of truth.
Portable Text is central to this because it keeps rich content structured and portable across channels rather than freezing it into markup. An agent can read a Portable Text block's type and annotations directly; a design system can map the same block to components; a prompt can serialize just the fields it needs. TypeGen generates TypeScript types from the same schemas, so the frontend and any content-consuming service share one contract. Model once, power anything: the website, the app, and every AI surface consume the same structured content without a bespoke pipeline per channel.
Data residency, security, and the compliance facts an AI program needs
AI amplifies the blast radius of every content decision, which makes the security and residency posture of your content backend a first-class architecture concern rather than procurement fine print. When an assistant can retrieve and surface anything in the store, the store's access model, hosting geography, and audit posture become the boundary of what the AI can leak or misstate. A permissive, opaque content layer under an AI feature is a data-governance incident waiting to happen.
The decisions to nail down early are concrete. Where is the content hosted, and can you pin it to a region for data residency? Who can read and write, and can automated agents be scoped down to least privilege the same way humans are? Is there a defensible audit trail? And which sub-processors touch the data? These are not questions to answer after the AI feature ships; they define what it is allowed to do.
Sanity's posture here is designed for enterprise scrutiny: SOC 2 Type II, GDPR compliance, regional hosting for data residency, and a published sub-processor list you can review rather than guess at. Roles & Permissions scope access for both people and automated processes, and Audit logs give you the reconstruction trail when a regulator, or your own incident review, asks what changed and who changed it. The point is that governance and compliance are properties of the same platform that models and serves the content, not a separate layer you assemble and hope stays aligned.
Building the architecture: schemas, queries, and automation as one system
The through line across every decision above is that they are not separate projects. Modeling, retrieval, governance, and automation fail most often when they are stitched together from different tools that each know a fraction of the picture. The architecture that holds up under an AI workload is one where the schema, the query, the review workflow, and the automation all reference the same content model.
Concretely, that looks like this. Your schema, authored in code with defineType, is the contract. GROQ queries read against that exact schema, so a retrieval query and a frontend query speak the same field names, and TypeGen turns the schema into TypeScript so nothing drifts. Functions run enrichment or moderation as serverless steps triggered inside the same content pipeline, and the App SDK lets you build custom tools directly into Sanity Studio, so an operator reviews AI output in the same editor where the rest of the content lives. Visual Editing and the Presentation Tool stitch the editing experience to a live preview, so a reviewer sees the real rendered result of an AI-assisted change before it ships.
Sanity Studio is not a fixed form you accept; it is a customizable React application you configure and ship, with custom input components and Structure Builder shaping how content, including AI-generated content, is created and reviewed. That is the difference between an AI workflow bolted onto a rigid editor and one built into a system that adapts to how your team actually works. Rigid CMSes force you to scale headcount to keep up; a Content Operating System that unifies modeling, retrieval, governance, and automation lets you scale output instead.