The complete journey of a question — from an uploaded PDF to a cited, evidence-only answer
The one-sentence version
Your PDFs are split into clause-level passages and indexed; a question retrieves the passages that actually mention it, those passages are validated before anything is written, and the answer is composed only from them with a page-and-clause citation on every claim — otherwise the system says it does not know.
Only PDF files are accepted. Each upload is stored privately, its bytes are checked, and page text is extracted. If a file has no readable text, ingestion fails loudly with the exact stage that broke instead of silently marking it as ready.
Checks: real PDF signature, page count > 0, extracted characters > 0.
2 — Structure-aware chunking
Text is split along headings and clause numbers rather than blindly every N characters, so a clause stays together with its title. Every chunk keeps its page number, clause number, clause title and document identity.
Long clauses are split with overlap so no sentence falls between two chunks.
3 — Indexing
Chunks are written to the database with a full-text search index. A document is only marked INDEXED when the chunk count and index count match what was extracted.
Invariant: chunk_count > 0 and every chunk is searchable.
4 — Hybrid retrieval
A question runs through keyword (BM25) search, literal phrase search and semantic term scoring at the same time, then the results are merged. Questions naming a clause pull that clause and its sub-clauses directly; questions about version, release or title use a separate front-matter path.
Clause queries down-rank unrelated sections; metadata queries read the first pages.
5 — Reranking & expansion
Merged candidates are re-scored by how well they actually cover the question's terms, headings get a bonus, duplicates are removed, and neighbouring sub-sections are pulled in so an answer spanning several sections stays complete.
Typically 12–19 passages survive to the evidence stage.
6 — Evidence validation (the abstention gate)
Before any text is generated, the system checks whether the retrieved passages genuinely address the question by measuring term coverage across all of them. If nothing supports the question, it stops here and returns INSUFFICIENT_EVIDENCE — a score alone never authorises an answer.
No evidence ⇒ no answer. This is what keeps hallucinations at zero.
7 — Grounded generation
Validated passages are handed to the model with their source labels. The model is instructed to answer only from those passages, cite every factual sentence, and never merge two documents without naming them. If it still cannot answer, it must say INSUFFICIENT_EVIDENCE.
Temperature is kept very low; outside knowledge is forbidden.
8 — Citations & audit trail
Each answer ships with evidence cards naming the PDF, page and clause. The question, decision, confidence, latency breakdown and evidence are all stored, so any answer can be replayed and audited later.
Answers are generated only from retrieved passages — never from the model's own memory.
If the retrieved passages don't cover the question, the system abstains instead of guessing.
Every factual sentence carries a citation to a page and clause you can open.
Two documents are never blended into one unattributed claim.
Selecting specific sources restricts retrieval to those sources only.
How the quality numbers are measured
The benchmark is built from your own indexed PDFs — real clauses become questions with a known correct source, and deliberately unrelated questions check that the system refuses them. Nothing is simulated.
Pass rate
Share of benchmark questions where the system did the right thing — answered when it should and abstained when it should.
Abstention accuracy
How often it correctly refused out-of-domain questions.
Hallucination rate
Answers that were unsupported by the evidence. The target is zero.
Faithfulness
How much of the produced answer is literally traceable to the retrieved passages.
Recall@K / Precision@K
Whether the right passage was retrieved, and how much of the retrieved set was on target.
MRR
How high the first correct passage ranked.
Rerank gain
How much the reranking step improved on raw keyword ranking.
Avg latency
End-to-end time from question to cited answer.
See it live
Open RAG Pipeline to watch these stages animate with real data from your own question, or Evaluation to run the benchmark and populate the dashboard metrics.