preserve labels when deduplicating a node (#379)

* preserve labels when deduplicating a node

* entity type updates

* Update graphiti_core/utils/maintenance/node_operations.py

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Preston Rasmussen 2025-04-20 15:14:03 -04:00 committed by GitHub
parent d0b1b2e5db
commit 064d9207d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -306,7 +306,7 @@ async def resolve_extracted_node(
# Prepare context for LLM
existing_nodes_context = [
{'uuid': node.uuid, 'name': node.name, 'attributes': node.attributes}
{**{'uuid': node.uuid, 'name': node.name, 'summary': node.summary}, **node.attributes}
for node in existing_nodes
]
@ -408,6 +408,7 @@ async def resolve_extracted_node(
if new_attributes.get(attribute_name) is None:
new_attributes[attribute_name] = attribute_value
node.attributes = new_attributes
node.labels = list(set(existing_node.labels + extracted_node.labels))
uuid_map[extracted_node.uuid] = existing_node.uuid
@ -432,7 +433,8 @@ async def dedupe_node_list(
# Prepare context for LLM
nodes_context = [
{'uuid': node.uuid, 'name': node.name, 'summary': node.summary} for node in nodes
{'uuid': node.uuid, 'name': node.name, 'summary': node.summary}.update(node.attributes)
for node in nodes
]
context = {

View file

@ -1,7 +1,7 @@
[project]
name = "graphiti-core"
description = "A temporal graph building library"
version = "0.10.3"
version = "0.10.4"
authors = [
{ "name" = "Paul Paliychuk", "email" = "paul@getzep.com" },
{ "name" = "Preston Rasmussen", "email" = "preston@getzep.com" },