Skip to main content

MemoryChunk

Struct MemoryChunk 

Source
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: String

Time-ordered ID. uuid v7 in v1.

§created_at: DateTime<Utc>

When the chunk was written.

§kind: ChunkKind

Discriminator for kind-specific handling and retrieval filtering.

§tier: MemoryTier

Tier this chunk lives in: working (never persisted, so never seen here), session (recent), or long_term (aged out / summarized).

§source: ChunkSource

Where 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: String

Normalised caller — for example "agent", "mcp:codex", "gateway", "policy", "perception", "system".

§content: String

The human-readable text indexed by FTS and embedded.

§metadata: Value

Kind-specific structured fields.

§importance: f32

Importance score in [0, 1]. Drives eviction priority.

§pinned: bool

If true, never auto-evicted regardless of importance or age.

§shareable: bool

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: String

Name of the embedding model used (e.g. "bge-small-en-v1.5"). The v1 BasicMemoryProvider records "none" because it doesn’t embed.

§embedding_dim: u32

Dimensionality of the embedding. 0 for the v1 stub.

Trait Implementations§

Source§

impl Clone for MemoryChunk

Source§

fn clone(&self) -> MemoryChunk

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 MemoryChunk

Source§

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

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

impl<'de> Deserialize<'de> for MemoryChunk

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MemoryChunk

Source§

fn eq(&self, other: &MemoryChunk) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MemoryChunk

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MemoryChunk

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.