sidebar_position: 2
Generate a knowledge graph for your knowledge base.
To enhance multi-hop question-answering, RAGFlow adds a knowledge graph construction step between data extraction and indexing, as illustrated below. This step creates additional chunks from existing ones generated by your specified chunk method.
Knowledge graphs are especially useful for multi-hop question-answering involving nested logic. They outperform traditional extraction approaches when you are performing question answering on books or works with complex entities and relationships.
The system’s default chat model is used to generate knowledge graph. Before proceeding, ensure that you have an chat model properly configured:
The types of the entities to extract from your knowledge base. The default types are: organization, person, event, and category. Add or remove types to suit your specific knowledge base.
The method to use to construct knowledge graph:
Whether to enable entity resolution. You can think of this as an entity deduplication switch. When enabled, the LLM will combine similar entities - e.g., ‘2025’ and ‘the year of 2025’, or ‘IT’ and ‘Information Technology’ - to construct a more accurate graph.
In a knowledge graph, a community is a cluster of entities linked by relationships. You can have the LLM generate an abstract for each community, known as a community report. See here for more information. This indicates whether to generate community reports:
On the Configuration page of your knowledge base, switch on Extract knowledge graph or adjust its settings as needed, and click Save to confirm your changes.
The knowledge graph of your knowlege base does not automatically update until a newly uploaded file is parsed.
A Knowledge Graph entry appears under Configuration once a knowledge graph is created.
Yes, you can. Just one graph is generated per knowledge base. The smaller graphs of your files will be combined into one big, unified graph at the end of the graph extraction process.