pub struct OpenMemory { /* private fields */ }Expand description
OpenMemory - Main API
The primary interface for interacting with the memory system.
Implementations§
Source§impl OpenMemory
impl OpenMemory
Sourcepub async fn new(options: OpenMemoryOptions) -> Result<Self>
pub async fn new(options: OpenMemoryOptions) -> Result<Self>
Sourcepub async fn query(
&self,
query: &str,
options: QueryOptions,
) -> Result<Vec<HsgQueryResult>>
pub async fn query( &self, query: &str, options: QueryOptions, ) -> Result<Vec<HsgQueryResult>>
Query memories
Uses the HSG algorithm to find relevant memories.
§Arguments
query- Search queryoptions- Query options (k, filters, etc.)
Sourcepub async fn get_all(&self, limit: usize, offset: usize) -> Result<Vec<MemRow>>
pub async fn get_all(&self, limit: usize, offset: usize) -> Result<Vec<MemRow>>
Get all memories with pagination
Sourcepub async fn get_by_sector(
&self,
sector: &Sector,
limit: usize,
offset: usize,
) -> Result<Vec<MemRow>>
pub async fn get_by_sector( &self, sector: &Sector, limit: usize, offset: usize, ) -> Result<Vec<MemRow>>
Get memories by sector
Sourcepub async fn run_decay(&self) -> Result<DecayStats>
pub async fn run_decay(&self) -> Result<DecayStats>
Run decay on all memories
Sourcepub async fn reinforce(&self, id: &str, boost: Option<f64>) -> Result<()>
pub async fn reinforce(&self, id: &str, boost: Option<f64>) -> Result<()>
Reinforce a memory (increase salience)
Sourcepub fn embedding_info(&self) -> EmbeddingInfo
pub fn embedding_info(&self) -> EmbeddingInfo
Get embedding provider info
Auto Trait Implementations§
impl Freeze for OpenMemory
impl !RefUnwindSafe for OpenMemory
impl Send for OpenMemory
impl Sync for OpenMemory
impl Unpin for OpenMemory
impl !UnwindSafe for OpenMemory
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more