yangdx commited on
Commit
a7fb63b
·
1 Parent(s): f18b719

Reduce max_depth and update edge type in NetworkXStorage.

Browse files

- Decreased max_depth from 5 to 3
- Changed edge type from "RELATED" to "DIRECTED"

Files changed (1) hide show
  1. lightrag/kg/networkx_impl.py +4 -4
lightrag/kg/networkx_impl.py CHANGED
@@ -234,7 +234,7 @@ class NetworkXStorage(BaseGraphStorage):
234
  async def get_knowledge_graph(
235
  self,
236
  node_label: str,
237
- max_depth: int = 5,
238
  min_degree: int = 0,
239
  inclusive: bool = False,
240
  ) -> KnowledgeGraph:
@@ -250,8 +250,8 @@ class NetworkXStorage(BaseGraphStorage):
250
  Args:
251
  node_label: Label of the starting node
252
  max_depth: Maximum depth of the subgraph
253
- search_mode (str, optional): Search mode, either "exact" or "inclusive". Defaults to "exact".
254
- min_degree (int, optional): Minimum degree of nodes to include. Defaults to 0.
255
 
256
  Returns:
257
  KnowledgeGraph object containing nodes and edges
@@ -383,7 +383,7 @@ class NetworkXStorage(BaseGraphStorage):
383
  result.edges.append(
384
  KnowledgeGraphEdge(
385
  id=edge_id,
386
- type="RELATED",
387
  source=str(source),
388
  target=str(target),
389
  properties=edge_data,
 
234
  async def get_knowledge_graph(
235
  self,
236
  node_label: str,
237
+ max_depth: int = 3,
238
  min_degree: int = 0,
239
  inclusive: bool = False,
240
  ) -> KnowledgeGraph:
 
250
  Args:
251
  node_label: Label of the starting node
252
  max_depth: Maximum depth of the subgraph
253
+ min_degree: Minimum degree of nodes to include. Defaults to 0
254
+ inclusive: Do an inclusive search if true
255
 
256
  Returns:
257
  KnowledgeGraph object containing nodes and edges
 
383
  result.edges.append(
384
  KnowledgeGraphEdge(
385
  id=edge_id,
386
+ type="DIRECTED",
387
  source=str(source),
388
  target=str(target),
389
  properties=edge_data,