Understand first
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Understand → Implement → Debug → Design
Hold query, scope and effective time fixed; compare candidates, selected material and exact serialized context.
Knowledge content check2026-10-11 · Check the source of the original question2026-10-11
It is recommended to understand first:
Context and generation budgets →Tool contracts: from a valid request to an authorized business effect →Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.
New to this knowledge point
Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.
Start with core principles →Prepare to write the principles into code
Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.
View the code example →Need to handle failures and changes in conditions
Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.
Continue to delve deeper into the problem →Need to design or review plans
Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.
Analyze engineering scenarios →LEARN · PRACTICE · REFLECT
First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.
Can be practiced directly. After logging in, answers, favorites, and notes will be saved to your account.
Log in and saveEach modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.
Core concept · Stage-local evidence loss determines the repair
Preparatory concepts:Chunk provenance and valid time, Candidate rankings and context budgets, Claim-to-source support
Inspect the first missing required condition in the evidence flow before changing an earlier or unrelated mechanism.
Trace the required clause by ID through every stage. If complete evidence reaches context, investigate generation instead of only raising top-k. Select the figure to open it at full size.
A candidate list can contain the right material while the actual model context does not. Each pipeline stage therefore needs observable IDs and enough protected provenance to reproduce applicability and assembly. Once full evidence is in context, a wrong claim has a different cause and needs generation/support review.
The complete base-plus-exception bundle reverses the opened-battery conclusion. This causal counterexample makes the stage boundary visible and avoids equating a citation link with support. See the RAG evidence course and the existing RAG pipeline.
Attach tenant, group, version and valid interval to base and exception clauses.
Filter applicable authorized IDs before rank fusion.
Fuse two authored rank lists; retain stage IDs.
Expand authorized same-version clauses and preserve the complete bundle or abstain.
Check context membership and bounded claim conditions; arbitrary prose remains not_scored.
This deep-dive uses authored rankings. The linked existing RAG pipeline retains its separately recorded real local embedding provenance.
Trace evidence IDs from applicable authorized corpus through candidate rankings, selection, expansion and actual context to each claim. Diagnose the first stage that loses the required clause. If complete applicable evidence reaches the model but the claim contradicts it, investigate generation/support checking. Increasing top-k cannot repair every later loss.
The authored opened-battery question requires the current base and battery exception. At time150, authorized IDs are returns-v2-base and returns-v2-exception. In the broken assembly both are in fused_ids, but include_exception=False leaves only the base in assembled_ids. The wrong eligible=True candidate receives missing_required_evidence.
Walk from corpus existence/applicability to candidates, rankings, selection, expansion and exact context. The earliest absence here is assembly after seed selection. Repair same-policy/same-version authorized expansion and preserve the complete 163-character bundle. At budget300 the complete context supports eligible=False; at budget100 the lab abstains. With both citations but eligible=True, the verifier returns claim_contradicted, a different failure.
The ranking lists are authored fixtures. The code applies RRF to positions and records each stage; it does not infer real embedding quality. The existing RAG pipeline course retains actual local embedding provenance. Do not add lexical and vector raw scores without a justified calibration; RRF also does not produce an answer-correctness probability.
For an actual model integration, record exact authorized serialized context, prompt/model/index versions and the claim/source mapping. Keep labels and required evidence in the evaluator. Trace logs themselves are protected data and must not leak forbidden documents.
Python 3.9+, standard library. Extract /lab/deep-dive/agent-core-deep-dive-v1.zip and run this snippet beside rag_evidence_deep_dive.py; /lab/deep-dive/rag_evidence_deep_dive.py is also available. Authored fixtures only; not a live model or external service.
from rag_evidence_deep_dive import assemble, candidate, verify_claims
bad = assemble(include_exception=False)
assert 'returns-v2-exception' in bad['fused_ids']
assert verify_claims(candidate(True,['returns-v2-base']),bad)['reason'] == 'missing_required_evidence'
fixed = assemble()
assert verify_claims(candidate(),fixed)['accepted']
print(fixed['required_chars'],verify_claims(candidate(True),fixed)['reason'])
expected output
163 claim_contradictedContinue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.
Level 1The exception is in top-20 candidates but not in the actual prompt. What evidence distinguishes ranking from assembly?
Adds visibility between candidate existence and model input.
Save reranked/selected IDs and exact serialized context under the same query/scope/time/version. Missing after ranking but before selection suggests selection/rerank; selected but absent in context suggests assembly/serialization/budget. The demo locates the exception in fused_ids and loses it at assembly after top1 seed selection.
Follow this answer further
Level 2The selected chunk is top-five, but its exception sentence is still absent in context. What changes the diagnosis?
Keeps the ID while removing a condition inside the chunk.
The ID survived selection, so inspect field projection, serialization, truncation and compressed text. A chunk ID alone is insufficient: compare actual source spans and their serialized conditions. Repair the lost text, then re-run a claim that depends on that exception.
Follow this answer further
Level 3A summary retains the rule but simplifies away unless defective. How can you validate compression?
Replaces raw evidence with a lossy transformation.
Annotate required conditions and source spans, then test both opened/non-defective and opened/defective facts. A faithful compression must preserve the opposite outcomes and trace each condition to source. Semantic fluency or shorter length is not enough; abstain or retain the original span when the condition cannot be verified.
Level 1Why not directly add lexical and vector raw scores?
Changes retrieval from one score system to two incompatible scales.
Their scales and meanings differ. Calibrate on labeled data or fuse ordinal ranks with an explicit rule such as RRF. RRF sums 1/(60+rank) in this lab; it ranks evidence and does not establish claim support or calibrated correctness.
Level 1Why can a larger top-k worsen the answer?
Increases evidence volume under a fixed context budget.
More candidates can add expired, conflicting or irrelevant material and consume context so necessary conditions are displaced. First enforce authorization/applicability and inspect selected/serialized evidence. Evaluate sufficiency and unsupported claims, not candidate count alone.
First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.
Changing conditions:A single-clause query becomes a multi-document eligibility decision.
Extended question:What changes in retrieval and acceptance?
Annotate a required evidence set and relationships, retain version/applicability coherence and inspect the assembled bundle. Top1 hit rate no longer captures sufficiency. Partial support can answer supported subclaims but must not approve an action whose material condition is missing.
The principles that remain unchanged:The delivered claim must preserve every necessary authorized condition.
Changing conditions:The same query has fewer allowed documents after permission change.
Extended question:Should the system widen globally to recover its previous recall?
No. Restrict candidates and expansion to the current scope, invalidate affected caches and report missing support. The coverage denominator and authorization generation changed; comparison must record that context rather than leaking documents to recover a score.
The principles that remain unchanged:Recall improvement cannot override access policy or evidence applicability.
Official mechanisms were checked on 2026-10-11. Examples and schedules are authored; local Python/SQLite outputs are actually executed. No enterprise incident, live model accuracy or production reliability is asserted. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.
After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.
View verification records for independent examples
Run rag_evidence_deep_dive.py and RagTests. Save the missing-exception, budget100 and cited-wrong-claim traces. Build a first-loss diagnosis and rerun the repaired assembly.