Version: 0.0.7
agrag.ingestion.resolve.resolution.resolve_batch
resolve_batch(mentions:list[ExtractedEntity], relations:Sequence[ExtractedRelation], chunks_by_id:dict[UUID, Chunk], *, graph_store:GraphStore, embedder:Embedder, entity_labels:Sequence[str], tracer:Tracer | None, max_llm_pairs:int, error_policy:ErrorPolicy, vector_store:VectorStore | None = None, job_id:UUID | str | None = None, llm_concurrency:int = DEFAULT_LLM_CONCURRENCY, on_progress:Callable[[int, int, float], None] | None = None) -> BatchResolution
Resolve one extraction batch against itself and the persisted graph.
The resolver sees the real mentions plus one synthetic mention per persisted ANN candidate, so a new mention can join a persisted cluster through one pass. Synthetic mentions never initiate a comparison.
Parameters:
- mentions (
list[ExtractedEntity]) – The batch's extracted mentions. - relations (
Sequence[ExtractedRelation]) – The relations addressingmentions, used as neighbor context. - chunks_by_id (
dict[UUID, Chunk]) – The batch's chunks, for LLM verification context. - graph_store (
GraphStore) – Where exact-match, candidate, and neighbor reads run. - embedder (
Embedder) – Embeds mention text for candidate search and fuzzy review. - vector_store (
VectorStore | None) – External dense candidate index. None uses graph indexes. - entity_labels (
Sequence[str]) – The labels the schema defines. - tracer (
Tracer | None) – Opens the phase spans and traces the resolver. - max_llm_pairs (
int) – The most ambiguous pairs per label sent to the LLM. - llm_concurrency (
int) – Maximum simultaneous verification requests. - on_progress (
Callable\[[int, int, float], None] | None) – Receives completed batches, total batches and elapsed seconds. - error_policy (
ErrorPolicy) – RAISE propagates candidate-read failures. Other policies record candidate-read failures and leave those mentions unresolved. Telemetry reads never change the result. - job_id (
UUID | str | None) – The in-flight Cutover Job's id for the exact-match read.
Returns:
BatchResolution– The exact matches, exact groups, resolver result, persistedBatchResolution– candidates, and candidate-read failures.
Raises:
Exception– A candidate read failed anderror_policyis RAISE.