Mental model
Module 10: Build the evidence package the model actually sees- Select, order, deduplicate and budget retrieved evidence so the model receives useful context rather than a dump of search results.
Select, order, deduplicate and budget retrieved evidence so the model receives useful context rather than a dump of search results.
Engineering focus: Build the evidence package the model actually sees
Select, order, deduplicate and budget retrieved evidence so the model receives useful context rather than a dump of search results.
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.
The context window is a suitcase with a size limit. Pack the strongest, non-duplicate evidence first and keep labels so every claim can be traced back.
More context is not automatically better context.
Every token used for irrelevant evidence competes with instructions, user input and useful sources.
Chunk overlap and multi-retriever fusion can return near-duplicates. Repetition wastes context and may bias generation.
High-quality authoritative evidence should be easy for the model to use. Consider relevance, recency and source authority.
The context builder should maintain stable source/chunk identifiers so generated claims can be mapped back to evidence.
Module 10: Build the evidence package the model actually seesBudget: 2,000 tokens
Instructions 300
User question 80
Evidence A 500
Evidence B 420
Evidence C 350
Citation labels 80
Reserve 270
Duplicate evidence: rejectedThe model receives good evidence but still misses the key fact.
Context construction is its own engineering stage.
Goal: Assemble a bounded context packet from ranked chunks with deduplication and source IDs.
python3 - <<'PY2'
chunks=[('A','vpn reset requires MFA'),('A2','vpn reset requires MFA'),('B','contact support if token lost')]
seen=set(); out=[]
for cid,text in chunks:
key=text.lower().strip()
if key in seen: continue
seen.add(key); out.append({'chunk_id':cid,'text':text})
print(out)
PY2Record the intermediate source IDs, ranks, metadata or state produced by the baseline. Explain which pipeline layer this evidence belongs to.
Add duplicate and low-value chunks until your notional token budget is exceeded. Remove duplicates and rebuild the bounded context packet.
Context construction is its own engineering stage. 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.
Context token budget explicit
Duplicates controlled
Source labels preserved next to evidence
Irrelevant context raises cost and can distract the model.
To reduce wasted tokens and repeated evidence bias.
Stable source and chunk IDs.
Relevance plus factors such as authority, freshness and diversity.
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.