Core Responsibilities and Lifecycle
All handlers implement theDatasetDatabaseHandlerInterface, which defines three lifecycle entry points.
Handler Interface Methods
Handler Interface Methods
Handlers must implement the following methods:
-
create_dataset(dataset_id, user) -> dictCreates or resolves backing storage for the dataset and returns a dictionary of connection and identification fields. This may:- Provision new infrastructure (e.g., create a Neo4j Aura instance), or
- Return connection details to an existing shared or pooled backend.
-
resolve_dataset_connection_info(dataset_database) -> DatasetDatabase(optional override) Converts stored references into runtime-ready connection details. Typical use cases include:- Decrypting stored secrets
- Fetching short-lived access tokens The default implementation returns the input unchanged.
-
delete_dataset(dataset_database) -> NoneDeprovisions, deletes, or prunes the dataset’s backing storage.
Persisted Dataset Database Records
The dictionary returned fromcreate_dataset() is persisted as a DatasetDatabase row in the relational database and later merged into runtime connection flows.
Typical stored fields include:
Vector database fields
Vector database fields
vector_database_providervector_database_urlvector_database_keyvector_database_namevector_dataset_database_handlervector_database_connection_info(JSON dictionary for extended or sensitive parameters such as usernames, passwords, or custom options)
Graph database fields
Graph database fields
graph_database_providergraph_database_urlgraph_database_keygraph_database_namegraph_dataset_database_handlergraph_database_connection_info(JSON dictionary for extended or sensitive parameters such as usernames, passwords, or custom options)
Where Dataset Database Handlers Are Used
Handlers are invoked automatically by the system based on configuration.- Vector storage
- Selected via
VECTOR_DATASET_DATABASE_HANDLERenvironment variable
- Selected via
- Graph storage
- Selected via
GRAPH_DATASET_DATABASE_HANDLERenvironment variable
- Selected via
- A new
DatasetDatabaserow is created if one does not already exist. - The handler name, provider, and connection metadata are stored for reuse.
- At runtime, the handler may resolve secrets or transform stored references before connections are opened.
- On dataset deletion, the handler is responsible for cleaning up the underlying storage. The dataset deletion call happens when pruning data in Cognee and when datasets are explicitly deleted.
List of Supported Dataset Database Handlers:
Core handlers included with Cognee:
- neo4j_aura_dev → Neo4j Aura development cloud handler
- kuzu → Kuzu graph handler
- lancedb → LanceDB vector handler
Community-contributed handlers from the community repository:
- qdrant → Qdrant vector handler using local docker
- falkor_vector_local -> FalkorDB vector handler using local docker
- falkor_graph_local -> FalkorDB graph handler using local docker
Using Custom Dataset Database Handlers
You can add your own at runtime with a register function, then point configuration to your handler name. For example:- For a more detailed example of writing a custom handler, see the Custom Dataset Database Handlers Example.
- For an example of an existing handler implementation, see the Neo4j Aura Dev Dataset Database Handler source code.