From 5942d148f01354dcc7aa264057cae3bafcbe3ae0 Mon Sep 17 00:00:00 2001 From: yangdx Date: Fri, 7 Mar 2025 07:34:29 +0800 Subject: [PATCH] Set default max_depth to 3 for knowledge graph retrieval --- lightrag/base.py | 2 +- lightrag/lightrag.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightrag/base.py b/lightrag/base.py index 5f6a1bf1..4b840b37 100644 --- a/lightrag/base.py +++ b/lightrag/base.py @@ -204,7 +204,7 @@ class BaseGraphStorage(StorageNameSpace, ABC): @abstractmethod async def get_knowledge_graph( - self, node_label: str, max_depth: int = 5 + self, node_label: str, max_depth: int = 3 ) -> KnowledgeGraph: """Retrieve a subgraph of the knowledge graph starting from a given node.""" diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index f48982ba..0fa350de 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -506,7 +506,7 @@ class LightRAG: async def get_knowledge_graph( self, node_label: str, - max_depth: int, + max_depth: int = 3, min_degree: int = 0, inclusive: bool = False, ) -> KnowledgeGraph: