pub struct MemoryEngineBuilder { /* private fields */ }Expand description
Builder for MemoryEngine with dependency injection support.
Use this when you need to supply custom or mock implementations for LLM, embedding, vector, history, reranker, or graph components.
ⓘ
let engine = MemoryEngineBuilder::new(config)
.llm(my_llm)
.history(my_history)
.build()
.await?;Implementations§
Source§impl MemoryEngineBuilder
impl MemoryEngineBuilder
pub fn new(config: MemoryEngineConfig) -> Self
pub fn llm(self, llm: Arc<dyn LlmClient>) -> Self
pub fn embedder(self, embedder: Arc<dyn EmbeddingClient>) -> Self
pub fn vector_index(self, vi: Arc<dyn VectorIndex>) -> Self
pub fn history(self, history: Arc<dyn HistoryStore>) -> Self
pub fn reranker(self, reranker: Arc<dyn RerankerClient>) -> Self
Sourcepub async fn build(self) -> Result<MemoryEngine>
pub async fn build(self) -> Result<MemoryEngine>
Build the MemoryEngine, creating default implementations for any
components not explicitly provided.
Auto Trait Implementations§
impl Freeze for MemoryEngineBuilder
impl !RefUnwindSafe for MemoryEngineBuilder
impl Send for MemoryEngineBuilder
impl Sync for MemoryEngineBuilder
impl Unpin for MemoryEngineBuilder
impl UnsafeUnpin for MemoryEngineBuilder
impl !UnwindSafe for MemoryEngineBuilder
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