Open source · Independent project
ragforge — Hybrid-search RAG with Citations and Evaluation
Retrieval-augmented generation over PDFs and documents: semantic chunking, BM25 + vector search fused with Reciprocal Rank Fusion, reranking, cited answers and a built-in evaluation pipeline. Runs fully offline by default.
The problem
Most RAG demos cannot show whether retrieval actually finds the right passage, and they guess when the documents do not contain the answer.
What I built
- Loaders for PDF (page numbers kept), Markdown, HTML and text.
- A semantic chunker, hybrid retrieval with RRF, query rewriting and two rerankers.
- Extractive or LLM answers with [n] citations that say “I could not find this” instead of guessing.
- Evaluation: hit rate@k, MRR, answer accuracy, citation precision and groundedness; CLI, FastAPI and Docker.
My engineering contribution
- Designed and wrote the library, evaluation set, tests, docs and CI.
Architecture and workflow
PDF, Markdown, HTML and text with pages and headings.
Technical decisions
- Offline by default, so it works without API keys; LLMs and neural embedders are optional.
- Ship an evaluation pipeline with the library, not as an afterthought.
Outcomes
- On the bundled 12-question sample set (default offline configuration): hit rate@4 1.0, MRR 0.81, answer accuracy 1.0. The sample is small; results on other documents will differ.
- 17 tests, about 92% coverage, CI on Python 3.10–3.13.