Documentation
Everything about ondocs, from the first install to the index format. Every page here is also in the index, so you can ask instead.
Get started
Integrations
- DocusaurusThe Docusaurus 3 plugin, which indexes the built site and adds the dialog.
- Astro and StarlightThe Starlight plugin and the Astro integration, which index the built site and add the dialog.
- VitePressThe VitePress plugin, which indexes the built site and adds the dialog, with one change to the config.
- Next.js and ReactIndex with the CLI, mount createAskHandler as a route handler, and render AskDialog.
- Script tagAdd the dialog to Hugo, Jekyll, Eleventy, MkDocs or plain HTML with one script tag.
- MCP serverServe the same index to coding agents and AI apps as an MCP server, with search and fetch tools, and no model call on your side.
- llms.txt and Markdown pagesWrite llms.txt, llms-full.txt and a Markdown copy of every page at build time, from the pages the index is built from.
- Writing an integrationBuild a plugin for another docs framework from ondocs/integration, the helpers the Docusaurus, Astro, Starlight and VitePress plugins are made of.
Guides
- Indexing contentWhat gets indexed, how files become URLs, chunking, excluding pages and the --check mode.
- Model providersBring your own key for OpenAI, Anthropic, Google, xAI, AI Gateway or any AI SDK provider, and configure the embedding model.
- DeployingWrite the endpoint for Vercel, Netlify, Cloudflare or GitHub Pages with one command, where the index lives, cold starts and cost.
- Workers AI, without an API keyA Cloudflare Worker that answers for any static docs site with Workers AI, the models and their cost, and how large a site fits.
- Rate limits and securityRate limiting, client IPs, CORS, prompt injection and what data leaves your servers.
- Bot check with TurnstileAsk visitors' browsers to pass a Cloudflare Turnstile check before each question, so a fleet of bots cannot spend your model budget.
- How retrieval worksBM25, cosine similarity, reciprocal rank fusion and the relevance gate that says "I don't know".
- Measure and improve answersScore retrieval in CI with ondocs eval, collect readers' feedback, and keep a log of the questions your docs do not answer.
Reference
- Package APIThe package's imports, the core functions for building and searching an index, and what each entry point exports.
- CLI and config fileEvery flag of ondocs index, init, dev and eval, and the config module.
- The ask endpointcreateAskHandler options, the request and response, errors and the streaming protocol.
- The ask dialogAskDialog props, the launcher button, shortcuts, theming, accessibility and the useAsk hook.
- The index fileWhat ask-index.json holds, why vectors are int8, and how the file stays small and diffable.
- BenchmarksIndex size, cold start, memory and query latency at 1,000, 10,000 and 50,000 chunks.
- Limits and trade-offsWhere ondocs stops being the right tool, and what it gives up for simplicity.
- FAQShort answers to the questions people ask first, with links to the details.
- Migrating from ask-my-siteask-my-site is now ondocs. What was renamed, what stays, and the commands to move a site over.