.env → choose providers → handle pruning.Supported Providers
Cognee supports multiple graph store options:- Kuzu — Local file-based graph database (default)
- Kuzu-remote — Kuzu with HTTP API access
- Neo4j — Production-ready graph database (self-hosted server or Docker)
- Neo4j Desktop — Local Neo4j development setup with the Desktop app
- Neo4j Aura — Neo4j’s fully managed cloud service
- Postgres — Stores graph nodes and edges in Postgres tables
- Neptune — Amazon Neptune cloud graph database
- Neptune Analytics — Amazon Neptune Analytics hybrid solution
- Memgraph — In-memory graph database (community adapter)
Configuration
Environment Variables
Environment Variables
.env file:GRAPH_DATABASE_PROVIDER— The graph store provider (kuzu, kuzu-remote, neo4j, postgres, neptune, neptune_analytics)GRAPH_DATABASE_URL— Database URL or connection stringGRAPH_DATABASE_USERNAME— Database username (optional)GRAPH_DATABASE_PASSWORD— Database password (optional)GRAPH_DATABASE_NAME— Database name (optional)SUBPROCESS_OPEN_LOCK_RETRIES— For the file-based Ladybug/Kuzu store only: how many times a worker retries opening the graph file when another worker is still releasing its on-disk lock (default10; set to0or a negative value to disable retries and surface the lock error immediately)SUBPROCESS_OPEN_LOCK_BACKOFF— For the file-based Ladybug/Kuzu store only: starting delay in seconds for the exponential backoff between those open retries (default0.1; per-attempt delay is capped internally)
Setup Guides
Kuzu (Default)
Kuzu (Default)
Kuzu (Remote API)
Kuzu (Remote API)
Postgres
Postgres
GRAPH_DATABASE_HOST, GRAPH_DATABASE_PORT, GRAPH_DATABASE_NAME, GRAPH_DATABASE_USERNAME, and GRAPH_DATABASE_PASSWORD are omitted, Cognee falls back to the relational DB_* settings. This is the usual setup when the same Postgres database backs Cognee metadata, vectors, and graph state:DATABASE_CONNECT_ARGS; see Relational Databases.graph_node and graph_edge tables. It does not support raw Cypher queries; use a graph-native backend such as Neo4j when you need raw graph query support.Neo4j (Self-Hosted)
Neo4j (Self-Hosted)
Neo4j Desktop (Local Development)
Neo4j Desktop (Local Development)
neo4j graph provider from Cognee’s perspective; Neo4j Desktop is only how you run and manage the local database.Create and start a local database
- Create a new project
- Add a local DBMS/database
- Set and save the database password
- Start the database
7687 unless you intentionally changed it.Install APOC
__Node__ label in Neo4j Browser.Configure Cognee
.env file:Verify the connection
Neo4j Aura (Cloud)
Neo4j Aura (Cloud)
neo4j+s:// connection URI provided in your Aura console:Neo4jAuraDevDatasetDatabaseHandler can automatically create and delete a dedicated Neo4j Aura instance for each Cognee dataset. This requires Neo4j Aura API credentials (OAuth):Neptune (Graph-only)
Neptune (Graph-only)
Neptune Analytics (Hybrid)
Neptune Analytics (Hybrid)
Advanced Options
Backend Access Control
Backend Access Control
Provider Comparison
Graph Store Comparison
Graph Store Comparison
Important Considerations
Data Location
Data Location
- Local providers (Kuzu): Graph files are created automatically under
SYSTEM_ROOT_DIRECTORY - Local Neo4j Desktop: Graph data is stored in the database managed by Neo4j Desktop, not under Cognee’s
SYSTEM_ROOT_DIRECTORY - Remote providers (Neo4j, Neptune): Require running services or cloud setup
- Path management: Kuzu graph files are managed automatically; Neo4j Desktop data is managed inside Neo4j Desktop
Performance Notes
Performance Notes
- Kuzu: Single-file storage with good local performance
- Neo4j: Excellent for production workloads with proper indexing
- Neptune: Cloud-scale performance with managed infrastructure
- Hybrid solutions: Combine graph and vector capabilities in one system
Community-Maintained Providers
Additional graph stores are available through community-maintained adapters:- Memgraph — In-memory graph database (Bolt protocol)
Notes
Backend Access Control
Backend Access Control
Path Management
Path Management
SYSTEM_ROOT_DIRECTORY.Cloud Integration
Cloud Integration
Neo4j Type Labels
Neo4j Type Labels
apoc.create.addLabels to apply type-specific labels to every node. Without it, Cognee can still store nodes, but Neo4j will only show the generic __Node__ label, making entity types harder to inspect directly.The bundled Docker Compose Neo4j profile already includes APOC. For self-hosted Neo4j instances, install the APOC plugin before connecting Cognee.Troubleshooting: 'No nodes found'
Troubleshooting: 'No nodes found'
No nodes found in the database means the graph DB at the current path is empty. Common causes:Path mismatch between runs
Path mismatch between runs
SYSTEM_ROOT_DIRECTORY defaults to a .cognee_system folder inside the installed Cognee package directory (typically inside your virtual environment). If this path resolves differently across sessions — for example, after reinstalling packages or using a different virtual environment — each session sees an empty graph.Pin it to an explicit absolute path in your .env:add()) are stored separately under DATA_ROOT_DIRECTORY, which defaults to .data_storage in the same package directory. Set both if you want fully portable storage:Data not yet processed in this session
Data not yet processed in this session
add() + cognify() every time. Calling search() or visualize_graph() in a new session will find existing data, as long as SYSTEM_ROOT_DIRECTORY points to the same location as the original ingestion run.Graph was pruned
Graph was pruned
cognee.prune.prune_system() deletes all graph and system data. Re-run add() and cognify() to rebuild it.