From 7cf5ee6288038e2cca946358832d32be47d33206 Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:23:37 -0700 Subject: [PATCH] Skip entity attribute extraction when no fields defined (#924) --- graphiti_core/utils/maintenance/node_operations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/graphiti_core/utils/maintenance/node_operations.py b/graphiti_core/utils/maintenance/node_operations.py index f17706ab..55e79b9c 100644 --- a/graphiti_core/utils/maintenance/node_operations.py +++ b/graphiti_core/utils/maintenance/node_operations.py @@ -362,6 +362,10 @@ async def extract_attributes_from_node( 'ensure_ascii': ensure_ascii, } + has_entity_attributes: bool = bool( + entity_type is not None and len(entity_type.model_fields) != 0 + ) + llm_response = ( ( await llm_client.generate_response( @@ -370,7 +374,7 @@ async def extract_attributes_from_node( model_size=ModelSize.small, ) ) - if entity_type is not None + if has_entity_attributes else {} ) @@ -380,7 +384,7 @@ async def extract_attributes_from_node( model_size=ModelSize.small, ) - if entity_type is not None: + if has_entity_attributes and entity_type is not None: entity_type(**llm_response) node.summary = summary_response.get('summary', '')