Skip to main content

Overview

Graph lineage records how every meaningful change to the knowledge graph was made — which document, data source, enrichment rule, or manual review produced each property update or relationship. Each change is stored as a :LineageRecord node in the graph, linked to the affected entity via :HAS_LINEAGE. Lineage is additive: legacy source lists on nodes continue to work during rollout. Lineage is not included in routine AI context or graph visualizations. It is available on demand in the graph explorer, Provenance tab, and read API.

What gets recorded

Each record includes:
  • Operation — node_created, node_updated, node_seen, node_deleted, relationship_created, relationship_updated, relationship_seen, relationship_deleted, ingest_completed
  • Changes — property-level {property, old, new} transitions
  • Source metadata — path, data source name, rule name, job id
  • Model — LLM model name when applicable (ingestion, enrichment)
  • Reviewer — email address for manual match-review actions
  • Timestamp — when the write occurred
Document-sourced records may link to the :Document node via :DERIVED_FROM for one-click file access. node_seen and relationship_seen mean this run matched an existing row or edge and no mapped property changed. ingest_completed is the parsed-text hash stored only after a document ingest finishes. A full structured scan can delete rows it did not touch, and an enrichment overwrite can delete a node or relationship this rule alone owns. Those deletes are not written as lineage.

Viewing lineage in the UI

Graph explorer (provenance)

When exploring entities cited in chat:
  1. Open Explore Graph from the Provenance or Graph Context tab of a response
  2. Select an entity node
  3. Scroll to the Graph Lineage section in the inspector
The timeline shows operations newest-first, with source links, model name, reviewer (if manual), and property changes. Relationship operations show type and from → to endpoints.

Provenance and Graph Context tabs

In the Provenance tab, click a node under a source document to open the graph explorer focused on that node, then use its Graph Lineage section. Graph Context offers Explore Graph and lists the retrieved relationships; click a name to open the explorer focused on that node.

Chat — asking about origin

Assistants can call the get_entity_lineage tool when you ask where a fact came from (e.g. “How do we know this company’s revenue?”). Lineage is never injected proactively into every response.

Enrichment jobs and Postgres audit

Enrichment rules write graph lineage for each successful apply. The Django EnrichmentResult row also stores an optional lineage_record_id linking to the graph record for admin cross-reference. See Enrichment Rules for running jobs; open a job’s results to see which nodes were updated and the linked lineage id when present.

Read API

Authenticated REST endpoints (prefix /api/graph-lineage/): Relationship lineage appears when querying either endpoint node (from_id / to_id matching). On FalkorDB the element_id is the node’s whole-number id written as text. FalkorDB reuses the ids of deleted nodes, so see Node ids on FalkorDB before you keep one.

Matched document entities

When document ingestion matches an existing node and only adds the file to source (no new attributes), a node-level lineage record is not created. Relationship lineage from the same ingest still records links to related entities (e.g. Contract → Company).

Facts a file no longer supports

A later ingest of the same file records node_deleted for a Create Only node the new extract omits, and relationship_deleted for an extracted relationship or a MENTIONED_IN link that was removed. The record hangs off a node that survives the delete, so the history remains after the old node is gone. A Create or Match or Match Only node is kept. An unchanged attached node stays, with no new history row.

Limitations (v1)

  • No automatic backfill for data ingested before lineage shipped
  • Legacy client UI does not include lineage; use the current admin/chat UI (client-cn)
  • Deprecation of n.source in favor of lineage-only provenance is a follow-up ticket