graphrag #9002
-
|
How to enable graprag when calling the API |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi @Gsj123-cyber! I'm Dosu and I’m helping the ragflow team. To enable graphrag (GraphRAG) when calling the RAGFlow API, include a graphrag configuration in your parser_config parameter. For example: parser_config = DataSet.ParserConfig(
rag,
{
"chunk_token_num": 1024,
"raptor": {"use_raptor": False},
"graphrag": {"use_graphrag": True}
}
)Make sure your environment has a functioning chat LLM, as GraphRAG depends on it—dataset creation will fail if the chat LLM isn't properly initialized. If you run into errors, try disabling graphrag to confirm if the issue is related to LLM dependencies. For more details, see the discussion and examples in the issues here: example config and dependency notes, LLM dependency. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
To see the returned graph information and scores when retrieving with GraphRAG, use the /retrieval_test endpoint and include the parameter use_kg=true in your request. This will trigger the graph-based retriever, and the API response will include a special graph summary chunk at the front of the chunks array. The graph data—including entities, relations, and their scores—will be in the content_with_weight field of that chunk, typically formatted as a CSV or table with columns like Entity, From Entity, To Entity, Score, and Description. You can extract and parse this field to access the graph structure and associated scores directly from the response. For more details on the response stru…