Public declaration syntax from forge-rs/crates/forge-memory/src/store.rs Original source SHA-256: 891a698c5a2bd9f1286b7d5ad5e05203c91f48c9f225d66d16bde5acb5732477 Function bodies and constant values are omitted. This is not the complete implementation. Source line 37 #[async_trait] pub trait MemoryStore: Send + Sync { /// Stores a memory entry and returns its ID. /// /// # Errors /// /// Returns `MemoryError::StoreError` if the backend fails. async fn store(&self, entry: MemoryEntry) -> MemoryResult; /// Searches for memories matching the query. /// /// Returns entries sorted by relevance (best match first). /// /// # Errors /// /// Returns `MemoryError::StoreError` if the backend fails. async fn recall(&self, query: &MemoryQuery) -> MemoryResult>; /// Retrieves a specific memory entry by ID. /// /// # Errors /// /// Returns `MemoryError::NotFound` if the entry does not exist. async fn get(&self, id: &MemoryId) -> MemoryResult; /// Deletes a memory entry by ID. /// /// # Errors /// /// Returns `MemoryError::NotFound` if the entry does not exist. async fn delete(&self, id: &MemoryId) -> MemoryResult<()>; /// Lists all memories in a given scope. /// /// # Errors /// /// Returns `MemoryError::StoreError` if the backend fails. async fn list_by_scope(&self, scope: MemoryScope) -> MemoryResult>; /// Returns the total number of stored entries. async fn count(&self) -> MemoryResult; } Source line 104 pub struct InMemoryStore { } Source line 110 pub fn new() -> Self; Source line 276 pub struct AgentMemory { } Source line 292 pub fn new( agent_id: impl Into, store: Box, retrieval_policy: RetrievalPolicy, write_back_policy: WriteBackPolicy, ) -> Self; Source line 307 pub fn agent_id(&self) -> &str; Source line 312 pub fn retrieval_policy(&self) -> &RetrievalPolicy; Source line 317 pub fn write_back_policy(&self) -> &WriteBackPolicy; Source line 327 pub async fn store(&mut self, entry: MemoryEntry) -> MemoryResult; Source line 365 pub async fn recall(&self, query_text: &str, limit: usize) -> MemoryResult>; Source line 390 pub async fn recall_with_query(&self, query: &MemoryQuery) -> MemoryResult>; Source line 411 pub async fn get(&self, id: &MemoryId) -> MemoryResult; Source line 440 pub async fn delete(&self, id: &MemoryId) -> MemoryResult<()>; Source line 445 pub async fn count(&self) -> MemoryResult;