Skip to content

fix(falkordb): route single group_id search to the matching graph#1670

Merged
prasmussen15 merged 3 commits into
getzep:mainfrom
Solaris-star:fix/1659-falkor-single-group-search
Jul 23, 2026
Merged

fix(falkordb): route single group_id search to the matching graph#1670
prasmussen15 merged 3 commits into
getzep:mainfrom
Solaris-star:fix/1659-falkor-single-group-search

Conversation

@Solaris-star

Copy link
Copy Markdown
Contributor

Summary

On FalkorDB, add_episode re-binds self.driver when group_id differs from the driver's database, but @handle_multiple_group_ids only clones when len(group_ids) > 1. A single-group_id search in a fresh process therefore queries the default graph and silently returns nothing. Adding a second dummy group_id made search work — that was the tell.

Change

  • For FalkorDB with one group_id that differs from driver._database, pass a call-scoped driver.clone(database=gid) into the wrapped method (no shared-state reassignment)
  • Keep multi-group_id concurrent clone + merge behavior
  • Unit tests covering single/multi/same-db/non-Falkor paths

Test plan

  • pytest tests/test_handle_multiple_group_ids.py -q → 4 passed
  • CI full suite

Fixes #1659

handle_multiple_group_ids only cloned the driver when len(group_ids) > 1.
add_episode re-binds self.driver for writes, so a fresh process searching
one group_id hit the driver's default database and returned empty results.

Clone call-scoped for a single differing group_id as well; do not reassign
the shared driver.

Fixes getzep#1659
@zep-cla-assistant

zep-cla-assistant Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

@Solaris-star

Copy link
Copy Markdown
Contributor Author

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

zep-cla-assistant Bot added a commit that referenced this pull request Jul 20, 2026
@Naseem77

Copy link
Copy Markdown
Contributor

@Solaris-star Verified live: single-group retrieve_episodes and search_ returned nothing on main and return correct results with your patch, and the call-scoped clone avoids the shared-state mutation that broke earlier attempts. This supersedes #1326/#1572/#1170 nicely.

@prasmussen15
prasmussen15 self-requested a review July 23, 2026 00:21
@prasmussen15
prasmussen15 merged commit 4674e1e into getzep:main Jul 23, 2026
12 of 13 checks passed
@zep-cla-assistant zep-cla-assistant Bot locked and limited conversation to collaborators Jul 23, 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.

FalkorDB: add_episode re-binds the driver but single-group_id search does not, so writes and reads use different graphs

3 participants