From 2a0a8c31968dad9fd48620d65109e76ca86f0501 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 25 Dec 2024 20:11:25 +0800 Subject: [PATCH] fix bug of merging entities (#546) --- backend/app/rag/knowledge_graph/graph_store/tidb_graph_store.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app/rag/knowledge_graph/graph_store/tidb_graph_store.py b/backend/app/rag/knowledge_graph/graph_store/tidb_graph_store.py index 04c3a678..a50c35c5 100644 --- a/backend/app/rag/knowledge_graph/graph_store/tidb_graph_store.py +++ b/backend/app/rag/knowledge_graph/graph_store/tidb_graph_store.py @@ -359,6 +359,8 @@ def get_or_create_entity(self, entity: Entity, commit: bool = True) -> SQLModel: db_obj.meta_vec = get_entity_metadata_embedding( db_obj.meta, self._embed_model ) + + self._session.add(db_obj) if commit: self._session.commit() self._session.refresh(db_obj)