Skip to main content

Deployment facts

These facts anchor the rest of the guide:

Executive summary

Cognee runs either embedded in a Python process or as a FastAPI service. Operationally, each deployment comes down to three independent choices:
  • Writer ownership: who owns writes
  • Storage location: where graph, vector, and relational state live
  • Reader access path: how readers reach memory
The default embedded stack is file-backed: Kuzu for graph storage, LanceDB for vectors, and SQLite for relational metadata. In production, each tier can be externalized independently: Neo4j or the FalkorDB adapter for graph storage, Qdrant/pgvector/Pinecone/ChromaDB for vectors, and Postgres for relational metadata. Deployment patterns are composable. Choose a base shape first, such as Embedded SDK, Compose, Helm, sidecar, or Lambda, then add the write model, read-scaling pattern, and storage backend that match your workload.

Pick-a-path decision tree

Start with writer ownership. The first “no” on single-writer ownership pushes you toward queueing or external backends.

Storage model

Cognee has three independent storage layers: Embedded storage is file-backed and easy to move. If SYSTEM_ROOT_DIRECTORY is unset, Cognee resolves it to .cognee_system, so the default on-disk layout still lands under <SYSTEM_ROOT_DIRECTORY>/databases:
That makes backups simple, but the same file-backed layout is why one process should own writes. In production, replace each layer with service-backed systems by changing the provider and connection variables.

Concurrency and the write model

This is the primary production decision. Packaging is secondary.
For concurrent multi-agent writes, do not rely on shared file-backed Kuzu. Use a single writer service, a queue, or an external graph backend.

1. Embedded deployment

Cognee runs inside the calling Python process. Storage defaults to the local Cognee directories and can be moved with DATA_ROOT_DIRECTORY and SYSTEM_ROOT_DIRECTORY. One process owns the writer lock; there is no service boundary or cross-machine sharing unless the directory is mounted or copied.
Best for notebooks, CLIs, local agents, and single-process jobs. Avoid it for cross-process concurrent writes.

2. Self-hosted service

Use Compose to validate Cognee inside customer or on-prem infrastructure before moving to Kubernetes. Pin the image, persist data to a named volume, expose health checks, and load secrets from a managed source rather than plaintext .env files.
See Docker Deployment for the full Compose workflow.

3. Scale-out patterns

Scale-out patterns are layered on top of a self-hosted deployment. They scale reads or isolate write jobs; they do not replace the write path.
Use one writer to run remember(), publish a snapshot to object storage, and let many readers pull the latest snapshot at startup. This scales reads without a clustered graph database, at the cost of freshness.
Use this for heavy read traffic and static or slowly changing knowledge. Benchmark snapshot size because it drives reader cold-start time.

4. Serverless and managed

Serverless patterns are useful for HTTP-fronted memory APIs and scheduled jobs. They are rarely the primary on-prem pattern.
Run remember() offline, package the resulting Kuzu/LanceDB files into the deployment artifact or Lambda layer, and open them read-only at runtime.
This scales to zero and is rollback-friendly, but every knowledge update requires rebuilding and redeploying the snapshot.

Ephemeral cloud sandbox (Islo)

For a throwaway, HTTP-fronted API instance, Cognee ships a one-command deploy script that provisions an Islo cloud sandbox (2 vCPU / 4 GB / 10 GB), installs cognee[api] into a dedicated virtualenv, starts the FastAPI server on port 8000, gates on the internal /health endpoint, and then prints a public share URL that expires after 24 hours.
The Islo CLI is only used to mint the API key; the deployment itself is driven by the official Islo Python SDK. The sandbox name is fixed (cognee-api), so re-running the script while a previous deployment still exists fails with a name conflict — delete the old sandbox through the SDK first. You can still stop the sandbox separately when you want to pause it without recreating it. Best for demos and short-lived evaluation rather than durable state, since the share URL and sandbox are ephemeral. See distributed/deploy/README.md for the full runbook, required environment variables, and cleanup commands.

5. Externalized backends

Use external services for sustained multi-agent writes and independent scaling of each storage layer. This removes the file-backed graph single-writer ceiling once the graph tier is externalized.
Wire the external services into Helm:
Typical production shape:
  • Postgres or RDS for relational metadata
  • pgvector, Qdrant, Pinecone, or ChromaDB for vectors
  • Neo4j or the FalkorDB adapter for graph writes
  • Cognee API pods configured as storage-backed application nodes with writable local paths for ingestion artifacts and caches

6. Cloud service mapping

The patterns are cloud-agnostic. The concrete services differ by platform. Keep the hot graph on block storage or an external graph service. Use shared filesystems only when the pattern truly requires cross-process file sharing.

7. Production readiness

Schema migrations

  • Relational: pin the Cognee version per environment and run migrations before deploying the live writer.
  • Graph: additive model changes are safest. Renames, removals, and new required fields need a data migration or rebuild from source.
  • Vector: rebuild collections when embedding dimension, distance metric, or metadata schema changes.

Backups, restore, and DR

  • Embedded: route writes through one writer, then snapshot the data directory to object storage.
  • Externalized: back up each tier independently, such as Postgres dumps, managed snapshots, graph dumps, and vector snapshots.
  • Region failure: use cross-region snapshot replication and warm standby. Active-active DR is not a good fit for file-backed Kuzu.
  • Test restore on every release.

Tenant isolation

LLM egress and authentication

  • Use self-hosted vLLM, customer-approved proxies, Bedrock private access, Azure OpenAI in-subscription, or fully air-gapped patterns when egress is restricted.
  • Front the Cognee API with the customer gateway. Terminate OIDC or mTLS there rather than exposing the Cognee port directly.
  • Use service-to-service mTLS or cluster-native identity.
  • Propagate user identity through a gateway-validated header when Cognee needs user-scoped access.

Appendix - options at a glance

For provider-specific configuration, see Graph Stores, Vector Stores, and Relational Databases.