pub struct MemoryChunk {Show 16 fields
pub id: String,
pub created_at: DateTime<Utc>,
pub kind: ChunkKind,
pub tier: MemoryTier,
pub source: ChunkSource,
pub session_id: Option<String>,
pub project_root: Option<String>,
pub caller_id: String,
pub content: String,
pub metadata: Value,
pub importance: f32,
pub pinned: bool,
pub shareable: bool,
pub superseded_by: Option<String>,
pub embedding_model: String,
pub embedding_dim: u32,
}Expand description
A persisted memory unit.
Fields§
§id: StringTime-ordered ID. uuid v7 in v1.
created_at: DateTime<Utc>When the chunk was written.
kind: ChunkKindDiscriminator for kind-specific handling and retrieval filtering.
tier: MemoryTierTier this chunk lives in: working (never persisted, so never seen here), session (recent), or long_term (aged out / summarized).
source: ChunkSourceWhere the chunk came from.
session_id: Option<String>Conversation or delegated-job grouping. None for ambient chunks
like observations and rule firings.
project_root: Option<String>Working directory or project this chunk is scoped to, if known.
caller_id: StringNormalised caller — for example "agent", "mcp:codex",
"gateway", "policy", "perception", "system".
content: StringThe human-readable text indexed by FTS and embedded.
metadata: ValueKind-specific structured fields.
importance: f32Importance score in [0, 1]. Drives eviction priority.
pinned: boolIf true, never auto-evicted regardless of importance or age.
Cross-caller visibility flag. When true, the chunk surfaces to
every caller whose query uses crate::CallerScope::OwnPlusShared
(in addition to the writer’s own scope). When false (the default),
the chunk is only visible to its writer under Own/OwnPlusShared
and to privileged surfaces under Global. See crate::CallerScope
for the full visibility model.
superseded_by: Option<String>If non-None, the ID of a chunk that replaces this one (e.g. a
correction supersedes the original mistake).
embedding_model: StringName of the embedding model used (e.g. "bge-small-en-v1.5"). The v1
BasicMemoryProvider records "none" because it doesn’t embed.
embedding_dim: u32Dimensionality of the embedding. 0 for the v1 stub.
Trait Implementations§
Source§impl Clone for MemoryChunk
impl Clone for MemoryChunk
Source§fn clone(&self) -> MemoryChunk
fn clone(&self) -> MemoryChunk
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 MemoryChunk
impl Debug for MemoryChunk
Source§impl<'de> Deserialize<'de> for MemoryChunk
impl<'de> Deserialize<'de> for MemoryChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MemoryChunk
impl PartialEq for MemoryChunk
Source§fn eq(&self, other: &MemoryChunk) -> bool
fn eq(&self, other: &MemoryChunk) -> bool
self and other values to be equal, and is used by ==.