pub struct ReflexionMemory { /* private fields */ }Expand description
Memory store for reflexion episodes.
Implementations§
Source§impl ReflexionMemory
impl ReflexionMemory
Sourcepub fn add_episode(&mut self, episode: ReflexionEpisode)
pub fn add_episode(&mut self, episode: ReflexionEpisode)
Add an episode to memory.
Sourcepub fn find_similar_failures(
&self,
task: &str,
limit: usize,
) -> Vec<ReflexionEpisode>
pub fn find_similar_failures( &self, task: &str, limit: usize, ) -> Vec<ReflexionEpisode>
Find similar past failures for a given task.
This uses simple keyword matching. In production, use embedding similarity.
Sourcepub fn get_by_type(&self, task_type: &str) -> Vec<&ReflexionEpisode>
pub fn get_by_type(&self, task_type: &str) -> Vec<&ReflexionEpisode>
Get all episodes of a specific type.
Sourcepub fn recent_failures(&self, limit: usize) -> Vec<&ReflexionEpisode>
pub fn recent_failures(&self, limit: usize) -> Vec<&ReflexionEpisode>
Get recent failures.
Sourcepub fn failure_count(&self) -> usize
pub fn failure_count(&self) -> usize
Count of failed episodes.
Sourcepub fn success_rate(&self) -> f32
pub fn success_rate(&self) -> f32
Success rate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReflexionMemory
impl RefUnwindSafe for ReflexionMemory
impl Send for ReflexionMemory
impl Sync for ReflexionMemory
impl Unpin for ReflexionMemory
impl UnsafeUnpin for ReflexionMemory
impl UnwindSafe for ReflexionMemory
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request