RAG Formation · Reference
Query handling and reranking
A standalone cheat sheet for learning and testing RAG quality on this site.
$ reference --status
▸ course RAG Formation
▸ mode standalone reference
▸ status Complete
● learn → test → verifyReference sheet
Query handling and reranking
The guided RAG Formation course content is complete; this reference is available for self-directed practice.
One-line rule
A larger top-k can hide a retrieval failure by adding noise; it does not diagnose the problem.
Core terms
| Term | Meaning |
|---|---|
| Query normalization | Turning a user’s question into useful search forms: the original question, extracted document IDs, normalized acronyms, or translated terms. The one technique here you can actually test live. |
| Reranking | A real service exists (aperag/llm/rerank/rerank_service.py) with a documented fallback policy — graph results prioritized first — but nothing in the live /api/v1/search//api/v1/qa path calls it. Retrieval today is a rough first pass with no reordering step, full stop. |
| Deduplication | Also more limited than it sounds: dedup today only applies to the citations list, matched by filename. The chunk text actually placed in the LLM's prompt is never deduplicated. |
Evidence card
| Need | Record | Don't claim |
|---|---|---|
| Baseline | Command, configuration, observed result | The baseline is a target. |
| Change | One hypothesis or decision | You can tell what caused the result when several things changed. |
| Metric | Record the expected source, baseline hit state, one changed query form, and the same metric after the change. | One metric tells you everything about quality. |
| Safety | A failure and a regression case | A fluent answer proves the system is reliable. |
Local command
cd demo
python3 eval.py run --mode retrieval --workspace meridian_demo --category reference_lookup --tag lesson-08-baselineArtifact: A retrieval experiment card that can prove or disprove a hypothesis, with a metric, baseline, regression check, and stop condition.
Continue learning: Open the matching standalone lesson · Course roadmap