Prompt
How do I see which docs the model pulled from?
Latest observation
Nov 15, 2026
OpenAI APIWeb search: off
If you’re using a retrieval-enabled setup, the exact way to see source docs depends on the product/framework, but the general options are:
-
Inspect retrieval results before generation
- Log the documents returned by your retriever / vector search.
- This is the most reliable way to see what the model had available.
-
Ask the model to cite sources
- If your system supports it, enable citations or return document IDs/titles alongside the answer.
- Many RAG systems can be configured to include
source,chunk_id, ormetadata.
-
Check debug / trace logs
- Frameworks often expose retrieval traces showing:
- query
- retrieved doc IDs
- similarity scores
- selected chunks
- Examples:
- LangChain: callbacks / tracing tools
- LlamaIndex: response sources / source nodes
- OpenAI Assistants / file search-style tools: run traces / tool outputs, if exposed by the platform
- Frameworks often expose retrieval traces showing:
-
Return sources in the API response
- If you control the app, modify the response object to include the docs/chunks used.
- Example shape:
{ "answer": "...", "sources": [ {"title": "Doc A", "chunk": "...", "score": 0.82}, {"title": "Doc B", "chunk": "...", "score": 0.79} ] }
-
If you only have the final answer
- The model usually does not know exactly which docs were pulled unless your app passes that info through.
- You’ll need retrieval logging or citation support to verify it.
If you tell me what stack you’re using (e.g. OpenAI API, LangChain, LlamaIndex, Azure AI Search, Pinecone, etc.), I can give you the exact steps or code.