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: StringPublic id; opaque, stable for the lifetime of the row.
scope: ScopeTenant + agent + user partition. See Scope.
content: StringRaw text of the memory.
metadata: ValueArbitrary JSON attached at write time; round-trips unchanged.
kind: MemoryKindEpisodic (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: IndexStatusProcessing 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: ConfidenceHow 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 TryFrom<&QueryResult> for Memory
impl TryFrom<&QueryResult> for Memory
Source§type Error = StoreError
type Error = StoreError
Auto Trait Implementations§
impl Freeze for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request