Skip to content

fix(mcp): route FalkorDB UUID operations to tenant graphs - #1765

Open
noamsiegel wants to merge 2 commits into
getzep:mainfrom
noamsiegel:fix/falkordb-tenant-routing
Open

fix(mcp): route FalkorDB UUID operations to tenant graphs#1765
noamsiegel wants to merge 2 commits into
getzep:mainfrom
noamsiegel:fix/falkordb-tenant-routing

Conversation

@noamsiegel

Copy link
Copy Markdown

Summary

  • Resolve UUID-keyed MCP reads and deletes against the FalkorDB graph that owns the requested data.
  • Reject UUIDs found in multiple tenant graphs rather than reading or deleting an arbitrary match.
  • Batch provenance resolution with one probe per graph and avoid FalkorDriver.clone() index-build side effects during reads.
  • Serialize queued cross-group writes because Graphiti.add_episode() mutates the shared driver binding.

Problem

FalkorDB stores each group_id as a physical graph. The remaining UUID-keyed MCP handlers bypass group-aware routing and query whichever graph the shared driver currently targets. Concurrent per-group queue workers can also race while Graphiti.add_episode() rebinds that shared driver. Both cases can report missing data or operate on the wrong tenant graph.

get_episodes is intentionally not changed here because current main already routes EpisodicNode.get_by_group_ids through the merged FalkorDB operations fix.

Fixes #1651.

Verification

  • python -m pytest -q tests/test_falkor_routing.py tests/test_core_parity.py - 34 passed.
  • python -m ruff format --check ... and python -m ruff check ... - clean.
  • python -m pyright --pythonpath <venv-python> src/utils/falkor_routing.py src/graphiti_mcp_server.py src/services/queue_service.py - 0 errors.
  • Mutation checks fail when UUID matching, duplicate detection, non-initializing driver scoping, or cross-group write serialization is removed.
  • Live FalkorDB reproduction confirmed cross-graph edge lookup, cross-graph episode deletion, and distinct-group concurrent writes on the patched MCP service.

@zep-cla-assistant

zep-cla-assistant Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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

@noamsiegel

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: noam@noamsiegel.com

@noamsiegel

Copy link
Copy Markdown
Author

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

zep-cla-assistant Bot added a commit that referenced this pull request Aug 13, 2026
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.

MCP server: get_episodes and delete_episode query the wrong graph on FalkorDB (bypass per-group routing)

1 participant