pub struct ResponseExtractor { /* private fields */ }Implementations§
Source§impl ResponseExtractor
impl ResponseExtractor
pub fn new(store: Arc<dyn MemoryStore>, config: ExtractionConfig) -> Self
pub fn with_llm_extractor(self, extractor: Arc<dyn LlmExtractor>) -> Self
Sourcepub fn with_lazy_llm_extractor(self, extractor: LazyLlmExtractor) -> Self
pub fn with_lazy_llm_extractor(self, extractor: LazyLlmExtractor) -> Self
Production wiring: hand over a lazily-probed holder instead of a
one-shot startup result (see LazyLlmExtractor).
Sourcepub fn with_embedder(self, embedder: LazyEmbedder) -> Self
pub fn with_embedder(self, embedder: LazyEmbedder) -> Self
Production wiring: hand over the ambient lazily-probed embedding provider so extraction writes get vectors + vector-aware dedup, mirroring the MCP/REST save path.
Sourcepub async fn llm_extractor(&self) -> Option<Arc<dyn LlmExtractor>>
pub async fn llm_extractor(&self) -> Option<Arc<dyn LlmExtractor>>
The same lazily-probed LLM extractor this extractor uses internally —
exposed so sibling tools (e.g. infer_outcome’s LLM-judge path) reuse
one probe/cache instead of each building their own.
Sourcepub async fn extract_and_save(
&self,
response_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save( &self, response_text: &str, agent_id: &str, ) -> ExtractionResult
Extract memories from an agent’s own response text and save to store as unreviewed (Inbox).
Sourcepub async fn extract_and_save_from_user(
&self,
user_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save_from_user( &self, user_text: &str, agent_id: &str, ) -> ExtractionResult
Extract memories directly from the user’s own turn text. First-person
signal words (“我偏好”/“我喜欢”) match a user’s own statements about
themselves far more reliably than an assistant’s restatement of them,
so this path typically has higher recall than extract_and_save.
Sourcepub async fn extract_and_save_contextual(
&self,
user_text: Option<&str>,
response_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save_contextual( &self, user_text: Option<&str>, response_text: &str, agent_id: &str, ) -> ExtractionResult
Extract from a paired user+assistant turn as one piece of context, rather than scanning each text independently for keyword signals. When an LLM extractor is configured, it sees both sides of the exchange together — recovering implicit preferences and cross-sentence references the line-by-line rule engine misses. Falls back to the rule-based per-text extraction (unchanged behavior) when no LLM extractor is configured, or if the LLM call fails — an LLM outage must never break the extraction pipeline.
Auto Trait Implementations§
impl !RefUnwindSafe for ResponseExtractor
impl !UnwindSafe for ResponseExtractor
impl Forget for ResponseExtractor
impl Freeze for ResponseExtractorwhere
*const ArcInner<dyn MemoryStore> is !null: Freeze,
PhantomData<ArcInner<dyn MemoryStore>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<MemoryType>: Freeze,
*const ArcInner<Mutex<LazyState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<LazyState>>>: Freeze,
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Option<Arc<dyn LlmExtractor>>> + Send>> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Option<Arc<dyn LlmExtractor>>> + Send>> + Send + Sync>>: Freeze,
*const ArcInner<LazyEmbedderInner> is !null: Freeze,
PhantomData<ArcInner<LazyEmbedderInner>>: Freeze,
impl Move for ResponseExtractor
impl Send for ResponseExtractor
impl Sync for ResponseExtractor
impl Unpin for ResponseExtractor
impl UnsafeUnpin for ResponseExtractorwhere
*const ArcInner<dyn MemoryStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn MemoryStore>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<MemoryType>: UnsafeUnpin,
*const ArcInner<Mutex<LazyState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<LazyState>>>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Option<Arc<dyn LlmExtractor>>> + Send>> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Option<Arc<dyn LlmExtractor>>> + Send>> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<LazyEmbedderInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<LazyEmbedderInner>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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