Skip to content

fix: avoid FalkorDB edge rematch scans#1494

Closed
mturac wants to merge 1 commit into
getzep:mainfrom
mturac:fix/issue-1272-falkor-edge-endpoints
Closed

fix: avoid FalkorDB edge rematch scans#1494
mturac wants to merge 1 commit into
getzep:mainfrom
mturac:fix/issue-1272-falkor-edge-endpoints

Conversation

@mturac

@mturac mturac commented May 16, 2026

Copy link
Copy Markdown

Summary

Avoids the FalkorDB edge search re-MATCH pattern that scans RELATES_TO edges by uuid after the full-text procedure or BFS path traversal has already produced the relationship.

The full-text path now uses the returned relationship directly, and the BFS path filters path relationships to RELATES_TO before deriving source/target nodes with startNode / endNode.

Type of Change

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

Objective

Fix the FalkorDB edge search query shape described in #1272 so edge endpoint lookup is linear in the returned relationships instead of forcing a relationship re-scan by UUID.

Testing

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

Validation run:

  • DISABLE_FALKORDB=1 DISABLE_KUZU=1 DISABLE_NEPTUNE=1 uv run pytest tests/driver/test_falkordb_search_ops.py
  • uv run ruff format graphiti_core/driver/falkordb/operations/search_ops.py tests/driver/test_falkordb_search_ops.py --check
  • uv run ruff check graphiti_core/driver/falkordb/operations/search_ops.py tests/driver/test_falkordb_search_ops.py
  • git diff --check

Breaking Changes

  • This PR contains breaking changes

Checklist

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

Related Issues

Closes #1272

danielchalef added a commit to jaredloman/graphiti that referenced this pull request Jun 9, 2026
DB-free query-shape regression test asserting edge_fulltext_search and
edge_bfs_search derive endpoints via startNode/endNode instead of the
O(matches×graph) re-MATCH by uuid. Placed at tests/ root (not tests/driver/,
which the unit-test workflow ignores) so it runs in CI; falkordb is installed
there via `uv sync --all-extras`.

Harvested from getzep#1494 (credit @mturac) and adapted to this PR's BFS rewrite
(type(e) guard after rebinding rel -> e).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielchalef

Copy link
Copy Markdown
Member

Thanks for this — your startNode/endNode approach is exactly right, and I've harvested your query-shape test (tests/driver/test_falkordb_search_ops.py) into #1500 with credit. Consolidating on #1500 because it also patches graphiti_core/search/search_utils.py — the path that actually runs on main (FalkorDriver doesn't set search_interface), so a driver-only fix wouldn't reach the live query. Closing as superseded by #1500.

@zep-cla-assistant zep-cla-assistant Bot locked and limited conversation to collaborators Jun 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [PERF] FalkorDB: edge_fulltext_search causes full graph scan due to re-MATCH pattern instead of using startNode/endNode

2 participants