Skip to content

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

Open
Solaris-star wants to merge 2 commits into
getzep:mainfrom
Solaris-star:fix/1659-falkor-single-group-search
Open

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

Conversation

@Solaris-star

Copy link
Copy Markdown

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
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.

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.

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

2 participants