pub struct MemoryCard {Show 17 fields
pub id: u64,
pub kind: MemoryKind,
pub entity: String,
pub slot: String,
pub value: String,
pub polarity: Option<Polarity>,
pub event_date: Option<i64>,
pub document_date: Option<i64>,
pub version_key: Option<String>,
pub version_relation: VersionRelation,
pub source_frame_id: u64,
pub source_uri: Option<String>,
pub source_offset: Option<(usize, usize)>,
pub engine: String,
pub engine_version: String,
pub confidence: Option<f32>,
pub created_at: i64,
}Expand description
Re-exports of the memvid-core memory-card surface that
MemvidStore returns from
MemvidStore::entity_memories and friends. Re-exported here so
callers do not need a direct memvid-core dependency just to name
the structured-memory types.
A structured memory unit extracted from conversation content.
Memory cards represent atomic facts, preferences, events, or other information extracted from raw text. They support:
- Identity: What entity/slot this card describes
- Value: The actual information
- Temporality: When this was true (event time) vs when recorded (document time)
- Provenance: Which frame/chunk it came from, which engine extracted it
- Versioning: How this card relates to prior knowledge
Fields§
§id: u64Unique identifier within this MV2 file.
kind: MemoryKindWhat kind of memory this represents.
entity: StringThe entity this memory is about (e.g., “user”, “user.team”, “project.memvid”).
slot: StringThe attribute/slot being described (e.g., “employer”, “favorite_food”, “location”).
value: StringThe actual value (always stored as string, can be JSON for complex values).
polarity: Option<Polarity>Sentiment/polarity for preferences.
event_date: Option<i64>When the event/fact occurred (not when it was recorded). For events: the event date. For facts: when this became true (if known).
document_date: Option<i64>When this information was recorded (from the source document/conversation).
version_key: Option<String>Versioning: key to group related cards (usually entity:slot).
version_relation: VersionRelationHow this relates to prior versions.
source_frame_id: u64Reference to the source frame this was extracted from.
source_uri: Option<String>URI of the source (for provenance).
source_offset: Option<(usize, usize)>Character offset within source frame (start, end) for highlighting.
engine: StringWhich engine produced this card.
engine_version: StringVersion of the engine.
confidence: Option<f32>Confidence score (0.0-1.0) if from probabilistic engine.
created_at: i64When this card was created (Unix timestamp).
Implementations§
Source§impl MemoryCard
impl MemoryCard
Sourcepub fn default_version_key(&self) -> String
pub fn default_version_key(&self) -> String
Generate the default version key from entity and slot.
Sourcepub fn supersedes(&self, other: &MemoryCard) -> bool
pub fn supersedes(&self, other: &MemoryCard) -> bool
Check if this card supersedes another based on version relation and timestamps.
Sourcepub fn effective_timestamp(&self) -> i64
pub fn effective_timestamp(&self) -> i64
Get the effective timestamp for temporal ordering.
Sourcepub fn is_retracted(&self) -> bool
pub fn is_retracted(&self) -> bool
Check if this card is a retraction.
Trait Implementations§
Source§impl Clone for MemoryCard
impl Clone for MemoryCard
Source§fn clone(&self) -> MemoryCard
fn clone(&self) -> MemoryCard
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MemoryCard
impl Debug for MemoryCard
Source§impl<'de> Deserialize<'de> for MemoryCard
impl<'de> Deserialize<'de> for MemoryCard
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemoryCard, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MemoryCard, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for MemoryCard
impl Serialize for MemoryCard
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for MemoryCard
impl RefUnwindSafe for MemoryCard
impl Send for MemoryCard
impl Sync for MemoryCard
impl Unpin for MemoryCard
impl UnsafeUnpin for MemoryCard
impl UnwindSafe for MemoryCard
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 more