diff --git a/graphiti_core/prompts/dedupe_edges.py b/graphiti_core/prompts/dedupe_edges.py index b60dd1b9..49743fcd 100644 --- a/graphiti_core/prompts/dedupe_edges.py +++ b/graphiti_core/prompts/dedupe_edges.py @@ -25,11 +25,11 @@ from .prompt_helpers import to_prompt_json class EdgeDuplicate(BaseModel): duplicate_facts: list[int] = Field( ..., - description='List of ids of any duplicate facts. If no duplicate facts are found, default to empty list.', + description='List of idx values of any duplicate facts. If no duplicate facts are found, default to empty list.', ) contradicted_facts: list[int] = Field( ..., - description='List of ids of facts that should be invalidated. If no facts should be invalidated, the list should be empty.', + description='List of idx values of facts that should be invalidated. If no facts should be invalidated, the list should be empty.', ) fact_type: str = Field(..., description='One of the provided fact types or DEFAULT') diff --git a/graphiti_core/utils/maintenance/edge_operations.py b/graphiti_core/utils/maintenance/edge_operations.py index 5637e1c3..fccbbbfd 100644 --- a/graphiti_core/utils/maintenance/edge_operations.py +++ b/graphiti_core/utils/maintenance/edge_operations.py @@ -506,13 +506,14 @@ async def resolve_extracted_edge( 'ensure_ascii': ensure_ascii, } - logger.debug( - 'Resolving edge: sent %d EXISTING FACTS (idx 0-%d) and %d INVALIDATION CANDIDATES (idx 0-%d)', - len(related_edges), - len(related_edges) - 1, - len(existing_edges), - len(existing_edges) - 1, - ) + if related_edges or existing_edges: + logger.debug( + 'Resolving edge: sent %d EXISTING FACTS%s and %d INVALIDATION CANDIDATES%s', + len(related_edges), + f' (idx 0-{len(related_edges) - 1})' if related_edges else '', + len(existing_edges), + f' (idx 0-{len(existing_edges) - 1})' if existing_edges else '', + ) llm_response = await llm_client.generate_response( prompt_library.dedupe_edges.resolve_edge(context),