pub struct MemoryEntry {
pub id: String,
pub created_at: DateTime<Utc>,
pub last_referenced: DateTime<Utc>,
pub category: MemoryCategory,
pub content: String,
pub source_session: Option<String>,
pub project_path: Option<String>,
pub reference_count: u32,
pub importance: f64,
pub tags: Vec<String>,
pub is_manual: bool,
}Expand description
A single memory entry.
Fields§
§id: StringUnique identifier.
created_at: DateTime<Utc>When the memory was created.
last_referenced: DateTime<Utc>When the memory was last accessed/referenced.
category: MemoryCategoryCategory of the memory.
content: StringThe memory content.
source_session: Option<String>Source session ID (where this memory was created).
project_path: Option<String>Project path where this memory was created.
reference_count: u32Number of times this memory has been referenced.
importance: f64Importance score (0-100, higher = more important).
Tags for searching/filtering.
is_manual: boolWhether this memory was manually added by user.
Implementations§
Source§impl MemoryEntry
impl MemoryEntry
Sourcepub fn new(
category: MemoryCategory,
content: String,
source_session: Option<String>,
project_path: Option<String>,
) -> Self
pub fn new( category: MemoryCategory, content: String, source_session: Option<String>, project_path: Option<String>, ) -> Self
Create a new memory entry.
Sourcepub fn manual(
category: MemoryCategory,
content: String,
project_path: Option<String>,
) -> Self
pub fn manual( category: MemoryCategory, content: String, project_path: Option<String>, ) -> Self
Create a manually added memory entry.
Sourcepub fn manual_global(category: MemoryCategory, content: String) -> Self
pub fn manual_global(category: MemoryCategory, content: String) -> Self
Create a manually added memory entry (global, no project path).
Sourcepub fn mark_referenced(&mut self)
pub fn mark_referenced(&mut self)
Mark this memory as referenced (increases importance over time).
Sourcepub fn mark_referenced_with_increment(&mut self, increment: f64)
pub fn mark_referenced_with_increment(&mut self, increment: f64)
Mark this memory as referenced with custom importance increment.
Sourcepub fn format_line(&self) -> String
pub fn format_line(&self) -> String
Format for display.
Sourcepub fn format_for_prompt(&self) -> String
pub fn format_for_prompt(&self) -> String
Format for inclusion in system prompt. Note: This is used inside category groups, so we don’t repeat the category name.
Sourcepub fn format_for_prompt_with_category(&self) -> String
pub fn format_for_prompt_with_category(&self) -> String
Format for inclusion in system prompt with category name. Use this when displaying entries outside of category groups.
Trait Implementations§
Source§impl Clone for MemoryEntry
impl Clone for MemoryEntry
Source§fn clone(&self) -> MemoryEntry
fn clone(&self) -> MemoryEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more