All work
OPEN SOURCE2025

Ask FastAPI Docs

A public RAG system built to show the parts most demos skip.

github.com/zainasher42/fastapi-docs-rag
94%
pass rate across 18 eval pairs
~$0.05
to ingest the full corpus

The problem

Most public RAG demos prove that a framework works on a toy dataset. They skip the parts that decide whether a real system holds up.

Reciprocal Rank Fusion over two retrievers

Vector search and PostgreSQL full-text search each fail in a different direction: embeddings miss exact identifiers and API symbol names, full-text misses paraphrase. RRF merges both ranked lists without needing a tuned weight between them, which matters because the right weight differs per query and there is no principled way to pick one globally.

Structure-aware chunking

Chunks split on heading boundaries and carry their section path as a prefix, so every chunk is self-describing. A chunk that reads 'Dependencies > Sub-dependencies > Caching' before its content retrieves correctly for queries about caching in a way that a bare paragraph of prose does not.

Prompts built around caching boundaries

Prompts are XML-structured with the stable content first and the volatile content last, so the cacheable prefix stays byte-identical across requests. Structuring for the cache boundary rather than for readability is what brings ingest cost down to roughly five cents for the full corpus.

Evals where failures stay visible

The golden-set suite covers 18 question/answer pairs and currently passes 94%. The failing cases stay in the report rather than being tuned away or removed from the set. A suite that always passes measures nothing; the value is in watching which cases break when retrieval changes.