diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 092e06eb..0d072e61 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -457,13 +457,13 @@ class LightRAG: namespace=NameSpace.VECTOR_STORE_ENTITIES, workspace=self.workspace, embedding_func=self.embedding_func, - meta_fields={"entity_name", "source_id", "content", "file_path"}, + meta_fields={"entity_name", "source_id", "content", "file_path", "entity_type"}, ) self.relationships_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore namespace=NameSpace.VECTOR_STORE_RELATIONSHIPS, workspace=self.workspace, embedding_func=self.embedding_func, - meta_fields={"src_id", "tgt_id", "source_id", "content", "file_path"}, + meta_fields={"src_id", "tgt_id", "source_id", "content", "file_path", "weight"}, ) self.chunks_vdb: BaseVectorStorage = self.vector_db_storage_cls( # type: ignore namespace=NameSpace.VECTOR_STORE_CHUNKS, diff --git a/lightrag/operate.py b/lightrag/operate.py index e3456d92..1eac8357 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1284,6 +1284,7 @@ async def merge_nodes_and_edges( "content": f"{edge_data['src_id']}\t{edge_data['tgt_id']}\n{edge_data['keywords']}\n{edge_data['description']}", "source_id": edge_data["source_id"], "file_path": edge_data.get("file_path", "unknown_source"), + "weight": 0 } } await relationships_vdb.upsert(data_for_vdb)