Retrieval before generation
One exchange at a time. Read what changes, then explain it in your own words before moving on.
- Meet the components
- Follow the steps
- Compare an example
- Check your understanding
Retrieval before generation
Track which documents enter the model’s context.
Only permitted evidence should enter model context.
How to use this example
Select Next step to read at your own pace, or Animate step to watch one exchange. Nothing advances until you choose.
What it means
Everyday example
State in this scenario
Inspect components & read every step
- User question
The request a person wants the system to answer.
Example: An employee asks about the leave policy.
- Access filter
A check that limits which information a user is permitted to retrieve.
Example: A staff member should not receive restricted payroll documents in search results.
- Document store
Storage containing documents the application may search.
Example: An approved handbook provides context for an answer.
- Model
An AI system that generates output from its input. Its answer can be wrong.
Example: It drafts an answer using the question and supplied context.
Authorized retrieval
Only permitted evidence should enter model context.
- User question Access filter: Question + identity. Bind retrieval to trusted user context.
- Access filter Document store: Allowed search. Search within the permitted corpus.
- Document store Model: Scoped context. Pass retrieved evidence alongside the task.
- Model User question: Answer + sources. The model responds; cited claims still need evaluation.
Restricted document
A model instruction cannot repair a document leak that already happened.
- User question Access filter: Question. Evaluate the caller’s document permissions.
- Document store Access filter: Restricted result. The candidate record fails access policy.
- Access filter Model: Permitted context only. Exclude the restricted text before generation.
- Model User question: Bounded answer. Respond using allowed evidence or state insufficient information.
Fictional teaching trace. One moving dot represents an exchange, not a measured network capture.