pub struct TemporalEdge {
pub id: Uuid,
pub src: Uuid,
pub dst: Uuid,
pub relation: String,
pub valid_from: DateTime<Utc>,
pub valid_to: Option<DateTime<Utc>>,
pub confidence: f32,
pub recorded_at: DateTime<Utc>,
}Expand description
One bitemporal edge in the graph.
valid_from / valid_to are fact validity — when the relation
is true in the world. recorded_at is when the row was written
to the database. The two clocks lets us reconstruct an “as_of”
view that asks “what did we believe at time T?” without losing
later corrections.
relation is a free-form string today ("works_at",
"located_in", "reports_to"). Once the LLM extractor lands we
may pin it to a small enum, but doing that without real corpus
data risks codifying the wrong relation set.
Fields§
§id: Uuid§src: Uuid§dst: Uuid§relation: String§valid_from: DateTime<Utc>§valid_to: Option<DateTime<Utc>>None means “still true” — open-ended interval.
confidence: f32In [0.0, 1.0]. Higher confidences supersede lower ones during
conflict resolution; ties go to the more recent recorded_at.
recorded_at: DateTime<Utc>Audit-replay clock — when we wrote the row, regardless of the fact’s own validity window.
Implementations§
Source§impl TemporalEdge
impl TemporalEdge
Sourcepub fn extract(
_content: &str,
_prior_edges: &[TemporalEdge],
) -> Vec<TemporalEdge>
pub fn extract( _content: &str, _prior_edges: &[TemporalEdge], ) -> Vec<TemporalEdge>
Extract edges from content given prior_edges for the same
subject.
Today: stub that returns an empty Vec. The
MNEMO_GRAPH_EXTRACT_MODEL env var (default
claude-haiku-4-5-20251001) is documented but not yet read.
prior_edges is accepted in the signature so call-sites don’t
have to change once the real extractor lands.
Source§impl TemporalEdge
impl TemporalEdge
Sourcepub fn new(
src: Uuid,
dst: Uuid,
relation: impl Into<String>,
valid_from: DateTime<Utc>,
valid_to: Option<DateTime<Utc>>,
confidence: f32,
) -> Self
pub fn new( src: Uuid, dst: Uuid, relation: impl Into<String>, valid_from: DateTime<Utc>, valid_to: Option<DateTime<Utc>>, confidence: f32, ) -> Self
Convenience constructor; sets id = Uuid::now_v7() and
recorded_at = Utc::now(). Most call-sites should use this
rather than building the struct directly.
Trait Implementations§
Source§impl Clone for TemporalEdge
impl Clone for TemporalEdge
Source§fn clone(&self) -> TemporalEdge
fn clone(&self) -> TemporalEdge
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more