Skip to main content

Memory

Struct Memory 

Source
pub struct Memory {
Show 15 fields pub pid: String, pub scope: Scope, pub content: String, pub metadata: Value, pub kind: MemoryKind, pub source_pid: Option<String>, pub supersession: Option<SupersessionInfo>, pub created_at: DateTime<FixedOffset>, pub updated_at: DateTime<FixedOffset>, pub event_at: Option<DateTime<FixedOffset>>, pub score: Option<f32>, pub status: IndexStatus, pub confidence: Confidence, pub category: Option<String>, pub retirement: Option<RetirementReason>,
}
Expand description

A stored memory, with optional similarity score from vector search.

Carries three distinct timestamps that should not be confused: created_at (when memoir was told), updated_at (last in-place edit), and event_at (when the remembered event actually occurred). The first two are wall-clock; the third is event-time and may predate created_at by arbitrary amounts.

Soft-deletion via SupersessionInfo keeps superseded rows in the store, but crate::client::Client::search filters them out by default. They remain reachable via crate::client::Client::recall.

Fields§

§pid: String

Public id; opaque, stable for the lifetime of the row.

§scope: Scope

Tenant + agent + user partition. See Scope.

§content: String

Raw text of the memory.

§metadata: Value

Arbitrary JSON attached at write time; round-trips unchanged.

§kind: MemoryKind

Episodic (raw utterance) or semantic (LLM-extracted fact).

§source_pid: Option<String>

Originating episodic pid for semantic rows; None for episodic.

Enforced at the database with ON DELETE CASCADE: forgetting the source automatically removes derived semantic memories.

§supersession: Option<SupersessionInfo>

Soft-deletion marker; None when active.

Populated by contradiction-detection passes or operator action. The nested type ties winner pid and decision time together so neither can exist without the other.

§created_at: DateTime<FixedOffset>

Wall-clock time memoir received the utterance.

§updated_at: DateTime<FixedOffset>

Wall-clock time of the row’s last in-place mutation.

Auto-bumped by the database trigger on every UPDATE. Equals created_at for memories never edited via crate::client::Client::edit.

§event_at: Option<DateTime<FixedOffset>>

Event-time of the thing being remembered; None when unknown.

Distinct from created_at: “the deployment happened Friday” said today carries event_at = Friday, created_at = today. Set by consumers via RememberBuilder::event_at or by LLM extraction. None is appropriate when no event-time is meaningful (preferences, identity facts).

§score: Option<f32>

Cosine similarity score; Some only on vector-search results.

§status: IndexStatus

Processing lifecycle state of the row’s vector index.

Pending immediately after a write (embedding + vector upsert in flight), Indexed once searchable, Failed if embedding errored. Mirrors the memories.qdrant_status column. Consumers use this as the canonical “is this memory fully processed yet” signal.

§confidence: Confidence

How sure memoir is that this memory is true, as a 0-100 percentage.

Episodic memories are 100 by construction — the user said it. Semantic memories carry the extraction LLM’s scaled per-fact score (populated by the extract worker). See Confidence. Feeds the selection blend as a signal (normalized to [0, 1]) and the min_confidence hard filter — see crate::client::BlendWeights.

§category: Option<String>

Categorization label, or None until the categorize worker runs.

Populated asynchronously by the NLI categorize stage. A None category is unfiltered, not rejected — absence means “not yet classified,” not “no category applies.” The value set (taxonomy) is owned by the categorize worker, so this stays an open String here; the v1 labels are preference, identity, workflow, factual, transient (see crate::client::categorize). Drives the category-bonus term of the selection blend (crate::client::BlendWeights) and the category hard filter on search/query.

§retirement: Option<RetirementReason>

Why this memory was retired, or None when active (epic 0011).

Set by the correction model (crate::client::Client::reject / mark_stale). A Some(_) row is hidden from all reads and its vector is evicted; the row is kept for the reprocess guard and the extraction-accuracy metric (crate::client::Client::extraction_stats), where only RetirementReason::Rejected counts as an error. Distinct from Self::supersession. “Active” requires both this and supersession to be None.

Trait Implementations§

Source§

impl Clone for Memory

Source§

fn clone(&self) -> Memory

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Memory

Source§

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

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

impl TryFrom<&QueryResult> for Memory

Source§

type Error = StoreError

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

fn try_from(row: &QueryResult) -> Result<Self, Self::Error>

Performs the conversion.

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more