Skip to main content
Graphiti supports multiple graph database backends through a unified driver interface. Each driver implements the GraphDriver abstract base class, providing consistent access to graph operations across different database providers.

Supported Drivers

Graphiti currently supports four graph database backends:

Neo4j

Industry-standard graph database with ACID transactions

FalkorDB

Redis-based graph database with RedisSearch integration

Kuzu

Embedded graph database optimized for analytics

Neptune

AWS managed graph database with OpenSearch

Driver Architecture

All drivers inherit from the GraphDriver abstract base class and implement:

Core Methods

  • execute_query(cypher_query, **kwargs) - Execute Cypher queries
  • session(database) - Create a database session
  • transaction() - Context manager for transactions
  • close() - Close driver connections
  • build_indices_and_constraints() - Initialize database schema

Operations Properties

Each driver provides access to specialized operation interfaces:
  • entity_node_ops - Entity node operations
  • episode_node_ops - Episode node operations
  • community_node_ops - Community node operations
  • saga_node_ops - Saga node operations
  • entity_edge_ops - Entity edge operations
  • episodic_edge_ops - Episodic edge operations
  • community_edge_ops - Community edge operations
  • has_episode_edge_ops - Has-episode edge operations
  • next_episode_edge_ops - Next-episode edge operations
  • search_ops - Search operations
  • graph_ops - Graph maintenance operations

Provider Types

The GraphProvider enum defines available providers:
from graphiti_core.driver.driver import GraphProvider

class GraphProvider(Enum):
    NEO4J = 'neo4j'
    FALKORDB = 'falkordb'
    KUZU = 'kuzu'
    NEPTUNE = 'neptune'

Transaction Support

Drivers support transactions through the transaction() context manager:
async with driver.transaction() as tx:
    await ops.save(driver, node, tx=tx)
Neo4j provides full ACID transaction support with automatic commit/rollback. FalkorDB, Kuzu, and Neptune provide compatibility wrappers where queries execute immediately.

Choosing a Driver

Choose Neo4j for:
  • Production applications requiring ACID transactions
  • Distributed deployments
  • Enterprise features and support
  • Rich ecosystem of tools
Choose FalkorDB for:
  • Redis-based infrastructure
  • Real-time applications
  • RedisSearch integration
  • Multi-tenant deployments
Choose Kuzu for:
  • Embedded applications
  • Analytical workloads
  • In-memory processing
  • Development and testing
Choose Neptune for:
  • AWS-native deployments
  • Managed graph database service
  • OpenSearch integration
  • Scalable cloud workloads

Common Patterns

Initialization

Each driver has specific initialization requirements:
from graphiti_core.driver.neo4j_driver import Neo4jDriver
from graphiti_core.driver.falkordb_driver import FalkorDriver
from graphiti_core.driver.kuzu_driver import KuzuDriver
from graphiti_core.driver.neptune_driver import NeptuneDriver

# Neo4j
neo4j_driver = Neo4jDriver(
    uri="bolt://localhost:7687",
    user="neo4j",
    password="password"
)

# FalkorDB
falkor_driver = FalkorDriver(
    host="localhost",
    port=6379
)

# Kuzu
kuzu_driver = KuzuDriver(db=":memory:")

# Neptune
neptune_driver = NeptuneDriver(
    host="neptune-db://cluster-endpoint",
    aoss_host="opensearch-endpoint"
)

Using with Graphiti

Pass the driver to the Graphiti constructor:
from graphiti_core import Graphiti

graphiti = Graphiti(graph_driver=driver)
Or use connection parameters for Neo4j:
graphiti = Graphiti(
    uri="bolt://localhost:7687",
    user="neo4j",
    password="password"
)

Cleanup

Always close drivers when done:
try:
    # Use driver
    await graphiti.add_episode(...)
finally:
    await driver.close()

Next Steps

Neo4j Driver

Detailed Neo4j driver documentation

FalkorDB Driver

Detailed FalkorDB driver documentation

Kuzu Driver

Detailed Kuzu driver documentation

Neptune Driver

Detailed Neptune driver documentation

Build docs developers (and LLMs) love