cognee.config
Static class for configuring Cognee’s runtime settings. All setters persist for the duration of the process (or until overridden).LLM Configuration
Graph Database Configuration
Vector Database Configuration
Chunking Configuration
Model Configuration
Other Settings
All Methods
| Method | Description |
|---|---|
set_llm_provider(provider) | Set the LLM provider |
set_llm_model(model) | Set the LLM model name |
set_llm_api_key(key) | Set the LLM API key |
set_llm_endpoint(url) | Set a custom LLM endpoint |
set_llm_config(dict) | Set all LLM config at once |
set_graph_database_provider(provider) | Set the graph DB provider |
set_graph_db_config(dict) | Set all graph DB config |
set_vector_db_provider(provider) | Set the vector DB provider |
set_vector_db_url(url) | Set the vector DB URL |
set_vector_db_key(key) | Set the vector DB API key |
set_vector_db_config(dict) | Set all vector DB config |
set_chunk_size(size) | Set chunk size in tokens |
set_chunk_overlap(overlap) | Set chunk overlap |
set_chunk_strategy(strategy) | Set chunking strategy |
set_chunk_engine(engine) | Set chunking engine |
set_classification_model(model) | Set classification model |
set_summarization_model(model) | Set summarization model |
set_graph_model(model) | Set graph extraction model |
set_system_root_directory(path) | Set system root directory |
set_data_root_directory(path) | Set data root directory |
set_translation_provider(provider) | Set translation provider |
set_translation_target_language(lang) | Set translation target language |
set(key, value) | Generic config setter |
Environment Variables
These environment variables are read at startup and can be overridden with the config methods above:| Variable | Default | Description |
|---|---|---|
LLM_API_KEY | — | (Required) API key for the LLM provider |
LLM_PROVIDER | "openai" | LLM provider name |
LLM_MODEL | "gpt-4o-mini" | LLM model identifier |
LLM_ENDPOINT | — | Custom LLM endpoint URL |
GRAPH_DATABASE_PROVIDER | "kuzu" | Graph database provider |
VECTOR_DB_PROVIDER | "lancedb" | Vector database provider |
LOG_LEVEL | "INFO" | Logging level |