Skip to content

fix(falkordb): route namespace/ops get_by_group_ids reads to the group's graph#1675

Open
spencer2211 wants to merge 1 commit into
getzep:mainfrom
spencer2211:fix/falkordb-ops-namespace-group-routing
Open

fix(falkordb): route namespace/ops get_by_group_ids reads to the group's graph#1675
spencer2211 wants to merge 1 commit into
getzep:mainfrom
spencer2211:fix/falkordb-ops-namespace-group-routing

Conversation

@spencer2211

Copy link
Copy Markdown

Summary

#1670 fixed single-group_id routing for the decorated path (@handle_multiple_group_ids, which clones self.clients.driver and passes it down as driver=). The namespace/ops read path is a separate implementation and is still unrouted on main.

graphiti.nodes.episode.get_by_group_ids(...) delegates to the FalkorDB *Operations classes (FalkorEpisodeNodeOperations.get_by_group_ids etc.). Those methods receive the base driver as executor — pointed at default_db — and run the query directly, so they never go through the decorator's clone. On FalkorDB, where each group_id is its own graph, a single-group read therefore queries the empty default graph and returns 0 rows.

This is the path reported in #1651 (get_episodes / delete_episode querying the wrong graph from the MCP server). There are currently no clone call sites anywhere under graphiti_core/driver/falkordb/operations/.

Related history: #1325 is the original report; #1326 covered both the classmethod path and this ops path, and was closed in favour of #1670, which covered only the former. This PR carries the remaining half forward against current main.

Change

Apply single-group executor.clone(database=gid) routing plus multi-group fan-out to all nine FalkorDB operations get_by_group_ids methods:

  • nodes: episode, entity, community, saga
  • edges: episodic, entity, community, has_episode, next_episode

The clone is guarded by isinstance(executor, GraphDriver) so the QueryExecutor parameter narrows to a clone-capable driver (the QueryExecutor protocol does not declare clone/provider), keeping pyright clean.

This is complementary to #1670, not overlapping: the decorator routes at the search/retrieve entry point via driver=, this routes at the ops layer via executor=.

Test plan

Adds tests/driver/test_falkordb_ops_routing.py — a package-free regression using a spec=GraphDriver mock, so it needs no live FalkorDB and runs in CI. Covers single-group routing, multi-group fan-out, and the empty-group_ids pass-through.

Happy to consolidate the repeated fan-out into a shared helper rather than one block per ops class if you'd prefer that shape.

@zep-cla-assistant

zep-cla-assistant Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@spencer2211

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@spencer2211

Copy link
Copy Markdown
Author

@Naseem77 this is the namespace-path gap you flagged on #1326 — carried forward onto post-#1670 main as a standalone change, since #1670 covered the decorated path only. Same nine ops methods and the same package-free regression test you reviewed there.

cc @prasmussen15 for context: #1326 was closed in favour of #1670, which fixed @handle_multiple_group_ids but not the *Operations.get_by_group_ids read path (#1651).

@spencer2211

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: spencer.p.fuller@gmail.com

@spencer2211

Copy link
Copy Markdown
Author

recheck

zep-cla-assistant Bot added a commit that referenced this pull request Jul 23, 2026
The classmethod get_by_group_ids paths were routed to the right FalkorDB
graph, but the namespace/ops read path (e.g. graphiti.nodes.episode.
get_by_group_ids) delegates to the Falkor *Operations classes with the base
driver (default_db) and never cloned to the group's graph, so a single
group_id read returned 0 rows.

Apply the same single-group clone + multi-group fan-out routing to all nine
FalkorDB operations get_by_group_ids methods (episode/entity/community/saga
nodes and episodic/entity/community/has_episode/next_episode edges), guarded
by isinstance(executor, GraphDriver) so the QueryExecutor param narrows to a
clone-capable driver. Adds a package-free routing regression test.
@spencer2211
spencer2211 force-pushed the fix/falkordb-ops-namespace-group-routing branch from 480f214 to f840e89 Compare July 23, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant