Mental model
Module 09: Improve what reaches the model- Use candidate generation, reranking, query rewriting and decomposition to improve evidence quality without hiding the original question.
Use candidate generation, reranking, query rewriting and decomposition to improve evidence quality without hiding the original question.
Engineering focus: Improve what reaches the model
Use candidate generation, reranking, query rewriting and decomposition to improve evidence quality without hiding the original question.
You are not expected to know the engineering vocabulary before using the idea. Formal terminology comes after the mental model.
Carry one evidence-grounded knowledge assistant through all 18 modules. Preserve source IDs, retrieval evidence, evaluation cases, authority decisions and security assumptions so every improvement is measurable.
First-stage retrieval casts a wide net; reranking spends more compute on a smaller set. Query rewriting can help search, but the original user intent remains authoritative.
Never let a rewrite silently become a different user request.
A fast first-stage retriever can collect candidates; a stronger reranker can score them with more context.
Rewrite ambiguous or conversational queries into search-friendly form, but keep the original request for final answer generation and audit.
Questions requiring evidence from multiple sources may need separate retrieval steps.
They improve relevance ordering; metadata, provenance and policy still determine whether a source is allowed and authoritative.
Module 09: Improve what reaches the modeloriginal query
↓
retrieve top 20
↓
rerank with query + full candidate text
↓
keep top 5
↓
authority/context policy
↓
send 2–3 chunks to modelRetrieved candidates are relevant, but the final evidence set is poor.
Preserve intent and trace every transformation.
Goal: Rerank a candidate list using simple rule-based evidence features and preserve original query text.
python3 - <<'PY2'
q='How do I reset VPN access?'
c=[('old',1,False),('vpn-current',2,True),('generic',1,True)]
ranked=sorted(c,key=lambda x:(x[2],x[1]),reverse=True)
print({'original_query':q,'ranked':ranked})
PY2Record the intermediate source IDs, ranks, metadata or state produced by the baseline. Explain which pipeline layer this evidence belongs to.
Write a bad rewrite that changes 'reset VPN access' into 'disable VPN access'. Compare it to the original and mark the rewrite invalid.
Preserve intent and trace every transformation. State the failing layer, change only that layer, then repeat the verification checks.
Record: hypothesis → evidence → change → observed result → remaining limitation. Keep this note with the running Evidence Desk project.
Production RAG improves when every change can be traced to evidence at a specific pipeline layer. In production, retain the before/after evidence so the same failure can become a regression test.
Original query preserved
Rerank before/after trace retained
Rewrite/decomposition intent tests pass
Re-scoring an initial candidate set with a stronger relevance model or features.
For intent fidelity, audit and final answer construction.
When a question needs evidence from multiple subproblems or sources.
No. Relevance and authority are different dimensions.
Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.
Attempt the core lab and knowledge checks before marking the module complete.