Skip to main content
GraphRAG supports multiple storage backends for different parts of the pipeline. You can use local files, Azure Blob Storage, or Azure Cosmos DB depending on your requirements.

Storage types

GraphRAG uses storage in four main areas:

Input storage

Where source documents are read from

Output storage

Where processed artifacts are written

Cache storage

Where LLM responses are cached

Vector storage

Where embeddings are stored for search

Input storage

Configure where GraphRAG reads source documents:

File storage (default)

Place your documents in the input/ directory:

Azure Blob Storage

Azure Cosmos DB

Output storage

Configure where GraphRAG writes processed artifacts:

File storage (default)

Outputs are organized by artifact type:

Azure Blob Storage

Azure Cosmos DB

Update output storage

For incremental indexing, specify a separate output location:
This preserves original outputs when re-indexing with updated data.

Cache storage

Caching stores LLM responses to avoid redundant API calls:

JSON cache (default)

The cache directory structure:

Memory cache

For temporary caching (not persisted):
Memory cache is lost when the process ends. Only use for testing.

Disable caching

Azure Blob cache

Azure Cosmos DB cache

Vector storage

Configure where embeddings are stored for similarity search:

LanceDB (default)

LanceDB provides fast vector search with automatic indexing and works well for most use cases.

Azure Cosmos DB

Custom index schema

Customize field names and vector sizes:
index_name
string
Name for the embedding index/table
id_field
string
default:"id"
Field name for document IDs
vector_field
string
default:"vector"
Field name for embedding vectors
vector_size
integer
default:"3072"
Dimension of embedding vectors (must match model)

Reporting storage

Configure where pipeline logs and reports are written:

File reporting (default)

Azure Blob reporting

Storage parameters

Common parameters

type
string
required
Storage backend: file, blob, memory, or cosmosdb
encoding
string
default:"utf-8"
Character encoding for file operations
base_dir
string
Base directory for file storage (relative to project root)

Azure Blob parameters

connection_string
string
required
Azure Storage connection string (use environment variable)
container_name
string
required
Name of the blob container
account_url
string
Storage account blob URL

Azure Cosmos DB parameters

connection_string
string
required
Cosmos DB connection string (use environment variable)
container_name
string
required
Name of the Cosmos container
database_name
string
required
Name of the Cosmos database
account_url
string
Cosmos DB account URL

Example: Full Azure configuration

Using Azure services for all storage:

Example: Hybrid configuration

Using local files for development with cloud caching:

Best practices

Never commit connection strings or API keys to version control. Store them in .env files and reference with ${VAR_NAME} syntax.
Use JSON file cache during development to avoid redundant API calls. Consider blob cache for team sharing.
Use different containers/directories for production and testing to prevent data mixing.
Azure Blob and Cosmos DB incur storage and transaction costs. Monitor usage and consider file storage for development.
Cache files can save significant API costs. Back them up before clearing or re-indexing.

Next steps

Caching

Learn more about cache configuration and optimization

Settings reference

Complete configuration options

LLM models

Configure language models

Start indexing

Begin processing documents