pub struct EpisodicStoreBuilder { /* private fields */ }Expand description
Fluent builder for EpisodicStore.
Allows combining any set of options — decay, recall policy, per-agent capacity, max age, and eviction policy — before creating the store.
§Example
use llm_agent_runtime::memory::{EpisodicStore, EvictionPolicy, RecallPolicy, DecayPolicy};
let store = EpisodicStore::builder()
.per_agent_capacity(50)
.eviction_policy(EvictionPolicy::Oldest)
.build();Implementations§
Source§impl EpisodicStoreBuilder
impl EpisodicStoreBuilder
Sourcepub fn decay(self, policy: DecayPolicy) -> Self
pub fn decay(self, policy: DecayPolicy) -> Self
Set the decay policy.
Sourcepub fn recall_policy(self, policy: RecallPolicy) -> Self
pub fn recall_policy(self, policy: RecallPolicy) -> Self
Set the recall policy.
Sourcepub fn per_agent_capacity(self, capacity: usize) -> Self
pub fn per_agent_capacity(self, capacity: usize) -> Self
Set the per-agent capacity. Panics if capacity == 0.
Sourcepub fn try_per_agent_capacity(
self,
capacity: usize,
) -> Result<Self, AgentRuntimeError>
pub fn try_per_agent_capacity( self, capacity: usize, ) -> Result<Self, AgentRuntimeError>
Set the per-agent capacity without panicking.
Returns Err if capacity == 0. Prefer this over per_agent_capacity
in library/user-facing code where a misconfigured capacity should be
handled gracefully rather than aborting the process.
Sourcepub fn max_age_hours(self, hours: f64) -> Result<Self, AgentRuntimeError>
pub fn max_age_hours(self, hours: f64) -> Result<Self, AgentRuntimeError>
Set the maximum memory age in hours. Returns Err if max_age_hours <= 0.
Sourcepub fn eviction_policy(self, policy: EvictionPolicy) -> Self
pub fn eviction_policy(self, policy: EvictionPolicy) -> Self
Set the eviction policy.
Sourcepub fn build(self) -> EpisodicStore
pub fn build(self) -> EpisodicStore
Consume the builder and create an EpisodicStore.
Trait Implementations§
Source§impl Default for EpisodicStoreBuilder
impl Default for EpisodicStoreBuilder
Source§fn default() -> EpisodicStoreBuilder
fn default() -> EpisodicStoreBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EpisodicStoreBuilder
impl RefUnwindSafe for EpisodicStoreBuilder
impl Send for EpisodicStoreBuilder
impl Sync for EpisodicStoreBuilder
impl Unpin for EpisodicStoreBuilder
impl UnsafeUnpin for EpisodicStoreBuilder
impl UnwindSafe for EpisodicStoreBuilder
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