RAG Formation · Reference
Context assembly and evidence budgets
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
Context assembly and evidence budgets
The guided RAG Formation course content is complete; this reference is available for self-directed practice.
One-line rule
A retrieved source is not useful evidence if truncation removes it before the model sees it.
Core terms
| Term | Meaning |
|---|---|
| Context assembly | Turning backend results into the text sent to the answering model — across four channels (summary/vector/fulltext/graph), each given a fair share of the budget by a max-min allocation algorithm. |
| Evidence budget | The maximum context allowed by characters, tokens, latency, or cost. |
| Source survival | Whether the evidence needed for an answer is still present after formatting and truncation. Channel order is fixed (summary→vector→fulltext→graph) — budget fairness, not relevance ranking, decides how much of each survives. |
| Not the same path as Lessons 5–8 | --mode retrieval hits /api/v1/search (no fusion). --mode answer hits /api/v1/qa (real per-channel allocation) — this lesson uses the latter. |
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 | Per question: answer.stats.context_chars_by_index, .context_items_included/.context_items_dropped, .context_hard_truncated, answer.sources and .source_hit.all. For multi-hop, check context_chars_by_index.graph first. | 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 answer --workspace meridian_demo --category multi_hop --tag lesson-09-contextArtifact: An evidence-survival map for one multi-hop answer, plus a bounded context-budget recommendation.
Continue learning: Open the matching standalone lesson · Course roadmap