pub struct HybridMemory { /* private fields */ }Expand description
A memory composed of several member memories. Each write is
broadcast to every member; seed concatenates each member’s
contribution in registration order.
Use to compose specialized memories — e.g. a Window for recent
turns plus a SummaryMemory for older context plus an EntityMemory
to surface known entities. Each member can do its own thing on write
(the Window will trim, the SummaryMemory will compact, etc.); the
agent sees a unified seed.
Implementations§
Source§impl HybridMemory
impl HybridMemory
Sourcepub fn new() -> Self
pub fn new() -> Self
Empty hybrid with no members. Add members via HybridMemory::with.
Sourcepub fn with(self, member: impl Memory + 'static) -> Self
pub fn with(self, member: impl Memory + 'static) -> Self
Append a member memory. Builder-style.
Sourcepub fn member_count(&self) -> usize
pub fn member_count(&self) -> usize
Number of members.
Trait Implementations§
Source§impl Default for HybridMemory
impl Default for HybridMemory
Auto Trait Implementations§
impl Freeze for HybridMemory
impl !RefUnwindSafe for HybridMemory
impl Send for HybridMemory
impl Sync for HybridMemory
impl Unpin for HybridMemory
impl UnsafeUnpin for HybridMemory
impl !UnwindSafe for HybridMemory
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