Skip to main content

TemporalEdge

Struct TemporalEdge 

Source
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: f32

In [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

Source

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

Source

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.

Source

pub fn valid_at(&self, as_of: DateTime<Utc>) -> bool

Is this edge valid at as_of?

valid_from <= as_of and (valid_to is None or as_of < valid_to).

Trait Implementations§

Source§

impl Clone for TemporalEdge

Source§

fn clone(&self) -> TemporalEdge

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TemporalEdge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TemporalEdge

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TemporalEdge

Source§

fn eq(&self, other: &TemporalEdge) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TemporalEdge

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TemporalEdge

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,