Construct knowledge graph
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 chunking method.
From v0.16.0 onward, RAGFlow supports constructing a knowledge graph on a knowledge base, allowing you to construct a unified graph across multiple files within your knowledge base. When a newly uploaded file starts parsing, the generated graph will automatically update.
Constructing a knowledge graph requires significant memory, computational resources, and tokens.
Scenarios
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.
RAPTOR (Recursive Abstractive Processing for Tree Organized Retrieval) can also be used for multi-hop question-answering tasks. See Enable RAPTOR for details. You may use either approach or both, but ensure you understand the memory, computational, and token costs involved.
Prerequisites
The system's default chat model is used to generate knowledge graph. Before proceeding, ensure that you have a chat model properly configured:
Configurations
Entity types (Required)
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.