pub struct SmeltMemory { /* private fields */ }Expand description
Main memory system for Smelt
Implementations§
Source§impl SmeltMemory
impl SmeltMemory
Sourcepub fn open(path: &Path) -> MemoryResult<Self>
pub fn open(path: &Path) -> MemoryResult<Self>
Open or create a memory system in the given directory
Sourcepub fn in_memory() -> MemoryResult<Self>
pub fn in_memory() -> MemoryResult<Self>
Create an in-memory instance for testing
Sourcepub fn with_project(self, project: String) -> Self
pub fn with_project(self, project: String) -> Self
Set the current project
Sourcepub fn capture_from_intent(
&mut self,
intent: &IntentRecord,
outcome: EpisodeOutcome,
files_modified: Vec<String>,
errors_resolved: Vec<ErrorResolution>,
tags: Vec<String>,
commit_sha: Option<String>,
) -> MemoryResult<Uuid>
pub fn capture_from_intent( &mut self, intent: &IntentRecord, outcome: EpisodeOutcome, files_modified: Vec<String>, errors_resolved: Vec<ErrorResolution>, tags: Vec<String>, commit_sha: Option<String>, ) -> MemoryResult<Uuid>
Capture an episode from an intent and its outcome
Sourcepub fn capture(&mut self, episode: Episode) -> MemoryResult<Uuid>
pub fn capture(&mut self, episode: Episode) -> MemoryResult<Uuid>
Capture an episode directly
Sourcepub fn retrieve(
&self,
query: &str,
limit: usize,
) -> MemoryResult<Vec<RankedEpisode>>
pub fn retrieve( &self, query: &str, limit: usize, ) -> MemoryResult<Vec<RankedEpisode>>
Retrieve relevant episodes for a query
Sourcepub fn record_feedback(
&mut self,
episode_id: Uuid,
helpful: bool,
) -> MemoryResult<()>
pub fn record_feedback( &mut self, episode_id: Uuid, helpful: bool, ) -> MemoryResult<()>
Record feedback for an episode
Sourcepub fn propagate_utility(
&mut self,
temporal: bool,
) -> MemoryResult<PropagationResult>
pub fn propagate_utility( &mut self, temporal: bool, ) -> MemoryResult<PropagationResult>
Run utility propagation to spread value through the memory
Sourcepub fn get_episode(&self, id: Uuid) -> MemoryResult<Option<Episode>>
pub fn get_episode(&self, id: Uuid) -> MemoryResult<Option<Episode>>
Get an episode by ID
Sourcepub fn list_episodes(&self) -> MemoryResult<Vec<Episode>>
pub fn list_episodes(&self) -> MemoryResult<Vec<Episode>>
List all episodes
Sourcepub fn stats(&self) -> MemoryResult<MemoryStats>
pub fn stats(&self) -> MemoryResult<MemoryStats>
Get memory statistics
Auto Trait Implementations§
impl !RefUnwindSafe for SmeltMemory
impl !UnwindSafe for SmeltMemory
impl Freeze for SmeltMemory
impl Send for SmeltMemory
impl Sync for SmeltMemory
impl Unpin for SmeltMemory
impl UnsafeUnpin for SmeltMemory
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more