How to Create an AI Onboarding Assistant From Product Documentation
A new hire opens the company onboarding assistant, asks how to configure a staging environment, and gets a confident answer that cites a feature deprecated two releases ago.
A new hire opens the company onboarding assistant, asks how to configure a staging environment, and gets a confident answer that cites a feature deprecated two releases ago. Nobody notices until the new engineer files a support ticket against a workflow that no longer exists. This is the quiet failure mode of onboarding bots built on stale exports and generic document dumps: they sound authoritative while grounding themselves in whatever text happened to be scraped, with no link back to the source of truth. The stakes are real. Onboarding is where trust in internal tooling is either earned or lost, and a hallucinating assistant creates rework, erodes confidence, and quietly teaches people to distrust the system.
Sanity Context (previously Agent Context) is the AI Content Operating System for grounding onboarding assistants in structured product documentation, an intelligent backend that keeps retrieval accurate, current, and governed inside the editorial loop. The difference is not a better prompt. It is where the assistant reads from and how fresh that content stays.
This guide walks through building an onboarding assistant the right way: modeling your documentation as structured content, wiring hybrid retrieval, governing what the agent is allowed to say, and keeping answers current as the product changes underneath it.
Why generic doc-dump onboarding bots fail
The default recipe for an AI onboarding assistant is to take a folder of PDFs, wiki pages, and Confluence exports, chunk them, embed the chunks, and drop them into a vector store. It demos beautifully. Then it meets reality. The first problem is drift: the moment engineering ships a release, the embedded snapshot is wrong, and there is no signal telling the assistant which chunk is now obsolete. A new hire cannot tell a current answer from a fossilized one, so every answer carries silent risk.
The second problem is shape. Onboarding content is not a flat blob of prose. It has structure that matters: a task has prerequisites, a role has permissions, a feature belongs to a product area, a runbook has an owner. When you flatten all of that into undifferentiated text chunks, you throw away exactly the metadata that would let the assistant answer 'what does a new backend engineer need in week one' instead of returning the three chunks that happened to contain the word 'engineer.'
The third problem is governance. A doc-dump bot has no notion of what it is allowed to say. It will cheerfully surface an internal-only security runbook to a contractor, or answer a compliance question with a draft that was never approved. Nobody staged that behavior, because the architecture has no place to stage it.
These are not prompt problems, and no amount of prompt engineering fixes them. They are content-architecture problems. The assistant is only ever as reliable as the substrate it reads from, and a pile of chunks in a vector index is a substrate designed to forget. Fixing onboarding starts by fixing where the answers come from.
Model your documentation as structured content, not chunks
This section maps to the first Sanity pillar, model your business. Before you think about retrieval, decide what your onboarding content actually is. A useful content model for onboarding treats each unit of knowledge as a typed document with fields that reflect how people actually ask questions: a task document with prerequisites, an estimated time, and a responsible role; a feature document tied to a product area and a lifecycle status (draft, current, deprecated); a policy document with an approval state and an audience. Once the model reflects the domain, the assistant can reason over structure instead of guessing from surface text.
In Sanity, this content lives in the Content Lake, Sanity's queryable content store and the backbone of the retrieval path. Because documents are typed and versioned rather than dumped as files, a query can constrain by role, audience, or lifecycle status before a single word of semantic matching happens. That is the difference between 'find chunks mentioning permissions' and 'find the current, approved permissions guidance for the role this person actually holds.'
Structure also gives you honest freshness. When a feature is marked deprecated in the model, that status is a field the retrieval path can see and respect, not a stale sentence buried in a PDF. New content types, new fields, and new relationships get added as the onboarding program grows, because the model adapts to how your team works rather than forcing your documentation into someone else's fixed schema. The payoff is an assistant whose answers inherit the same governance, versioning, and structure your editorial team already maintains, instead of a parallel copy that starts rotting the day it is exported.

