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 theGraphDriver abstract base class and implement:
Core Methods
execute_query(cypher_query, **kwargs)- Execute Cypher queriessession(database)- Create a database sessiontransaction()- Context manager for transactionsclose()- Close driver connectionsbuild_indices_and_constraints()- Initialize database schema
Operations Properties
Each driver provides access to specialized operation interfaces:entity_node_ops- Entity node operationsepisode_node_ops- Episode node operationscommunity_node_ops- Community node operationssaga_node_ops- Saga node operationsentity_edge_ops- Entity edge operationsepisodic_edge_ops- Episodic edge operationscommunity_edge_ops- Community edge operationshas_episode_edge_ops- Has-episode edge operationsnext_episode_edge_ops- Next-episode edge operationssearch_ops- Search operationsgraph_ops- Graph maintenance operations
Provider Types
TheGraphProvider enum defines available providers:
Transaction Support
Drivers support transactions through thetransaction() context manager:
Choosing a Driver
Neo4j - Production Workloads
Neo4j - Production Workloads
Choose Neo4j for:
- Production applications requiring ACID transactions
- Distributed deployments
- Enterprise features and support
- Rich ecosystem of tools
FalkorDB - Redis Integration
FalkorDB - Redis Integration
Choose FalkorDB for:
- Redis-based infrastructure
- Real-time applications
- RedisSearch integration
- Multi-tenant deployments
Kuzu - Embedded Analytics
Kuzu - Embedded Analytics
Choose Kuzu for:
- Embedded applications
- Analytical workloads
- In-memory processing
- Development and testing
Neptune - AWS Deployments
Neptune - AWS Deployments
Choose Neptune for:
- AWS-native deployments
- Managed graph database service
- OpenSearch integration
- Scalable cloud workloads
Common Patterns
Initialization
Each driver has specific initialization requirements:Using with Graphiti
Pass the driver to the Graphiti constructor:Cleanup
Always close drivers when done: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