Chapter 2 of 10
Source units, extraction, and claim lineage
Index foundations
About 4 minutes · includes examples, an exercise, and references
Chapter at a glance
- •Chunking must preserve citation, structure, and the qualifiers needed to interpret claims.
- •Extract mentions before resolving canonical entity identity.
- •Validate typed output and source offsets before constructing graph edges.
GraphRAG quality is bounded by its source units. A source unit is a stable, citable span of an input document with enough surrounding structure to interpret it. Units that are too large waste context and mix unrelated claims; units that are too small lose definitions, subjects, negation, tables, and temporal qualifiers. Chunking is therefore a semantic and evaluation decision, not merely a character count.
Capture document hierarchy before chunking: title, section path, page, table coordinates, list nesting, speaker, timestamps, and access classification. Use deterministic unit identifiers derived from document version and offsets or a stored idempotency key. Overlap can preserve boundary context, but it also duplicates claims and distorts frequency. Record parent document and neighboring units rather than relying on large overlap to restore all structure.
Entity extraction proposes mentions, types, and normalized names. Relationship extraction proposes typed links with direction and participating mentions. Claim extraction should retain polarity, modality, time, scope, and attribution. “The audit found no evidence that Vendor A accessed records” must not become Vendor A—accessed→records. “Team B may migrate Service C next quarter” is neither a completed migration nor a firm date. Extraction schemas need explicit unknown and not-applicable states.
Use typed structured output and validate it before graph construction. Every entity mention should point to source offsets. Every relationship should cite supporting spans for both endpoints and relation language. Every claim should carry extractor model, prompt or rule version, run identifier, confidence method, and validation outcome. Reject output that references nonexistent offsets or unsupported enumerated types. Do not repair invalid JSON by guessing consequential fields.
Separate mention extraction from entity resolution. A mention “Mercury” in two units does not prove one entity. Create mention nodes or records first, then resolve them with local context, document metadata, known identifiers, and graph constraints. This lets a later resolution fix reconnect claims without re-extracting the source text and avoids baking ambiguous identity into embeddings and communities.
Relationships need an ontology small enough to extract consistently. An unconstrained “related_to” edge creates dense but uninformative graphs. An excessively detailed schema forces the model to hallucinate distinctions. Begin with relations that support query plans and evaluation. Provide definitions, positive and counterexamples, directionality, and allowed endpoint types. Map extractor labels to the governed ontology through a versioned layer rather than letting prompts define permanent vocabulary.
Use multiple passes only for measured needs. A first pass may identify candidate entities; a second can extract relations using those candidates; a verifier can check each proposal against its span. Self-consistency can raise cost without producing independent evidence because the same model and prompt share errors. Human review should sample high-impact, low-confidence, novel-type, and disagreement cases.
Tables, figures, code, and scanned pages require specialized processing. A table cell needs row and column headers. An OCR fragment needs page coordinates and confidence. A diagram relation inferred from layout should be labeled as generated from a visual parse. When a representation cannot preserve enough evidence, retain it for a separate multimodal path rather than inventing a clean text claim.
Evaluate extraction per field and per consequence. Entity mention precision and recall, type accuracy, relation endpoint accuracy, direction, temporal qualifier accuracy, negation, and evidence-span overlap reveal different failures. Slice by document type, language, length, tables, and entity frequency. Also measure graph-level effects: orphan rate, generic-edge rate, degree explosions, duplicate claims, and unsupported edges.
Lineage is the invariant. A graph edge should lead to a validated extraction record, exact source unit, immutable document version, and authorized original artifact. Community reports and final answers should preserve that chain. If one stage cannot emit lineage, its artifact should not support a consequential answer.
Key points
- Chunking must preserve citation, structure, and the qualifiers needed to interpret claims.
- Extract mentions before resolving canonical entity identity.
- Validate typed output and source offsets before constructing graph edges.
- Measure extraction fields and downstream graph distortion separately.
A validation-ready extraction envelope
Read the expected behavior in the surrounding walkthrough, then copy and run this reference implementation.
{
"sourceUnitId": "doc-17:v3:chars-880-1240",
"entities": [
{"mentionId": "m1", "text": "Atlas", "type": "Project", "start": 912, "end": 917}
],
"claims": [
{
"subjectMention": "m1",
"predicate": "has_status",
"object": {"literal": "paused"},
"polarity": "affirmed",
"validTime": "2025-02",
"evidence": [{"start": 900, "end": 950}]
}
],
"extractor": {"model": "extractor-a", "schema": "claim-2.1", "run": "run-991"}
}Worked examples
Toy
Negation preserved
A sentence says a device did not cause the outage.
The extraction represents a negated causal claim with its exact span. It does not add a positive caused edge. Retrieval may surface the statement when users ask about ruled-out causes.
- Polarity
- Claim versus graph edge
- Span support
Application
Policy table extraction
A table maps data classes and regions to retention periods.
Each cell claim carries row and column headers, table identity, page coordinates, and document version. Validation checks allowed duration units and regions before publication.
- Header context
- Datatype validation
- Cell-level citation
Exercise
Create and score an extraction schema
Annotate twenty source units containing ambiguity, negation, time, and one table.
- Define entity and relation types from query needs.
- Require offsets and typed qualifiers.
- Validate outputs structurally.
- Report field metrics and graph-level anomalies.
Success criteria
- Every claim maps to exact source evidence.
- Ambiguous mentions remain unresolved.
- Negation and modality cannot become positive edges.
- Errors are sliced by source format and consequence.
Reflect: Which attractive extraction field has no reliable evidence or downstream use?
References and further reading
- Microsoft GraphRAG Indexing OverviewOfficial documentation for extraction of entities, relationships, claims, communities, reports, text units, and embeddings.
- Microsoft GraphRAG Index OutputsOfficial schemas and descriptions for GraphRAG documents, text units, entities, relationships, communities, and reports.
- PROV-O: The PROV OntologyThe W3C Recommendation for representing entities, activities, agents, derivations, and attribution.