VitePress AI Search and Chat Guide
Add AI search and chat to your VitePress docs so visitors get answers from your own content with citations. Here is the setup and how to keep it current.
Adding AI chat to a VitePress site upgrades your documentation from keyword search to real answers — drawn from your own content, with a citation to the source page. VitePress makes this clean because you can register the widget through its theme config, and the whole setup takes minutes.
Why VitePress docs are a strong fit
VitePress powers fast, Vue-based documentation sites, and documentation is exactly where an AI agent earns its keep. A reader with a question doesn't want a list of search hits; they want the answer. An agent reads your docs and responds directly, citing the page so the answer is verifiable. VitePress's clean structure and headings retrieve well. See the documentation use case.
Step 1: Index your content
Create an account, get your publishable site key, and point the platform at your built VitePress site or its source repository. The platform chunks and embeds the content so it can be retrieved at answer time. Schedule a re-crawl so each docs update keeps the agent current.
Step 2: Register the widget in theme config
VitePress lets you add scripts through the head configuration in your config file, or via a custom theme's enhanceApp. Register the AIML.chat embed there with your publishable key, and it loads on every page of the built site. Because it's an async script, it doesn't affect your docs' load performance. Keep the key in config rather than inline on pages.
Step 3: Configure a technical agent
Pick a technical agent for precise, developer-focused answers that include the relevant snippet and cite the page. Give it a grounded prompt: answer only from your indexed docs, cite sources, and escalate when the answer isn't there. Grounding is what stops it inventing an API that doesn't exist — see what is RAG.
Step 4: Structure for retrieval
Retrieval rewards clean docs. Keep pages focused on one topic, use clear headings, lead with the answer, and write descriptive titles. Split overly long pages so they chunk well. These habits improve the agent's answers and help human readers navigate too.
Step 5: Learn from the analytics
After launch, the analytics show what readers ask and which questions the agent couldn't answer. That unanswered list is a precise docs backlog — write those pages, re-crawl, and the agent improves. You turn support questions into a content plan.
What you get
The result is a VitePress site that answers questions, not just hosts them: cited responses, around the clock, in the reader's language. Developers get unblocked without a ticket, and you see exactly where the docs fall short — all from a theme-config addition and an indexed crawl. See how to add AI to MkDocs for a sibling framework.
Why grounding beats a generic widget
Whatever platform you are on, the value is not the chat box — it is that the answers come from your own content. A generic chatbot bolted onto VitePress will improvise from a general model and confidently get your details wrong, which erodes trust fast. A grounded agent answers only from what you indexed and cites the page, so every reply is traceable to something you actually published. That is the difference between a widget that frustrates visitors and one they come to rely on, and it is why indexing your real content is the step that matters most.
Getting started
Add AI chat to your VitePress docs on the AIML.chat free plan: index your content, register the embed in theme config, and configure the agent. Compare tiers on the pricing page.
How do I add the widget to VitePress?+
Through the head config in your VitePress config file, or a custom theme's enhanceApp — register the embed with your key and it loads on every page.
Does it replace VitePress's built-in search?+
It complements it — search finds pages, the agent answers questions directly with citations. You can run both.
Will it stay current with my docs?+
Yes — schedule a re-crawl so each docs update re-indexes and keeps the agent's answers accurate.
Related reading
Get the AIML.chat newsletter
Practical tips on AI docs assistants, RAG, and growing with content — a couple of emails a month. No spam, unsubscribe anytime.
Double opt-in — we'll email you to confirm.