Skip to main content

agrag.ingestion.merge.MergePlan

Bases: BaseModel

Computed result of merging zero or more entities and mentions.

Attributes:

  • survivor (Entity) – The resulting Entity. Its merge_count and source_chunk_ids are this call's best local computation, for reporting. apply_merge writes new_source_chunk_ids and merge_count_delta atomically instead, so a concurrent writer's own contribution to the same node is never overwritten.
  • conflicts (list[ConflictRecord]) – Every field that had more than one candidate value.
  • accepted_merge_keys (list[str]) – Every normalized merge_key this merge accepted, from existing_entities and mentions alike, not only the survivor's own chosen name. A later mention of any accepted name resolves back to this entity instead of creating a duplicate.
  • new_source_chunk_ids (list[UUID]) – The chunk ids this call's mentions contribute, applied as an atomic union against whatever the survivor's node currently has.
  • merge_count_delta (int) – The amount to atomically add to whatever merge_count the survivor's node currently has.

accepted_merge_keys​

accepted_merge_keys: list[str] = []

conflicts​

conflicts: list[ConflictRecord] = []

merge_count_delta​

merge_count_delta: int = 0

new_source_chunk_ids​

new_source_chunk_ids: list[UUID] = []

survivor​

survivor: Entity