pub struct HDF5Memory { /* private fields */ }Implementations§
Source§impl HDF5Memory
impl HDF5Memory
Sourcepub fn hybrid_search(
&mut self,
query_embedding: &[f32],
query_text: &str,
vector_weight: f32,
keyword_weight: f32,
k: usize,
) -> Vec<SearchResult>
pub fn hybrid_search( &mut self, query_embedding: &[f32], query_text: &str, vector_weight: f32, keyword_weight: f32, k: usize, ) -> Vec<SearchResult>
Perform hybrid search combining cosine vector similarity and BM25 keyword search.
Sourcepub fn get_chunk(&self, index: usize) -> Option<&str>
pub fn get_chunk(&self, index: usize) -> Option<&str>
Get the chunk text for a memory entry by index.
Sourcepub fn generate_agents_md(&self) -> String
pub fn generate_agents_md(&self) -> String
Generate an AGENTS.md string from current memory state.
Sourcepub fn write_agents_md(&self) -> Result<()>
pub fn write_agents_md(&self) -> Result<()>
Write AGENTS.md to disk alongside the .h5 file.
Sourcepub fn read_agents_md(path: &Path) -> Result<String>
pub fn read_agents_md(path: &Path) -> Result<String>
Read AGENTS.md from disk (if it exists).
Source§impl HDF5Memory
impl HDF5Memory
Sourcepub fn create(config: MemoryConfig) -> Result<Self>
pub fn create(config: MemoryConfig) -> Result<Self>
Create a new HDF5 memory file with the given configuration.
Sourcepub fn config(&self) -> &MemoryConfig
pub fn config(&self) -> &MemoryConfig
Get a reference to the config.
Sourcepub fn knowledge(&self) -> &KnowledgeCache
pub fn knowledge(&self) -> &KnowledgeCache
Get a reference to the knowledge cache.
Sourcepub fn knowledge_mut(&mut self) -> &mut KnowledgeCache
pub fn knowledge_mut(&mut self) -> &mut KnowledgeCache
Get a mutable reference to the knowledge cache.
Sourcepub fn add_entity(
&mut self,
name: &str,
entity_type: &str,
embedding_idx: i64,
) -> Result<u64>
pub fn add_entity( &mut self, name: &str, entity_type: &str, embedding_idx: i64, ) -> Result<u64>
Add an entity to the knowledge graph and flush.
Source§impl HDF5Memory
impl HDF5Memory
pub fn set_strategy(&mut self, s: Box<dyn MemoryStrategy>)
pub fn record(&mut self, exchange: Exchange) -> Result<StrategyOutput>
Source§impl HDF5Memory
impl HDF5Memory
Trait Implementations§
Source§impl AgentMemory for HDF5Memory
impl AgentMemory for HDF5Memory
fn save(&mut self, entry: MemoryEntry) -> Result<usize>
fn save_batch(&mut self, entries: Vec<MemoryEntry>) -> Result<Vec<usize>>
fn delete(&mut self, id: usize) -> Result<()>
fn compact(&mut self) -> Result<usize>
fn count(&self) -> usize
fn count_active(&self) -> usize
fn snapshot(&self, dest: &Path) -> Result<PathBuf>
fn add_session( &mut self, id: &str, start: usize, end: usize, channel: &str, summary: &str, ) -> Result<()>
fn get_session_summary(&self, session_id: &str) -> Result<Option<String>>
Auto Trait Implementations§
impl Freeze for HDF5Memory
impl !RefUnwindSafe for HDF5Memory
impl Send for HDF5Memory
impl Sync for HDF5Memory
impl Unpin for HDF5Memory
impl UnsafeUnpin for HDF5Memory
impl !UnwindSafe for HDF5Memory
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> 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