defaults < config.json < .env < env < code
(precedence), and can be set from code with
the config API or
cognee-cli config.
Vector database
Thevector section is registered by the vector kind. Backend-specific settings
are registered by the backend’s factory, for example
vector.pgvector. Python flat names are accepted as
aliases, shown in brackets.
Supported providers:
This list is the built-in set, not the set of valid values. Any crate can
register an additional provider under any id on a
ComponentRegistry, and a
binary that injects that registry (ComponentManager::with_registry, or
HandleState::from_settings_with_registry in the bindings) accepts the id in
VECTOR_DB_PROVIDER / GRAPH_DATABASE_PROVIDER — including
Postgres-backed providers, which receive the assembled vector_postgres_url /
graph_postgres_url from the *_HOST / *_PORT / *_NAME / *_USERNAME /
*_PASSWORD settings exactly as the built-ins do, whether or not the
pgvector / pggraph features are compiled in. Registering over a built-in id
replaces it. See
External providers.lancedb— embedded Apache-Arrow / Lance vector store, on disk. The default provider, and default-on incognee,cognee-cliand every binding; requires thelancedbCargo feature (the Arrow/Lance native stack is a large build, so a consumer on another vector store can drop it — and must then setvector_db_providerexplicitly). Unavailable on Android, where its native stack does not cross-compile. 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. Selected on any target by settingvector_db_url = ":memory:".pgvector— Postgres + thepgvectorextension; requires thepgvectorCargo feature on the binary build (default-on incognee-cli). See Pluggable Backends for HNSW indexing andcognee-cli vector-reindex.
vector_db_provider to qdrant is rejected at component
initialization in OSS (it returns a config error rather than falling back).
pgvector index tuning
Thevector.pgvector section, registered by the pgvector factory (pgvector
builds only): four optional overrides for the adapter’s HNSW build, applied per
adapter and clamped to the range shown. Keys are vector.pgvector.hnsw_m,
.hnsw_ef_construction, .maintenance_workers and .maintenance_work_mem_mb,
with aliases pgvector_hnsw_m and so on. Leave them unset unless a
measurement says otherwise: the defaults are calibrated against a 100k-point
corpus of 384-d embeddings, and the two that cost server resources exist so
they can be turned down on a small or shared Postgres without patching the
crate.
m/ef_constructionapply to indexes built after the change. One already on disk keeps the parameters it was built with until it is rebuilt —create_missing_vector_indexes()(cognee-cli vector-reindex) only builds a missing or invalid index, never a valid one — so raisingmon an existing store is aDROP INDEX+ reindex, done deliberately.ef_construction’s floor followsmbecause pgvector requiresef_construction >= 2 × m; no combination of these two can produce aCREATE INDEXthat fails.- Asking for more parallel maintenance workers than the server can start is
not an error. Postgres launches as many as the server’s
max_parallel_workers/max_worker_processesstill allow, down to zero (a serial build). The only cost of over-asking is a slower build, so no server-side configuration is required to adopt the defaults. - Surrounding whitespace in an env value is ignored. A blank, negative or non-numeric env value is ignored and the default applies, as is a value too large for the field’s integer type; an in-type value above the limit clamps. A typo in a deployment environment should not take the store down.
Graph database
Thegraph section is registered by the graph kind; backend sections such as
graph.ladybug are registered by their factory. Python flat names are accepted as
aliases.
Supported providers:
ladybug/kuzu (embedded), postgres (feature pggraph).
As with the vector store, these are the built-ins; an externally registered
provider id is accepted too (see the note under Vector database).
The default is derived from the graph backends the binary was compiled with,
not hardcoded. In order:
ladybug, when that feature is on — every default build;- otherwise
postgres, whenpggraphis on (e.g. a--no-default-features … pggraphimage), however many other ids are registered; - otherwise the single registered backend, when the build has exactly one.
ladybug nor
postgres has to set GRAPH_DATABASE_PROVIDER explicitly.
When Postgres graph credentials are unset they fall back to the relational DB_*
config (see roadmap/cognify-compatibility-plan.md).
Relational database
Therelational section is registered by the relational kind. Backends are
RelationalDbFactorys on the ComponentRegistry, selected by relational.provider
(when that is empty, by the scheme of the resolved URL). An external crate adds a
backend with register_relational, together with its own config sections; it
implements cognee_database::RelationalDb. The built-in SeaORM factory is
registered as sqlite (feature sqlite) and postgres / postgresql (feature
postgres). An unregistered provider is an error.
For
postgres the URL is built from the connection parts; otherwise relational.url
is used verbatim. Each part is percent-encoded, so reserved characters in the
name, username or password (@, #, /, %, …) reach the server unchanged
instead of reshaping the URL (a # in the name used to drop the ?sslmode=
that followed it). A part that cannot be encoded is logged (never the password)
and leaves the URL empty, so the connection fails rather than falling back to
another backend. db_sslmode stays a cognee-wide Settings key: the TLS mode is
appended to every Postgres URL cognee builds (relational, pgvector and the
Postgres graph).
Serialization and recovery of pipeline runs
Rust follows Python’s per-dataset lock and startup recovery (modules/cognify/recovery.py); there is nothing to turn on. The
single_process setting (COGNEE_SINGLE_PROCESS), the pipeline cache
(use_pipeline_cache) and its reset API, the PipelineAlreadyRunning error,
the exclusive-run claim and cognee-cli pipeline-unblock have all been
removed. Setting single_process is now an unknown key: an error under strict config,
otherwise a warning and the value is dropped. COGNEE_SINGLE_PROCESS is ignored.
- No run-history gate. A
cognifyis never refused or short-circuited because of the dataset’spipeline_runsrows. Items already processed are skipped one by one by the completion markers. A storedDATASET_PROCESSING_INITIATEDrow written by an older version is read back asINITIATEDand gates nothing. - A per-dataset lock serializes runs.
cognify,addanddeleteon one dataset take the same in-process lock (cognee_core::DatasetLocks::global()), so a secondcognifyof a dataset waits for the first and then proceeds. Different datasets run in parallel. Like Python’sget_dataset_lock, the lock is per process: it does not serialize two processes on one database. - A killed run is recovered at startup. A
cognifyoraddrun records{"recovery_lock": "<token>"}in itsSTARTEDrow and holds an OS file lock on<system_root>/pipeline_run_locks/<token>/owner.lock, which the OS drops when the process dies, however it dies. Recovery runs on the first operation per relational database per process in the bindings. Any other caller (a server, say) runs it by callingcognee_delete::recover_stale_pipeline_runs;cognee-clidoes not run it. Recovery picks each run whose newest row is stillSTARTED, that is older thancognify.stale_run_recovery_min_age_seconds, whose marker it can claim without blocking, whose dataset still exists, and whose dataset lock no run of this process holds. It rolls the run back (acognifyrun’s graph and vector artifacts, scoped to that run in its dataset) and then closes it with anERROREDrow whoserun_infois{"error": "AbandonedPipelineRunError: …"}. A row without a marker, or one whose marker a live process holds, cannot be proven abandoned and is left alone, so recovery is safe with any number of processes on the database. If the rollback fails, or the run’s dataset is gone, the run staysSTARTED.
DATASET_PROCESSING_STARTED, then …_COMPLETED
or …_ERRORED, with no INITIATED row. run_info no longer lists the run’s data
items: STARTED is {}, or {"recovery_lock": …} for a cognify or add run
(above), COMPLETED is {}, and ERRORED is {"error": …}. A
migration strips the data key from stored rows. A failed terminal COMPLETED
write fails the run, which is then rolled back like any other failed run.
Differences from Python: the library runs no periodic re-check (a long-running
server calls recover_stale_pipeline_runs itself on an interval), recovery
sends no Pipeline Run Errored telemetry event, and the closing ERRORED row is
always dated at the time of closing. Python dates it just after the abandoned
run’s own newest row when a later run of the same pipeline has written rows on
the dataset. In Rust the closing row becomes the dataset’s newest row, so a
dataset whose later run completed reads as ERRORED after recovery.
File storage
Thestorage section is registered by the storage kind. Backends are factories
(StorageFactory) selected by storage.backend; an external crate adds one (an
object store, say) with register_storage.
Only
local (files under data_root_directory) is built in. An unregistered
backend id is an error. No built-in backend reads storage.bucket_name.