A reindex changes chunk identifiers without mapping
Detect: Downstream answers lose resolvable evidence references.
Recover: Preserve versioned mappings or retain the referenced chunk artifacts.
Track how source data becomes chunks, embeddings, prompts, model outputs, and decisions so changes and incidents can be traced to their affected artifacts.
Data lineage records relationships between inputs, transformations, execution runs, and outputs. For agent systems, useful lineage extends beyond ETL tables to document versions, chunks, embeddings, retrieval sets, prompts, model configurations, tool observations, and published artifacts. Trace spans describe execution timing; lineage explains derivation and dependency.
Choose stable identifiers and appropriate granularity. A document-level link may be enough for discovery but insufficient to explain which passage supported a claim. Store references and transformation metadata rather than duplicating sensitive content in the lineage catalog. Lineage supports investigation and impact analysis; it does not prove that a transformation was correct.
A prototype can retain source identifiers and model versions beside generated outputs. Add transformation identities before rebuilding indexes or changing chunking logic.
Production emits lineage events for ingestion and generation, preserves source versions, and links outputs to retrieval evidence and configuration. Handle deletions and revoked access across derived artifacts.
At scale, lineage becomes a graph supporting impact queries and selective reprocessing. Avoid unbounded event cardinality by choosing meaningful artifact boundaries and retention policies.
Assigns stable names and versions to sources, chunks, embeddings, and generated outputs.
Captures job, run, code, configuration, and input-output relationships.
Stores derivation edges and supports upstream and downstream impact queries.
Connects answers to retrieved passages, tool results, and model configuration.
Uses lineage to identify artifacts requiring invalidation, deletion, or recomputation.
flowchart LR
S["Source document version"] --> P["Parser run"]
P --> C["Chunk versions"]
C --> E["Embedding run"]
E --> I["Index snapshot"]
I --> R["Retrieved evidence set"]
R --> G["Generation run"]
M["Model and prompt versions"] --> G
G --> A["Published answer"]
S --> L["Lineage catalog"]
G --> LRecord the authoritative object, revision, ownership, and relevant access metadata.
Emit input-output relationships for parsing, chunking, embedding, and indexing runs.
Associate the generation run with the actual evidence used, not every possible source.
Store model and prompt versions with the published artifact and claim evidence references.
Traverse dependencies when a source, policy, or transformation changes.
Rebuild or invalidate affected artifacts and record the corrective transformation history.
Pharmaceutical manufacturing · Illustrative enterprise scenario, not a reported customer outcome.
A manufacturing support assistant answers questions about approved equipment procedures across several facilities.
When a procedure revision is withdrawn, the team cannot identify which indexed chunks and generated guidance used it.
The assistant must support source-version traceability and targeted invalidation of affected content.
Ingestion records document, parser, chunk, and embedding versions; generation records the retrieved evidence set and output artifact.
If a pipeline omits lineage events, its outputs remain quarantined from the controlled corpus until provenance is repaired.
Measure lineage completeness, impact-query coverage, stale-artifact removal time, and reproducibility of sampled answers. Traceability does not replace procedure approval.
| Decision | Benefit | Cost |
|---|---|---|
| Fine-grained lineage | Precise impact analysis reduces unnecessary reprocessing. | Metadata volume and identifier management increase. |
| Event-based collection | Independent pipelines can publish derivation facts. | Missing or delayed events can leave temporary gaps. |
| Content references | Sensitive payload duplication is reduced. | Investigations depend on continued access to referenced artifacts. |
Detect: Downstream answers lose resolvable evidence references.
Recover: Preserve versioned mappings or retain the referenced chunk artifacts.
Detect: Impact analysis finds live descendants.
Recover: Propagate approved deletion or invalidation through the lineage graph.
Record durable input-output relationships and source versions.
Capture the actual retrieved and used evidence set.
Include chunking, embedding, prompt, and model versions.