Overview
How might we design retrieval context preview so people can trust and act on AI output?
When this pattern fits
- Essential for research assistants, enterprise knowledge bots, and any RAG product where users need to verify corpus coverage before trusting a synthesized answer.
When to skip or lighten it
- Closed chatbots with no retrieval step.
- Latency-critical voice turns where preview would block the reply.
- Consumer toys where source inspection adds complexity without trust value.
States
State model coming soon
Key UX elements
Key UX elements coming soon
Anti-patterns to avoid
Citing sources that were never shown in the retrieval set.
Preview panels that dump raw embeddings with no readable titles.
No way to remove a bad chunk that is poisoning the answer.
Showing previews only after the answer, when exclusion is useless.
How products use it
| Product | Implementation |
|---|---|
| Perplexity | Sources and research steps visible beside the answer. |
| Glean | Enterprise results with document previews under ACL. |
| Notion AI | References to workspace pages used for grounded answers. |
| ChatGPT | File and connector context surfaced for grounded replies. |
Implementation
Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.
Generate a production-ready implementation of the "Retrieval Context Preview" AI interface design pattern.
Pattern Definition:Frequently asked questions
What is retrieval context preview?
It is a UI that lists the retrieved docs or chunks the model will use, so users can verify grounding before trusting or acting on the answer.
Should preview appear before generate or after?
Before is best when users must exclude sources. After is acceptable for search-style products if citations stay inspectable.
How does this differ from citations?
Citations attach evidence to claims in the answer. Retrieval preview shows the candidate context set, including items that may not be cited.
What can users do from the preview?
Open the source, exclude it, pin it, or request regenerate without it. Read-only lists are weaker than actionable previews.