Skip to main content
Canonical reference for configuring cognee-rust. The complete, field-level source of truth is the Settings struct and the ConfigManager runtime API β€” build the rustdoc with cargo doc -p cognee-lib --no-deps --open to browse every field and setter with its type. This page groups those fields by subsystem and gives the env-var name and default for each.

How configuration resolves

Three layers, lowest precedence first:
  1. Defaults β€” Settings::default() in crates/lib/src/config.rs.
  2. Persisted config file (CLI only) β€” JSON at ~/.config/cognee-rust/config.json ($XDG_CONFIG_HOME/cognee-rust/config.json), managed by cognee-cli config. See crates/cli/src/config_store.rs.
  3. Environment variables β€” bound by Settings::overlay_from_env(). A .env file in the working directory (or any ancestor) is loaded automatically via dotenv.
So: defaults < config.json < env. At runtime, code can also mutate settings through ConfigManager’s set_* methods (below) or the binding config APIs. Parsing notes: booleans accept true|1|yes / false|0|no (cognee_utils::parse_env_bool); empty env values are treated as unset; numeric vars that fail to parse are ignored.

LLM

Read by the LLM adapter. The deep reference is tools/cli for retries and the cognee-llm rustdoc for the adapter. A fallback LLM (llm_fallback_provider/_model/_endpoint/_api_key) is configurable programmatically (no env binding). MOCK_LLM + cassettes power the offline benchmark β€” see performance/mock-benchmark.md.

Embedding

Read by EmbeddingConfig::from_env() (crates/embedding/src/config.rs). Provider values: onnx, fastembed, openai, openai_compatible, ollama, mock.

Vector database

Supported providers:
  • lancedb β€” embedded Apache-Arrow / Lance vector store, on disk. Default on every target except Android. The on-disk layout matches the Python SDK’s default LanceDB store, so a Rust deployment can be opened from Python and vice versa.
  • brute-force β€” pure-Rust in-memory linear scan. Default on Android (where LanceDB’s native stack does not cross-compile). Selected on any target by setting vector_db_url = ":memory:".
  • pgvector β€” Postgres + the pgvector extension; requires the pgvector Cargo feature on the binary build.
Qdrant lives in closed cognee-cloud-rs as the cognee-vector-qdrant crate and is not part of OSS. See tools/backends. Setting vector_db_provider to qdrant is rejected at component initialization in OSS (it returns a config error rather than falling back).

Graph database

Supported providers: ladybug/kuzu (embedded), postgres (feature pggraph). When Postgres graph credentials are unset they fall back to the relational DB_* config (see roadmap/cognify-compatibility-plan.md).

Relational database

Chunking & tokenizer

Read by crates/chunking/src/config.rs. Most chunking knobs (chunk_strategy default PARAGRAPH, chunk_size 1500, chunk_overlap 10, chunk_engine) are Settings/CognifyConfig fields without env bindings. The token counter is env-selected:

Ontology

System paths, users & datasets

Setting system_root_directory cascades to the default graph_file_path and vector_db_url unless those are set explicitly.

Session / cache & rate limiting

Logging

Canonical table. Binding READMEs and .env.example link here. cognee writes structured logs to stdout and (when writable) to a rotating file. File logging is owned by cognee-logging, initialised by the CLI and HTTP server via cognee_logging::init_logging.
Multi-process warning β€” when several cognee processes share one log file via LOG_FILE_NAME, rotation is not coordinated; concurrent rotation can corrupt the log. For sharded workers, give each shard its own COGNEE_LOGS_DIR (or unset LOG_FILE_NAME per shard).

Observability & telemetry

cognee emits OpenTelemetry traces (behind the telemetry feature) and opt-out product analytics. The deep references are observability/opentelemetry.md and observability/send_telemetry.md; the env surface:

HTTP server

The server binary reads its own env surface (crates/http-server/src/config.rs) β€” host/port, auth, body limits, pipeline registry, notebooks, health probes. See tools/http-server and HTTP server architecture: config.

Cloud

Cloud/Auth0 configuration (COGNEE_CLOUD_URL, COGNEE_AUTH0_*) and the serve()/disconnect() flow live in the closed cognee-cloud-rs product (the cognee-cloud crate) and are not part of OSS.

Runtime configuration API

ConfigManager (Arc<RwLock<Settings>>) exposes typed setters used by the bindings and CLI. Families: set_llm_*, set_embedding_*, set_vector_db_*, set_graph_*, set_chunk_*, set_relational_db_*, set_*_root_directory, set_ontology_*, set_classification_model / set_summarization_model / set_summarization_schema, plus four bulk setters (set_llm_config, set_embedding_config, set_vector_db_config, set_graph_db_config) and a generic set(key, value). Introspection: read(), version(), get_settings() (secrets masked). Full signatures are in the ConfigManager rustdoc. The binding ergonomics (granular JS setters vs generic set in Python/C) are documented in Language bindings: configuration.

CLI config subcommand

cognee-cli config get|set|unset <key> reads/writes the persisted JSON file. The settable keys are the snake_case Settings field names β€” see known_keys(). Example: