Added min_degree exception for connected nodes

This commit is contained in:
yangdx
2025-03-05 11:48:04 +08:00
parent 1fddc8552e
commit 5e40e4107d
2 changed files with 24 additions and 21 deletions

View File

@@ -31,9 +31,10 @@ def create_graph_routes(rag, api_key: Optional[str] = None):
Retrieve a connected subgraph of nodes where the label includes the specified label.
Maximum number of nodes is constrained by the environment variable `MAX_GRAPH_NODES` (default: 1000).
When reducing the number of nodes, the prioritization criteria are as follows:
1. Label matching nodes take precedence
2. Followed by nodes directly connected to the matching nodes
3. Finally, the degree of the nodes
1. min_degree does not affect nodes directly connected to the matching nodes
2. Label matching nodes take precedence
3. Followed by nodes directly connected to the matching nodes
4. Finally, the degree of the nodes
Maximum number of nodes is limited to env MAX_GRAPH_NODES(default: 1000)
Args: