Version: 0.0.8 (stable)
agrag.ingestion.resolved_entities.write_matches_and_rebuild
write_matches_and_rebuild(decisions:list[MatchDecision], *, graph_store:GraphStore, schema:GraphSchema, members:list[Entity], pending_job_id:str | None = None, deferred:DeferredWrites | None = None, tracer:Tracer | None = None, vector_sync:VectorSync | None = None) -> RebuildResult
Persist matches and rebuild their supplied connected component.
Callers fetch the bounded affected component before invoking this function. The resolved node is always recomputed from that current membership.
Outside a job, the matches and the resolved entity are written in one transaction. For a job's writes they are written in two transactions, and the summary of the resolved entity runs between them, so a slow summary does not hold the job's lock.
Parameters:
- decisions (
list[MatchDecision]) – The confirmed matches to persist. - graph_store (
GraphStore) – Where matches and resolved entities are written. - schema (
GraphSchema) – The schema the members belong to. - members (
list[Entity]) – The component members the resolved node is computed from. - pending_job_id (
str | None) – The in-flight Cutover Job's id, tagging the match edges and resolved entity nodes until that job commits. None writes untagged, for callers outside a job. - deferred (
DeferredWrites | None) – Receives the writes over committed rows, such as a match edge that already exists. Required whenpending_job_idis set. - tracer (
Tracer | None) – Passed to description summarization. - vector_sync (
VectorSync | None) – Removes stale resolved-entity vectors when set.
Raises:
ValueError– No decisions are supplied, a decision references a member outside the supplied component, orpending_job_idis set anddeferredis None.GraphStoreFenceError– The job no longer holds a live lease. Raised under every error policy.ResolvedEntityWriteError– A job's matches were written but its resolved entity was not. The caller must fail the job.