1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Bitemporal graph layer for Mnemo.
//!
//! Inspired by Graphiti ([repo](https://github.com/getzep/graphiti),
//! [paper](https://arxiv.org/abs/2501.13956)). The model is the same:
//! every edge carries `valid_from` / `valid_to` (when the *fact* is
//! true in the world) plus `recorded_at` (when the system saw it),
//! so historical queries can ask "what did we believe at time T?"
//! without losing later corrections.
//!
//! ```text
//! valid_from valid_to (None = still true)
//! ^ ^
//! | fact validity |
//! +-----------------------+
//! |
//! +-- recorded_at (when we wrote the row)
//! ```
//!
//! Today this crate ships:
//!
//! 1. The [`TemporalEdge`] type and a [`GraphStore`] async trait.
//! 2. A DuckDB-backed [`DuckGraphStore`] that creates `graph_nodes`
//! and `graph_edges` tables on first use and supports the round-trip
//! + bitemporal `as_of` walk needed by retrieval.
//! 3. [`graph_expand`] — bounded BFS that respects `as_of` filtering
//! and a maximum depth.
//!
//! The LLM-driven [`TemporalEdge::extract`] path is feature-gated under
//! `graph-extract` and currently returns an empty `Vec`. A real
//! extractor lands in v0.4.0 final once the prompt + ICL examples are
//! tuned.
pub use crateTemporalEdge;
pub use crate;
use ;
use ;
use Uuid;
use crateResult;
/// Bounded BFS from `seed` that respects bitemporal validity at
/// `as_of` and a max walk depth.
///
/// Returns every UUID reachable through edges whose
/// `valid_from <= as_of < valid_to.unwrap_or(MAX)`. Self-loops are
/// dropped. The seed is included in the returned set unless the
/// caller filters it out themselves.
pub async