pub struct WorkingNote {
pub content: String,
pub category: NoteCategory,
pub created_at: String,
pub relevance: f64,
}Expand description
A note the agent writes to itself during execution.
Like a human jotting thoughts while working. Notes have a category for structured queries and a relevance score that can decay over time.
§Example
use pe_core::cognitive_memory::{WorkingNote, NoteCategory};
let note = WorkingNote::new(
"User prefers concise responses",
NoteCategory::Observation,
);
assert_eq!(note.relevance, 1.0);Fields§
§content: StringThe note content.
category: NoteCategoryClassification for structured queries.
created_at: StringISO 8601 timestamp when the note was created.
relevance: f64Relevance score — 1.0 = just created, decays toward 0.0 over time.
Implementations§
Source§impl WorkingNote
impl WorkingNote
Sourcepub fn new(content: impl Into<String>, category: NoteCategory) -> Self
pub fn new(content: impl Into<String>, category: NoteCategory) -> Self
Create a new working note with full relevance.
Sourcepub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
pub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
Create a note with a specific timestamp.
If not called, created_at will be empty — meaning “unknown creation time”.
Callers are responsible for setting timestamps when recency matters.
Trait Implementations§
Source§impl Clone for WorkingNote
impl Clone for WorkingNote
Source§fn clone(&self) -> WorkingNote
fn clone(&self) -> WorkingNote
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkingNote
impl Debug for WorkingNote
Source§impl<'de> Deserialize<'de> for WorkingNote
impl<'de> Deserialize<'de> for WorkingNote
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WorkingNote
impl PartialEq for WorkingNote
Source§fn eq(&self, other: &WorkingNote) -> bool
fn eq(&self, other: &WorkingNote) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for WorkingNote
impl Serialize for WorkingNote
impl StructuralPartialEq for WorkingNote
Auto Trait Implementations§
impl Freeze for WorkingNote
impl RefUnwindSafe for WorkingNote
impl Send for WorkingNote
impl Sync for WorkingNote
impl Unpin for WorkingNote
impl UnsafeUnpin for WorkingNote
impl UnwindSafe for WorkingNote
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
Mutably borrows from an owned value. Read more