From 22a93fb717b7a66dda345fbacdb2e6d5df874707 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 8 Mar 2025 11:29:08 +0800 Subject: [PATCH] Limit neighbor nodes fetch to 1000 in Neo4JStorage. --- lightrag/kg/neo4j_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index 34226df7..7e1007b9 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -843,7 +843,7 @@ class Neo4JStorage(BaseGraphStorage): results = await session.run(query, {"node_id": node.id}) # Get all records and release database connection - records = await results.fetch() + records = await results.fetch(1000) # Max neighbour nodes we can handled await results.consume() # Ensure results are consumed # Nodes not connected to start node need to check degree