feat(graph): add bi-temporal fact search - #28
Open
DivyamTalwar wants to merge 1 commit into
Open
Conversation
Owner
Author
Verification checkpoint
Semantics reviewed: relation observations are idempotent per source-memory triplet, later observations preserve history, valid intervals are start-inclusive/end-exclusive, and observation time is independently gated. Live Neo4j latency remains an explicit evidence gap; no performance claim is being made. This PR remains intentionally open and unmerged. |
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.
Why
JITMIND already writes
t_observed,t_valid, andt_invalidonto extracted graph relations, but no public graph API could apply those timestamps during retrieval. Worse, a repeated(head, relation, tail)could overwrite the prior relation observation, erasing the history needed for time-travel answers.What changed
GraphFactevidence with source memory/page and full temporal intervalGraphMemoryStore.query_facts(...)with entity, relation-type, namespace, valid-time, and observation-time filtersGraphRetriever.search_temporal(...)so temporal facts flow through the existingHitcontractCompetitive rationale / provenance
Graphiti publicly models dynamic memory as episodes and facts whose
valid_at/invalid_atfields can be filtered during fact search: https://github.com/getzep/graphiti and https://github.com/getzep/graphiti/blob/main/mcp_server/src/graphiti_mcp_server.pyThis PR implements that missing capability using JITMIND's own
Memory,Entity, andRELATIONschema and adds an explicit observation-time gate. No Graphiti code was copied.Evidence
python -m pytest -q→ 42 passedpython -m compileall -q jitmind→ passEvidence gap
The Cypher contract is tested through a deterministic driver boundary. A live Neo4j latency benchmark is intentionally not claimed because this runner has no authoritative production graph dataset or Neo4j deployment.
Review notes
This is an independent proposal targeting
main; it does not depend on PR #27. Please keep it open for review and comparison.