FactPath
Find where a RAG system lost the fact: one root cause per wrong answer, with the evidence.
- Python
- Next.js
- OpenRouter
A low score says something is wrong. Not where.
Evaluating a RAG system is where the time goes: building a golden set, choosing among dozens of metrics, and above all finding where a wrong answer came from. Was the fact lost when the document was parsed, cut in two by chunking, never retrieved, ranked too low, cut from the prompt, or ignored by the model?
Existing tools score answers, or classify errors with an LLM. FactPath follows each expected fact through the pipeline and shows the spans: the source passage, where it landed after parsing, the chunk it fell into, the rank it got, and the answer that used or ignored it.
Measured where it can be, judged only where it must be.
Built for the real case, not the slide.
- 01
Facts anchored in the sources
Each expected fact is tied to exact passages of the documents, and checked again automatically when the documents change.
- 02
One root cause per failure
The first stage that lost the fact, with later problems kept as secondary causes. Thirteen causes, from “lost in parsing” to “stale document” and “ignored”.
- 03
Evidence side by side
Source, parsed text, chunks, ranks before and after reranking, and the answer, on one screen.
- 04
Validated on planted defects
The reference pipeline can break one stage at a time, and FactPath must find what was broken.
6 stages, end to end.
The first five stages are measured with string alignment and rank arithmetic, no model. When the right passage was missing, the answer is regenerated with it put back, to confirm the cause.
Stage 01
Parsing
Is the fact still in the parsed text, in the right version of the document?
Stage 02
Chunking
Does one chunk hold it whole?
Stage 03
Retrieval
Was that chunk a candidate?
Stage 04
Ranking
Did it make the top-k, before and after reranking?
Stage 05
Assembly
Did it reach the prompt intact?
Stage 06
Generation
Did the answer use it? Judged by an LLM, with a confidence.
Broken on purpose, found again.
A benchmark of 32 official French housing pages (service-public.fr) and 65 questions written by hand, answered by GLM 5.3 Flash. The baseline answers 91% of the questions. Then I broke one stage at a time.
| Stage broken | Attributed to it |
|---|---|
| Retrieval | 100% |
| Stale index | 100% |
| Parser | 83% |
| Prompt | 70% |
| Reranker | 62% |
| Context assembly | 62% |
| Chunking | 44% |
- In all seven cases, the planted cause is the most frequent verdict.
- Eight live runs cost less than 25 US cents.
Few parts, chosen on purpose.
Python engine
FastAPI and SQLite. One local file, so confidential corpora stay on the machine.
Next.js app
A workbench mode to run and inspect evaluations, and a read-only showcase.
LLM and embeddings via OpenRouter
GLM 5.3 Flash and bge-m3, with zero data retention requested and a hard spend cap.
Built and running. Shown on request.
Access is private while I decide how to open it. The recording above shows a full run; to see it on your own case, write to me and I will show you on a call.