AI Search (Phase 3)
:::caution Phase 3, Not yet implemented This page describes the planned AI Search architecture. No search infrastructure is deployed yet. Implementation begins in Phase 3. :::
How AI-powered documentation search will work: hybrid retrieval over code-derived content, two-tier query routing, and a chat widget in the docs UI.
Overview
Phase 3 replaces the default Docusaurus search with a full hybrid search stack on Azure AI Search. Users will be able to type natural language questions and get direct answers grounded in code-derived content, not a ranked list of pages.
Hybrid search architecture
Azure AI Search provides the retrieval layer. Each documentation page is indexed as a set of overlapping chunks (512 tokens, 10% overlap) stored with three signals: a BM25-indexed plain text field for keyword recall, a dense vector embedding (BGE-large-en-v1.5, 1024 dimensions) for semantic recall, and a semantic ranker score for reranking at query time. This outperforms pure keyword or pure vector search on technical documentation: product terms like "WebRunner" and "tRFC" benefit from exact keyword matching while intent-level queries benefit from vector similarity.
Two-tier query routing
| Tier | Model | Trigger | Purpose |
|---|---|---|---|
| Gatekeeper | Claude Haiku 4.5 | All queries | Classify query, extract key terms, reject off-topic |
| Specialist | Claude Sonnet 4.6 | Complex / multi-step | Synthesize multi-chunk answer, generate code examples |
The gatekeeper runs in under 200ms and handles simple factual queries directly. The specialist handles multi-step questions, cross-page comparisons, and any query requiring code generation.
Chat widget integration
The search UI will use the Algolia AskAI widget embedded in the Docusaurus navbar. The widget sends queries to an Azure Function that runs the two-tier routing and returns a streamed answer with source citations. The Algolia AskAI slot is already reserved in docusaurus.config.ts, Phase 3 wires the backing service into that slot without structural site changes.
Coming in Phase 3
- Azure AI Search index provisioning (Terraform module)
- Indexing pipeline: MDX → chunks → embeddings → index
- Azure Function for two-tier query routing
- Algolia AskAI widget configuration
- Cost estimate: per-query inference cost, index storage, embedding refresh on release