Sphinx logo
Documentation Platforms

Sphinx AI Integration

Index Sphinx-generated docs and answer technical questions

What is it?

About Sphinx

Sphinx is the standard documentation generator for Python projects and is used across many languages for technical reference documentation. It produces HTML from reStructuredText and Markdown, often hosted on Read the Docs.

Integration capabilities

How BeforeQuery works with Sphinx

Everything you can do once the Sphinx integration is connected.

Read the Docs support

BeforeQuery crawls Sphinx docs hosted on Read the Docs, readthedocs.io, or self-hosted instances — sitemap discovery works for all.

API reference indexing

Sphinx-generated API references (autodoc output) are crawled and indexed, so users can ask questions about specific classes, methods, and modules.

Version-aware indexing

Index specific Sphinx doc versions and tag them in BeforeQuery. Users always get answers from the version that matches their usage.

Widget injection via template

Add the BeforeQuery widget script to your Sphinx HTML theme's layout.html template to surface chat to all readers.

Setup

How to connect Sphinx

  1. Step 01

    Add your Sphinx documentation site URL to a BeforeQuery knowledge base. BeforeQuery discovers all pages via sitemap.xml.

  2. Step 02

    Run the initial crawl. For large API references, the first index may take a few minutes.

  3. Step 03

    Inject the widget script into your Sphinx theme's HTML template to display AI chat on your docs site.

Sphinx — Frequently Asked Questions

Common questions about connecting BeforeQuery to Sphinx.

Yes. BeforeQuery crawls Sphinx documentation hosted on readthedocs.io and on Read the Docs custom domains. Sitemap discovery works for all Read the Docs deployments, including projects using the Read the Docs Sphinx theme or custom themes.
Yes. Sphinx autodoc output is rendered as standard HTML pages. BeforeQuery crawls and indexes these pages, so users can ask questions about specific Python classes, methods, and module-level functions and receive grounded answers from the API reference.
Add the BeforeQuery widget script tag to your Sphinx HTML theme's layout.html template (or the equivalent base template for your theme). The widget will appear across all pages of your Sphinx documentation site.
Yes. You can create separate BeforeQuery sources for each Sphinx doc version and tag them (v1.x, v2.x, latest). This allows BeforeQuery to return answers from the correct version based on user context or widget configuration.
For large API references with hundreds of pages, the first index typically completes within a few minutes. Subsequent incremental syncs are faster because BeforeQuery only re-processes pages whose content has changed since the previous crawl.

Ready to connect Sphinx?

Start free. No credit card required. Connect your first integration in under 5 minutes.