agrag.ingestion.merge
Merge mechanics: how a resolved group of mentions and entities combine.
This module is storage-agnostic. It decides what a merge must look like, but it never touches GraphStore itself. Applying a computed MergePlan is a separate step.
Classes:
- ConflictRecord – One property that had more than one candidate value.
- MergePlan – Computed result of merging zero or more entities and mentions.
- PropertyRules – Per-property conflict resolution, with a default for unlisted properties.
- PropertyStrategy – Fallback rule for a property with no entry in PropertyRules.
Functions:
- apply_merge – Write a computed MergePlan to storage.
- compute_merge – Compute how existing_entities and mentions combine into one Entity.
- mentioned_in_id – Return the deterministic id for a new Chunk MENTIONED_IN Entity edge.
- merge_properties – Return field-resolved properties and records of every real conflict.
- next_chunk_id – Return the deterministic id for a Chunk -[:NEXT_CHUNK]-> Chunk edge.
- part_of_id – Return the id for one versioned Document -[:PART_OF]-> Chunk edge.
- relation_id – Return the deterministic id for a domain relationship triple.
- resolve_description – Resolve a description field, trying LLM summarization.
- select_canonical – Return the canonical entity and the rest, from two or more entities.
Attributes:
- PropertyRule – Per-property conflict resolver.