From 6d5c04d5613a8ac975ad92ca09c2a90812ec03ff Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 6 Mar 2025 20:54:02 +0800 Subject: [PATCH] Reduce max_depth and update edge type in NetworkXStorage. - Decreased max_depth from 5 to 3 - Changed edge type from "RELATED" to "DIRECTED" --- lightrag/kg/networkx_impl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lightrag/kg/networkx_impl.py b/lightrag/kg/networkx_impl.py index 1cfaaacd..004cfd4f 100644 --- a/lightrag/kg/networkx_impl.py +++ b/lightrag/kg/networkx_impl.py @@ -234,7 +234,7 @@ class NetworkXStorage(BaseGraphStorage): async def get_knowledge_graph( self, node_label: str, - max_depth: int = 5, + max_depth: int = 3, min_degree: int = 0, inclusive: bool = False, ) -> KnowledgeGraph: @@ -250,8 +250,8 @@ class NetworkXStorage(BaseGraphStorage): Args: node_label: Label of the starting node max_depth: Maximum depth of the subgraph - search_mode (str, optional): Search mode, either "exact" or "inclusive". Defaults to "exact". - min_degree (int, optional): Minimum degree of nodes to include. Defaults to 0. + min_degree: Minimum degree of nodes to include. Defaults to 0 + inclusive: Do an inclusive search if true Returns: KnowledgeGraph object containing nodes and edges @@ -383,7 +383,7 @@ class NetworkXStorage(BaseGraphStorage): result.edges.append( KnowledgeGraphEdge( id=edge_id, - type="RELATED", + type="DIRECTED", source=str(source), target=str(target), properties=edge_data,