← All projects

Back end

Documentation assistant (RAG)

An assistant that answers questions about technical documentation, citing its sources down to the file and line, and saying when they hold no answer.

In progress Sprint S61-S62 · 10 points
In short, no jargon for non-developersRead the summaryClose
What it is
An assistant a team asks about its documentation, which answers by showing where each sentence comes from.
What it is for
To find the right page quickly in growing documentation, without trusting a made-up answer.
What it shows
Plugging a language model into one's own documents, and measuring the quality of what it finds and of what it answers.
Source code

How the pieces fit together

Diagram: Documentation → Chunking ; Chunking → BM25 (keywords) ; Chunking → Qdrant (vectors) ; BM25 → Hybrid search (ranks) ; Qdrant → Hybrid search (ranks) ; API → Hybrid search ; Hybrid search → Claude. keywords vectors ranks ranks Documentation the repository's Markdown Chunking blocks, headings, lines BM25 written here, no library Qdrant MiniLM embeddings Hybrid search RRF fusion API FastAPI, Docker Claude search_result blocks

What it finds

Measured on 40 reference questions in French and English, 32 of which have their answer somewhere in the documentation's 421 passages; for each, the right file and heading are known.

SearchRight passage 1stin the first 3in the first 5MRR
Keywords (BM25)0.410.560.660.51
Meaning (vectors)0.310.630.750.49
Hybrid (both, fused)0.530.690.810.62

Share of the questions with a right passage among the first results; MRR: mean of 1 / rank of the first right passage. Embeddings: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2, run locally. Recomputed by the CI whenever the documentation changes.

What it answers

Prototype: the evaluation of Claude's answers (right citations, right refusals) is written and tested with a fake model, but has not been run, for want of an API key; the CI's "answers" job will produce it with a key.

Tech stack

  • Python
  • FastAPI
  • Qdrant
  • Claude
  • pytest
  • Docker

Who does what

Python
Ingestion (split by headings, lines kept), hybrid search and evaluation.
FastAPI
The search and question routes, request validation and the OpenAPI documentation.
Qdrant
The vector database: the passages' multilingual embeddings, searched by similarity.
Claude
Writes the answer from the retrieved passages only, each sentence cited (search_result blocks).
pytest
Tests of chunking, search and citations, with a fake model, on Linux, Windows and macOS.
Docker
The API and Qdrant, started by docker compose.

Definition of Done

  • Code reviewed, diff by diff
  • Unit and integration tests green
  • Green CI on Linux, Windows and macOS when compiled
  • README, REVIEW.md and DECISIONS.md up to date
  • Texts in French and English
  • Demo deployed and tested on mobile