Files
Preston Rasmussen 99923c0352 feat: driver operations architecture redesign (#1232)
* feat: add driver operations architecture with abstract interfaces and concrete implementations

Introduces a clean operations-based architecture for graph driver operations,
replacing inline query logic with abstract interfaces (ABCs) and concrete
implementations for both Neo4j and FalkorDB backends.

Key changes:
- Add QueryExecutor and Transaction ABCs for database-agnostic query execution
- Add 11 operations ABCs covering all node, edge, search, and graph maintenance operations
- Implement all 11 operations for Neo4j with real transaction commit/rollback
- Implement all 11 operations for FalkorDB with RedisSearch fulltext and vecf32 embeddings
- Add NodeNamespace and EdgeNamespace convenience wrappers on Graphiti class
- Wire operations into Neo4jDriver and FalkorDriver with property accessors
- Fix circular import by moving STOPWORDS to graphiti_core.driver.falkordb package
- Include design spec documenting architecture decisions and migration plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review feedback

- Fix ruff UP037: remove quoted type annotations in driver.py
  (redundant with `from __future__ import annotations`)
- Extract duplicate record parsers into shared record_parsers.py module,
  eliminating identical _entity_node_from_record, _entity_edge_from_record,
  _episodic_node_from_record, and _community_node_from_record across
  10 files in both Neo4j and FalkorDB operations
- Fix MAX_QUERY_LENGTH inconsistency in FalkorDB search_ops
  build_fulltext_query (was 8000, now uses module constant 128)
- Make namespace attributes unconditional with NotImplementedError
  for drivers that don't implement required operations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: make namespace init graceful for drivers missing operations

KuzuDriver doesn't implement the new operations interfaces, so the
NotImplementedError on init broke Kuzu tests. Now attributes are only
set when the driver provides them, and __getattr__ gives a clear error
on access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 13:05:51 -05:00
..