Source tracing
Trace retrieved chunks to their source document programmatically.
How source tracing works
When a file is ingested into a vector database, the system records the exact location of every chunk within the source document, including its position within the heading structure and, for page-based formats, its source page. When an agent retrieves a chunk using file search, this location information travels with the result, giving you a direct path from the agent’s response back to the original file.When to use source tracing
- Auditability – Verify that agent responses came directly from your uploaded documents
- Compliance – Produce document-level proof of origin for regulated environments
- Chain of custody – Follow a response from model output to the exact location in the source file