fix clearing name embeddings bug (#87)

fix bug
This commit is contained in:
Preston Rasmussen 2024-09-05 14:09:19 -04:00 committed by GitHub
parent 299021173b
commit a29c3557d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 5 deletions

View File

@ -225,7 +225,8 @@ class EntityNode(Node):
MATCH (n:Entity {uuid: $uuid}) MATCH (n:Entity {uuid: $uuid})
RETURN RETURN
n.uuid As uuid, n.uuid As uuid,
n.name AS name, n.name AS name,
n.name_embedding AS name_embedding,
n.created_at AS created_at, n.created_at AS created_at,
n.summary AS summary n.summary AS summary
""", """,
@ -239,6 +240,7 @@ class EntityNode(Node):
EntityNode( EntityNode(
uuid=record['uuid'], uuid=record['uuid'],
name=record['name'], name=record['name'],
name_embedding=record['name_embedding'],
labels=['Entity'], labels=['Entity'],
created_at=record['created_at'].to_native(), created_at=record['created_at'].to_native(),
summary=record['summary'], summary=record['summary'],
@ -248,3 +250,6 @@ class EntityNode(Node):
logger.info(f'Found Node: {uuid}') logger.info(f'Found Node: {uuid}')
return nodes[0] return nodes[0]
# Node helpers

View File

@ -23,7 +23,8 @@ async def get_mentioned_nodes(driver: AsyncDriver, episodes: list[EpisodicNode])
MATCH (episode:Episodic)-[:MENTIONS]->(n:Entity) WHERE episode.uuid IN $uuids MATCH (episode:Episodic)-[:MENTIONS]->(n:Entity) WHERE episode.uuid IN $uuids
RETURN DISTINCT RETURN DISTINCT
n.uuid As uuid, n.uuid As uuid,
n.name AS name, n.name AS name,
n.name_embedding AS name_embedding
n.created_at AS created_at, n.created_at AS created_at,
n.summary AS summary n.summary AS summary
""", """,
@ -37,6 +38,7 @@ async def get_mentioned_nodes(driver: AsyncDriver, episodes: list[EpisodicNode])
EntityNode( EntityNode(
uuid=record['uuid'], uuid=record['uuid'],
name=record['name'], name=record['name'],
name_embedding=record['name_embedding'],
labels=['Entity'], labels=['Entity'],
created_at=record['created_at'].to_native(), created_at=record['created_at'].to_native(),
summary=record['summary'], summary=record['summary'],
@ -221,7 +223,7 @@ async def entity_similarity_search(
RETURN RETURN
n.uuid As uuid, n.uuid As uuid,
n.name AS name, n.name AS name,
n.name_embeddings AS name_embedding, n.name_embedding AS name_embedding,
n.created_at AS created_at, n.created_at AS created_at,
n.summary AS summary n.summary AS summary
ORDER BY score DESC ORDER BY score DESC
@ -257,7 +259,7 @@ async def entity_fulltext_search(
RETURN RETURN
node.uuid AS uuid, node.uuid AS uuid,
node.name AS name, node.name AS name,
node.name_embeddings AS name_embedding, node.name_embedding AS name_embedding,
node.created_at AS created_at, node.created_at AS created_at,
node.summary AS summary node.summary AS summary
ORDER BY score DESC ORDER BY score DESC

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "graphiti-core" name = "graphiti-core"
version = "0.2.1" version = "0.2.2"
description = "A temporal graph building library" description = "A temporal graph building library"
authors = [ authors = [
"Paul Paliychuk <paul@getzep.com>", "Paul Paliychuk <paul@getzep.com>",