pub struct MemCube {Show 15 fields
pub id: String,
pub tier: MemoryTier,
pub kind: CognitionKind,
pub content: String,
pub source: String,
pub importance: f32,
pub confidence: f32,
pub decay_rate: f32,
pub caused_by: Vec<String>,
pub leads_to: Vec<String>,
pub evidence_for: Vec<String>,
pub created_at: u64,
pub last_accessed: u64,
pub access_count: u32,
pub session_id: Option<String>,
}Expand description
A MemCube is the fundamental unit of cognitive memory.
Each MemCube carries natural-language content, cognition metadata, importance/confidence scores, causal links, and lifecycle state. MemCubes are storage-agnostic — they can be persisted in Lance, redb, or plain files.
Fields§
§id: StringUnique identifier (typically a ULID).
tier: MemoryTierMemory tier classification.
kind: CognitionKindCognition phase that produced this memory.
content: StringNatural language content of the memory.
source: StringSource identifier (e.g., “filesystem”, “lance”, “session:XYZ”).
importance: f32Importance score (0.0 to 1.0), updated by access patterns.
confidence: f32Confidence score (0.0 to 1.0), how certain the information is.
decay_rate: f32Decay rate — how fast relevance fades without access.
caused_by: Vec<String>IDs of memories that caused this one.
leads_to: Vec<String>IDs of memories this one led to.
evidence_for: Vec<String>IDs of decisions this memory serves as evidence for.
created_at: u64Creation timestamp (microseconds since epoch).
last_accessed: u64Last access timestamp (microseconds since epoch).
access_count: u32Number of times this memory has been accessed.
session_id: Option<String>Session that created this memory (if applicable).
Implementations§
Source§impl MemCube
impl MemCube
Sourcepub fn new(
tier: MemoryTier,
kind: CognitionKind,
content: impl Into<String>,
source: impl Into<String>,
) -> Self
pub fn new( tier: MemoryTier, kind: CognitionKind, content: impl Into<String>, source: impl Into<String>, ) -> Self
Create a new MemCube with sensible defaults.