@@ -185,6 +185,31 @@ All third-party integrations must be optional dependencies to keep the core libr
185185- Place database drivers in ` graphiti_core/driver/ `
186186- Follow existing naming conventions (e.g., ` your_service_client.py ` )
187187
188+ ### Adding a Graph Driver
189+
190+ Graphiti's driver layer is backend-agnostic. To add support for a new graph database, mirror the existing drivers in
191+ ` graphiti_core/driver/ ` and keep the implementation split between the top-level driver and provider-specific
192+ operations.
193+
194+ 1 . Add the new provider to ` graphiti_core/driver/driver.py ` in ` GraphProvider ` .
195+ 2 . Create ` graphiti_core/driver/<backend>_driver.py ` implementing the ` GraphDriver ` interface:
196+ ` execute_query() ` , ` session() ` , ` close() ` , ` build_indices_and_constraints() ` , and ` delete_all_indexes() ` .
197+ 3 . Add ` graphiti_core/driver/<backend>/operations/ ` and implement the operations interfaces from
198+ ` graphiti_core/driver/operations/ ` :
199+ ` EntityNodeOperations ` , ` EpisodeNodeOperations ` , ` CommunityNodeOperations ` , ` SagaNodeOperations ` ,
200+ ` EntityEdgeOperations ` , ` EpisodicEdgeOperations ` , ` CommunityEdgeOperations ` , ` HasEpisodeEdgeOperations ` ,
201+ ` NextEpisodeEdgeOperations ` , ` SearchOperations ` , and ` GraphMaintenanceOperations ` .
202+ 4 . Expose those concrete operations from the driver via the corresponding ` @property ` accessors on ` GraphDriver ` .
203+ 5 . Add provider-specific query variants to ` graphiti_core/models/nodes/node_db_queries.py ` and
204+ ` graphiti_core/models/edges/edge_db_queries.py ` .
205+ 6 . If the backend needs connection or transaction management, implement a matching ` GraphDriverSession ` .
206+ 7 . Register the backend dependency in ` pyproject.toml ` under ` [project.optional-dependencies] ` and add tests under
207+ ` tests/driver/ ` .
208+
209+ For reference implementations, start with ` graphiti_core/driver/neo4j_driver.py ` ,
210+ ` graphiti_core/driver/falkordb_driver.py ` , ` graphiti_core/driver/kuzu_driver.py ` , and
211+ ` graphiti_core/driver/neptune_driver.py ` .
212+
188213### Testing
189214
190215- Add comprehensive tests in the appropriate ` tests/ ` subdirectory
0 commit comments