Introduction

During R2R instance construction, the default config.json is loaded. Custom user settings can be passed to overwrite the default settings where applicable. The following services are configurable:

  • R2R Application settings
  • Embedding settings
  • LLM settings
  • Vector Database provider
  • Knowledge Graph provider
  • Evaluation provider
  • Ingestion provider
  • Prompt provider
  • Logging

Usage

To launch R2R with your own configuration custom:

from r2r import R2RConfig, R2RBuilder

config_path = PATH_TO_YOUR_CONFIG
config = R2RConfig.from_json(config_path=config_path)
app = R2RBuilder(config).build().app

Alternatively, you may launch R2R with a non-default preloaded config that ships with R2R:

from r2r import R2RConfig, R2RBuilder

config_name = "neo4j_kg" # | local_ollama | ...
app = R2RBuilder(from_config=config_name).build().app

Currently only a few additional configurations are supported.

Default Configuration

The default configuration is as follows:

filename="config.json"
{
  "app": {
    "max_logs_per_request": 100,
    "max_file_size_in_mb": 32
  },
  "completions": {
    "provider": "litellm"
  },
  "embedding": {
    "provider": "openai",
    "base_model": "text-embedding-3-small",
    "base_dimension": 512,
    "batch_size": 128,
    "text_splitter": {
      "type": "recursive_character",
      "chunk_size": 512,
      "chunk_overlap": 20
    },
    "rerank_model": "None"
  },
  "kg": {
    "provider": "None"
  },
  "eval": {
    "provider": "None"
  },
  "ingestion":{
    "excluded_parsers": {
      "mp4": "default"
    }
  },
  "logging": {
    "provider": "local",
    "log_table": "logs",
    "log_info_table": "log_info"
  },
  "prompt": {
    "provider": "local"
  },
  "vector_database": {
    "provider": "pgvector"
  }
}

Configuration Options

Example Configurations

Here are some example configurations to demonstrate different setups:

For more detailed information on configuring specific providers, please refer to the relevant documentation:

These documentation files provide in-depth guides on setting up and using each provider, including any required environment variables and additional configuration options.