Configure your R2R knowledge graph provider.
graspologic
and saving the output triples and relationships into Postgres. We are actively working to integrate with Memgraph. You can find out more about creating knowledge graphs in the GraphRAG Cookbook.
To configure the knowledge graph settings for your project, edit the kg
section in your r2r.toml
file:
provider
: Specifies the knowledge graph provider. Currently, “postgres” is supported.batch_size
: Determines the number of entities or relationships to process in a single batch during import operations.kg_triples_extraction_prompt
: Specifies the prompt template to use for extracting knowledge graph information from text.kg_creation_settings
: Configuration for the model used in knowledge graph creation.
max_knowledge_triples
: The maximum number of knowledge triples to extract for each document chunk.fragment_merge_count
: The number of fragments to merge into a single extraction.generation_config
: Configuration for the model used in knowledge graph creation.kg_enrichment_settings
: Similar configuration for the model used in knowledge graph enrichment.
generation_config
: Configuration for the model used in knowledge graph enrichment.leiden_params
: Parameters for the Leiden algorithm.kg_search_settings
: Similar configuration for the model used in knowledge graph search operations.r2r.toml
will override environment variables by default.kg_triples_extraction_prompt
and adjusting the model configurations in kg_extraction_settings
and kg_search_settings
. Moreover, you can customize the LLM models used in various parts of the knowledge graph creation process. All of these options can be selected at runtime, with the only exception being the specified database provider. For more details, refer to the knowledge graph settings in the search API.
By leveraging the knowledge graph capabilities, you can enhance R2R’s understanding of document relationships and improve the quality of search and retrieval operations.