Skip to main content
The GraphRAG system is highly configurable, allowing you to customize everything from language models to storage mechanisms. This section provides a comprehensive guide to configuring GraphRAG for your specific use case.

Configuration modes

GraphRAG supports a default configuration mode that is designed to work out-of-the-box with minimal setup. You can configure GraphRAG through:

Init command

Get started quickly with the graphrag init command

Settings file

Customize behavior through settings.yaml configuration

Quick start

The simplest way to get started is by running the initialization command:
graphrag init --root ./my-project
This creates:
  • settings.yaml - Main configuration file
  • .env - Environment variables for API keys
  • prompts/ - Default LLM prompts

Configuration structure

GraphRAG configuration is organized into several key areas:
Configure completion and embedding models, including provider settings, authentication, retry logic, and rate limiting.View LLM configuration details
Set up document ingestion, text chunking, and preprocessing options for your data pipeline.Includes support for CSV, TXT, and JSON formats with configurable chunking strategies.
Configure storage backends for inputs, outputs, and caching to optimize performance and cost.View storage configuration details
Tune entity extraction, relationship detection, and graph construction parameters.Choose between LLM-based and NLP-based extraction methods.
Configure hierarchical clustering and community report generation.Uses Leiden algorithm for graph partitioning with customizable parameters.
Set up local, global, drift, and basic search with custom prompts and context limits.Each search method has dedicated configuration options.

Environment variables

GraphRAG supports environment variable substitution in configuration files using ${VAR_NAME} syntax:
completion_models:
  default_completion_model:
    api_key: ${GRAPHRAG_API_KEY}
.env
GRAPHRAG_API_KEY=your-api-key-here
Environment variables are automatically loaded from .env files in your project root.

Configuration defaults

GraphRAG includes sensible defaults for most settings. You only need to configure:
1

API credentials

Set your language model API keys and endpoints
2

Input location

Specify where your source documents are located
3

Optional customization

Tune advanced settings based on your requirements
For a complete list of default values, see the defaults.py file in the source code.

Next steps

Initialize your project

Run graphrag init to create your configuration

Configure LLM models

Set up your language models and embeddings

Settings reference

Explore all available configuration options

Storage setup

Configure input, output, and cache storage

Build docs developers (and LLMs) love