yangdx commited on
Commit
a313a22
·
1 Parent(s): 667702f

Limit neighbor nodes fetch to 1000 in Neo4JStorage.

Browse files
Files changed (1) hide show
  1. lightrag/kg/neo4j_impl.py +1 -1
lightrag/kg/neo4j_impl.py CHANGED
@@ -843,7 +843,7 @@ class Neo4JStorage(BaseGraphStorage):
843
  results = await session.run(query, {"node_id": node.id})
844
 
845
  # Get all records and release database connection
846
- records = await results.fetch()
847
  await results.consume() # Ensure results are consumed
848
 
849
  # Nodes not connected to start node need to check degree
 
843
  results = await session.run(query, {"node_id": node.id})
844
 
845
  # Get all records and release database connection
846
+ records = await results.fetch(1000) # Max neighbour nodes we can handled
847
  await results.consume() # Ensure results are consumed
848
 
849
  # Nodes not connected to start node need to check degree