Files
Preston Rasmussen 5bca426cd1 feat: implement Neptune and Kuzu driver operations (#1235)
* feat: implement Neptune and Kuzu driver operations

Extract scattered Neptune and Kuzu logic from nodes.py, edges.py,
search_utils.py, and maintenance utilities into structured operations
classes, following the same architecture established for Neo4j and
FalkorDB in #1232.

Each driver now has 11 operations classes: entity_node_ops,
episode_node_ops, community_node_ops, saga_node_ops, entity_edge_ops,
episodic_edge_ops, community_edge_ops, has_episode_edge_ops,
next_episode_edge_ops, search_ops, and graph_ops.

Neptune-specific: AOSS fulltext search, comma-separated embeddings,
manual cosine similarity, removeKeyFromMap() for saves.

Kuzu-specific: RelatesToNode_ intermediate pattern, JSON attributes,
QUERY_FTS_INDEX/array_cosine_similarity, BFS depth doubling,
Saga/HAS_EPISODE/NEXT_EPISODE schema additions.

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

* fix: address PR review comments for Neptune/Kuzu operations

- Extract `_label_propagation` and `Neighbor` to shared `graph_utils.py`
  module, removing duplication across all 4 driver graph_ops.py files
- Extract `_parse_kuzu_entity_node` and `_parse_kuzu_entity_edge` to
  shared `kuzu/operations/record_parsers.py`, removing duplication
  across entity_node_ops, entity_edge_ops, graph_ops, and search_ops
- Fix UNWIND bug in Kuzu `node_distance_reranker` and
  `episode_mentions_reranker` (Kuzu doesn't support UNWIND)
- Fix `_build_kuzu_fulltext_query` max_query_length calculation bug
  (`len(group_ids or '')` was meaningless)
- Replace inline import + cast pattern with constructor dependency
  injection for Neptune AOSS access in community_node_ops, search_ops,
  and graph_ops
- Use existing `calculate_cosine_similarity` from `search_utils.py`
  instead of duplicating it in Neptune search_ops

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

---------

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