Learn how to configure and use the knowledge graph provider in R2R
KGProvider
handles the creation, management, and querying of knowledge graphs in your applications. This guide offers an in-depth look at the system’s architecture, configuration options, and best practices for implementation.
For a practical, step-by-step guide on implementing knowledge graphs in R2R, including code examples and common use cases, see our GraphRAG Cookbook.
r2r.toml
file, under the [kg]
section.
local
and global
.
local
search is faster and more accurate, but it is not as comprehensive as global
search.global
search is slower and more comprehensive, but it will give you the most relevant results. Note that global search may perform a large number of LLM calls.chunk_size
based on your data and model capabilities.batch_size
for optimal performance and resource usage.KGProvider
class to implement custom knowledge graph providers:
KGProvider
.