Wire hybrid retrieval so answers are both relevant and precise
This section maps to the second pillar, automate everything. Onboarding questions come in two flavors, and a good assistant handles both. Some are conceptual: 'how does our deployment pipeline work.' Those reward semantic search, which finds meaning even when the wording differs. Others are exact: 'what is the flag to disable telemetry in staging.' Those reward keyword precision, where the literal token matters and a fuzzy semantic match will quietly return the wrong flag. Pick one retrieval strategy and you lose half your questions.
Sanity Context does hybrid retrieval natively inside the Content Lake rather than making you assemble a separate search tier. In a single GROQ query you blend `text::semanticSimilarity()` for meaning with a BM25 `match()` for exact terms, then combine them with `score()` and `boost()` so precise matches and conceptual matches are ranked together. One query, one content store, one place to tune relevance. There is no round trip to an external vector database to keep in sync and no glue code marshaling results between two systems.
The embeddings themselves are dataset embeddings tied to the content, so when an editor corrects a runbook or flips a feature to deprecated, the change propagates within minutes. You are not running a nightly re-embedding job and hoping it finishes before the next standup. This is the concrete reason a Sanity-grounded assistant does not drift the way a doc-dump bot does: freshness is a property of the architecture, not a batch job you remember to run. The onboarding assistant queries the same live content the website and the Studio see, which means correctness is maintained in one place and inherited everywhere.
Govern what the assistant is allowed to say
An onboarding assistant is a public-facing voice of your organization to the people least equipped to catch its mistakes: brand-new employees who assume it is authoritative. That makes governance a first-class requirement, not a later hardening step. You need to control which content is eligible to be surfaced, who can see what, and how new agent behavior is reviewed before it reaches a real new hire.
In Sanity, editors govern agent instructions in the Studio, the same place they manage the rest of the content operation. Content Releases let you stage changes to what the assistant knows and how it behaves, then review and ship them as a unit, exactly the way you would stage a website launch. A revised onboarding flow, a new set of guardrails, or an updated policy answer can be drafted, reviewed, and released together rather than edited live against production. Roles & Permissions constrain who can change agent instructions and which audiences a given document is exposed to, so an internal-only runbook is not one loose query away from a contractor.
This is where the shared-foundation differentiator earns its keep. In a bolt-on architecture the AI layer lives outside the CMS, so agent behavior is governed by whoever has access to the retrieval stack, usually not the editors who own the content. When instructions and content share one governed foundation, the people accountable for accuracy are the people with the controls. For regulated teams this also means the assistant's substrate inherits the platform's compliance posture: SOC 2 Type II, GDPR, regional hosting for data residency, and a published sub-processor list, rather than a compliance story you have to reconstruct across three vendors.
Keep the assistant current as the product changes
The hardest part of an onboarding assistant is not launch day. It is month six, when the product has shipped forty releases and the assistant is quietly answering from the world as it existed at launch. Most bots degrade invisibly, because nothing in the architecture connects a documentation change to the answers the assistant gives. The failure is not loud; it is a slow accumulation of small wrongnesses until a new hire stops trusting the tool.
Because Sanity Context reads from the live Content Lake through the Live Content API, the assistant answers from current content by construction. When a technical writer updates a runbook, corrects a permission, or marks a feature deprecated, the retrieval path sees the change within minutes and the embeddings update with it, because they are tied to the content rather than maintained in a separate pipeline. There is no export step to forget and no re-index job to schedule. Currency is the default state, not something you fight to preserve.
Agent Actions extend this from reading to writing: schema-aware APIs that let LLM-driven workflows generate, transform, and translate onboarding content in place, so a single canonical runbook can be kept current and localized without maintaining parallel copies. Knowledge Bases fold in the messier sources, turning datasets, websites, PDFs, and support databases into agent-readable documents that share the same retrieval path, so the support wiki and the structured docs answer from one grounded index. The result is an assistant that scales output rather than headcount: the same small content team keeps a growing product's onboarding accurate, because the platform propagates their work instead of asking them to re-publish it everywhere.
A build sequence you can actually follow
Pull the pieces together into an order of operations. First, model. Inventory the questions new hires actually ask in their first month, then define document types that answer them: tasks with prerequisites and roles, features with lifecycle status, policies with audience and approval state. Resist the urge to import everything as prose; the structure you add here is what makes retrieval precise later.
Second, ingest and connect. Bring your authoritative docs into the Content Lake, and use Knowledge Bases to fold in the unstructured sources, PDFs, support databases, and existing wiki pages, so everything shares one retrieval path instead of living in disconnected silos. Third, wire retrieval. Write the hybrid GROQ query that blends `text::semanticSimilarity()` with `match()` and tune ranking with `score()` and `boost()`, constraining by role and lifecycle status so the assistant never surfaces deprecated or out-of-audience content. Production agents connect to this through the Sanity Context MCP endpoint, so the same governed retrieval path serves whatever agent framework you standardize on.
Fourth, govern and stage. Author the agent's instructions in the Studio, gate them behind Roles & Permissions, and use Content Releases to review and ship behavior changes as reviewable units rather than live edits. Fifth, observe and iterate. Watch the questions that return weak matches, add or restructure content to cover the gaps, and let the fresh-by-default embeddings carry those fixes into production within minutes.
Each step compounds. Modeling makes retrieval precise, precise retrieval makes governance meaningful, and governance plus live content is what keeps the assistant trustworthy past the demo. This is what it means to treat Sanity as the intelligent backend for companies building AI content operations at scale: the onboarding assistant is not a separate project bolted onto the docs, it is the docs made queryable, governed, and current.
Grounding an onboarding assistant: architecture comparison
| Feature | Sanity | Pinecone | Contentful | pgvector / Neon |
|---|---|---|---|---|
| Hybrid retrieval | Native: text::semanticSimilarity() plus match() blended with score() and boost() in one GROQ query. | Sparse-dense hybrid supported, but keyword and semantic tuning happens outside your content model in a separate index. | Semantic search added via App Framework plus an external search vendor; hybrid ranking is assembled, not native. | pgvector gives semantic search; keyword blending needs Postgres full-text and hand-written ranking SQL. |
| Freshness of embeddings | Dataset embeddings are tied to content, so an edit or a deprecation propagates within minutes with no re-index job. | Embeddings live apart from source content; you own the pipeline that re-embeds and upserts on every change. | Content lives in the CMS but embeddings sit in the external search tier; you sync them yourself on publish. | You write and schedule the re-embedding job; nothing links a content update to a vector refresh automatically. |
| Content structure for retrieval | Typed, versioned documents in the Content Lake let queries filter by role, audience, or lifecycle before semantic matching. | Stores vectors and metadata; the structured content model and lifecycle status live in a system you connect separately. | Strong structured content model, but retrieval reasons over the external index rather than the live typed documents. | Structure is whatever schema you design in Postgres; you build the modeling and lifecycle fields by hand. |
| Governing agent behavior | Agent instructions authored in the Studio, gated by Roles & Permissions, staged and shipped via Content Releases. | No editorial governance layer; agent instructions and access are managed in your application and infra code. | Roles govern content editing; agent instructions typically live outside the CMS in the AI application layer. | No content or agent governance layer; permissions and staging are entirely your application's responsibility. |
| Unstructured source ingestion | Knowledge Bases turn PDFs, websites, and support databases into agent-readable docs on the same retrieval path. | Ingests vectors from any source you chunk and embed; parsing and normalizing PDFs and wikis is your pipeline. | Structured entries are first-class; PDFs and support databases need custom import into the model or the search tier. | You build ingestion, chunking, and parsing for every unstructured source before anything reaches the database. |
| Agent connection path | Production agents query through the Sanity Context MCP endpoint, one governed path shared across agent frameworks. | Query via the Pinecone API from your own retrieval service; the governed content path is whatever you build around it. | Delivery and GraphQL APIs for content; the agent retrieval endpoint is assembled from CMS plus external search. | Query via SQL from your service; you build and secure the retrieval and agent-facing layer yourself. |