Skip to content

fix(falkordb): route grouped clears to tenant graphs - #1703

Open
d3f4w2 wants to merge 1 commit into
getzep:mainfrom
d3f4w2:fix/falkordb-clear-group-routing
Open

fix(falkordb): route grouped clears to tenant graphs#1703
d3f4w2 wants to merge 1 commit into
getzep:mainfrom
d3f4w2:fix/falkordb-clear-group-routing

Conversation

@d3f4w2

@d3f4w2 d3f4w2 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Fix FalkorDB group-scoped clearing so MCP clear_graph deletes the requested tenant graphs instead of filtering the base/default graph and reporting a false success.

FalkorDB stores each group_id in a separate physical graph. FalkorGraphMaintenanceOperations.clear_data previously executed property-filtered deletes on the executor's current graph, which is normally default_db. The fix clones the driver per requested group, clears that physical graph, and preserves the existing transaction-like fallback for executors that cannot be cloned.

Duplicate group IDs are de-duplicated while preserving order, and groups are cleared sequentially to avoid concurrent operations on the shared FalkorDB connection.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

Restore the destructive-operation contract for FalkorDB multi-tenant deployments: a successful group-scoped clear must actually remove data from every requested group graph.

This is the remaining clear_graph portion of #1651 after #1670 and #1675 fixed the corresponding read paths. UUID-only lookup/delete tools are intentionally out of scope because their cross-graph lookup contract needs separate design.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • All existing tests pass

Validated locally:

  • uv run pytest tests/driver/test_falkordb_ops_routing.py -q — 8 passed
  • relevant driver/decorator suite — 37 passed, 1 skipped
  • uv run ruff check — passed
  • uv run pyright ./graphiti_core — 0 errors
  • uv run ruff format --check and git diff --check — passed

New unit coverage verifies single-group routing, multi-group routing, duplicate group IDs, and clearing the current graph when no group scope is supplied. The tests use GraphDriver mocks and do not require a live FalkorDB.

Breaking Changes

  • This PR contains breaking changes

Checklist

  • Code follows project style guidelines (make lint equivalent commands pass)
  • Self-review completed
  • Documentation updated where necessary
  • No secrets or sensitive information committed

Related Issues

Addresses the clear_graph path in #1651.

@zep-cla-assistant

zep-cla-assistant Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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

@d3f4w2

d3f4w2 commented Jul 30, 2026

Copy link
Copy Markdown
Author

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

@d3f4w2

d3f4w2 commented Jul 30, 2026

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 Jul 30, 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.

1 participant