diff --git a/CHANGELOG.md b/CHANGELOG.md index 23260edf..1753a07b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Next ### Fixed -- IDs for the Document and Chunk nodes in the lexical graph are now randomly generated and unique across multiple runs, fixing issues in the lexical graph where relationships where created between chunks that were created by different pipeline runs. +- IDs for the Document and Chunk nodes in the lexical graph are now randomly generated and unique across multiple runs, fixing issues in the lexical graph where relationships were created between chunks that were created by different pipeline runs. ### Changed - The `id_prefix` parameter in the `LexicalGraphConfig` is deprecated. diff --git a/src/neo4j_graphrag/experimental/components/lexical_graph.py b/src/neo4j_graphrag/experimental/components/lexical_graph.py index 90135a31..bbe99b80 100644 --- a/src/neo4j_graphrag/experimental/components/lexical_graph.py +++ b/src/neo4j_graphrag/experimental/components/lexical_graph.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. import asyncio +import datetime import logging -from datetime import datetime from itertools import zip_longest from typing import Any, Dict, Optional @@ -112,7 +112,7 @@ def create_document_node(self, document_info: DocumentInfo) -> Neo4jNode: label=self.config.document_node_label, properties={ "path": document_info.path, - "createdAt": str(datetime.now()), + "createdAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), **document_metadata, }, )