Skip to content

feat(memory): temporal versioning on graph memory edges#1775

Merged
bug-ops merged 4 commits intomainfrom
temporal-versioning-on-graph-m
Mar 14, 2026
Merged

feat(memory): temporal versioning on graph memory edges#1775
bug-ops merged 4 commits intomainfrom
temporal-versioning-on-graph-m

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 14, 2026

Summary

  • Add valid_from/valid_until temporal query support to graph memory edges
  • New GraphStore methods: edges_at_timestamp(), bfs_at_timestamp(), edge_history() with shared bfs_core() helper
  • graph_recall gains optional at_timestamp and temporal_decay_rate parameters (defaults keep existing behavior unchanged)
  • GraphFact gains valid_from field and score_with_decay() for recency-boosted ranking
  • Migration 030: two partial indexes on graph_edges optimized for temporal BFS traversal
  • temporal_decay_rate config knob in [memory.graph] (default 0.0 = disabled)

Closes #1341

Test plan

  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 5559 tests pass
  • cargo clippy --workspace --features full -- -D warnings — 0 warnings
  • cargo +nightly fmt --check — clean
  • Verify at_timestamp = None + temporal_decay_rate = 0.0 produce identical output to previous behavior
  • Verify edges_at_timestamp(ts) returns only edges with valid_from <= ts AND (valid_to IS NULL OR valid_to > ts)
  • Verify edge_history returns all versions of a (subject, predicate) pair including superseded ones

@github-actions github-actions bot added enhancement New feature or request size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes core zeph-core crate and removed enhancement New feature or request size/XL Extra large PR (500+ lines) labels Mar 14, 2026
@github-actions github-actions bot added enhancement New feature or request size/XL Extra large PR (500+ lines) labels Mar 14, 2026
bug-ops added 2 commits March 14, 2026 20:36
Add valid_from/valid_until temporal support to graph memory via:

- Migration 030: two partial indexes on graph_edges for temporal BFS traversal
- GraphStore: edges_at_timestamp(), bfs_at_timestamp(), edge_history() backed by
  shared bfs_core() helper that eliminates BFS code duplication
- graph_recall: optional at_timestamp parameter and temporal_decay_rate scoring
  (default 0.0 preserves existing behavior unchanged)
- GraphFact: valid_from field + score_with_decay() for recency-boosted ranking
- GraphConfig: temporal_decay_rate config knob (default 0.0, in default.toml)
- recall_graph: propagates at_timestamp and temporal_decay_rate through

Closes #1341
@bug-ops bug-ops force-pushed the temporal-versioning-on-graph-m branch from 37ccb73 to 7036411 Compare March 14, 2026 19:36
@bug-ops bug-ops enabled auto-merge (squash) March 14, 2026 19:36
@bug-ops bug-ops merged commit 8b62bfe into main Mar 14, 2026
15 checks passed
@bug-ops bug-ops deleted the temporal-versioning-on-graph-m branch March 14, 2026 19:50
bug-ops added a commit that referenced this pull request Mar 14, 2026
…ory, bfs_at_timestamp

Add 14 unit tests covering boundary conditions and happy paths for three
methods added in #1775:

- edges_at_timestamp: valid_from==ts inclusive, valid_to==ts exclusive
  (with ts-1s boundary pair), multiple edges on same entity, no-edge entity
- edge_history: basic ordering, limit truncation (with pre-condition proof),
  non-matching relation, empty entity, fact substring filtering (subset proof)
- bfs_at_timestamp: zero hops, expired intermediate blocks traversal,
  disconnected entity, reverse direction, valid_to==ts exclusive boundary

Closes #1776
bug-ops added a commit that referenced this pull request Mar 14, 2026
…ory, bfs_at_timestamp

Add 14 unit tests covering boundary conditions and happy paths for three
methods added in #1775:

- edges_at_timestamp: valid_from==ts inclusive, valid_to==ts exclusive
  (with ts-1s boundary pair), multiple edges on same entity, no-edge entity
- edge_history: basic ordering, limit truncation (with pre-condition proof),
  non-matching relation, empty entity, fact substring filtering (subset proof)
- bfs_at_timestamp: zero hops, expired intermediate blocks traversal,
  disconnected entity, reverse direction, valid_to==ts exclusive boundary

Closes #1776
bug-ops added a commit that referenced this pull request Mar 14, 2026
…ory, bfs_at_timestamp (#1784)

Add 14 unit tests covering boundary conditions and happy paths for three
methods added in #1775:

- edges_at_timestamp: valid_from==ts inclusive, valid_to==ts exclusive
  (with ts-1s boundary pair), multiple edges on same entity, no-edge entity
- edge_history: basic ordering, limit truncation (with pre-condition proof),
  non-matching relation, empty entity, fact substring filtering (subset proof)
- bfs_at_timestamp: zero hops, expired intermediate blocks traversal,
  disconnected entity, reverse direction, valid_to==ts exclusive boundary

Closes #1776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporal versioning on graph memory edges

1 participant