fix(falkordb): respect reference_time in retrieve_episodes#1626
Open
pcy06 wants to merge 2 commits into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
pcy06
force-pushed
the
fix/falkordb-retrieve-episodes-reference-time
branch
from
July 2, 2026 01:41
4fec77c to
539dfc3
Compare
pcy06
force-pushed
the
fix/falkordb-retrieve-episodes-reference-time
branch
from
July 2, 2026 01:45
539dfc3 to
7b4c5da
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: pcy06@kakao.com |
Author
|
recheck |
pcy06
marked this pull request as ready for review
July 2, 2026 01:58
Contributor
|
@pcy06 Good catch on reference_time! The legacy retrieve_episodes path in utils/maintenance has the same bug and isn't covered. Patching that too would make this complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes FalkorDB episode retrieval so
retrieve_episodes(reference_time=...)does not return episodes whosevalid_atis after the requested reference time.The FalkorDB query now projects
e.valid_at <= $reference_timeinto a boolean withWITHand filters on that value. This avoids a FalkorDB directWHERE e.valid_at <= $reference_timepath that can return rows even when the same predicate projects asFalse.Type of Change
Objective
This is a bug fix for the FalkorDB driver. Point-in-time episode retrieval is documented to return only episodes at or before
reference_time; future episodes leaking into the result can affect the context Graphiti uses for subsequent episode ingestion.The change is intentionally limited to
FalkorEpisodeNodeOperations.retrieve_episodesand the corresponding driver tests.Testing
Commands run:
uv run pytest tests/driver/test_falkordb_driver.py -q DISABLE_FALKORDB=1 DISABLE_KUZU=1 DISABLE_NEPTUNE=1 uv run pytest tests/driver/test_falkordb_driver.py -q -m 'not integration' make lintBreaking Changes
If this is a breaking change, describe:
Checklist
make lintpasses)Related Issues
Closes #1625