pub struct ExtractionPipeline<P: ExtractionProvider> { /* private fields */ }Expand description
The main extraction engine. Takes raw conversations, extracts structured memories via an LLM, then filters and validates them before storage.
Implementations§
Source§impl<P: ExtractionProvider> ExtractionPipeline<P>
impl<P: ExtractionProvider> ExtractionPipeline<P>
pub fn new(provider: P, config: ExtractionConfig) -> Self
Sourcepub async fn extract_from_conversation(
&self,
conversation: &str,
) -> Result<Vec<ExtractedMemory>, ExtractionError>
pub async fn extract_from_conversation( &self, conversation: &str, ) -> Result<Vec<ExtractedMemory>, ExtractionError>
Call the LLM to extract memories from a conversation, then parse the response and filter by quality threshold.
Sourcepub async fn extract_full(
&self,
conversation: &str,
) -> Result<ExtractionResult, ExtractionError>
pub async fn extract_full( &self, conversation: &str, ) -> Result<ExtractionResult, ExtractionError>
Extract memories AND entities from a conversation. Returns the full ExtractionResult including structured entities.
Sourcepub fn filter_quality(
&self,
memories: &[ExtractedMemory],
) -> Vec<ExtractedMemory>
pub fn filter_quality( &self, memories: &[ExtractedMemory], ) -> Vec<ExtractedMemory>
Remove memories below the configured confidence threshold.
Sourcepub fn check_contradictions(
&self,
new_memory: &ExtractedMemory,
existing: &[MemoryNode],
embedding_provider: &dyn EmbeddingProvider,
) -> Vec<CognitiveFinding>
pub fn check_contradictions( &self, new_memory: &ExtractedMemory, existing: &[MemoryNode], embedding_provider: &dyn EmbeddingProvider, ) -> Vec<CognitiveFinding>
Check a new extracted memory against existing memories for contradictions using the WriteInferenceEngine.
Sourcepub fn check_duplicates(
&self,
new_memory: &ExtractedMemory,
existing: &[MemoryNode],
embedding_provider: &dyn EmbeddingProvider,
) -> bool
pub fn check_duplicates( &self, new_memory: &ExtractedMemory, existing: &[MemoryNode], embedding_provider: &dyn EmbeddingProvider, ) -> bool
Check if a new memory is too similar to any existing memory (above deduplication_threshold).
Sourcepub async fn process(
&self,
conversation: &str,
existing_memories: &[MemoryNode],
embedding_provider: &dyn EmbeddingProvider,
) -> Result<ProcessedExtractionResult, ExtractionError>
pub async fn process( &self, conversation: &str, existing_memories: &[MemoryNode], embedding_provider: &dyn EmbeddingProvider, ) -> Result<ProcessedExtractionResult, ExtractionError>
Run the full extraction pipeline: extract -> filter quality -> check duplicates -> check contradictions.
Auto Trait Implementations§
impl<P> Freeze for ExtractionPipeline<P>where
P: Freeze,
impl<P> RefUnwindSafe for ExtractionPipeline<P>where
P: RefUnwindSafe,
impl<P> Send for ExtractionPipeline<P>
impl<P> Sync for ExtractionPipeline<P>
impl<P> Unpin for ExtractionPipeline<P>where
P: Unpin,
impl<P> UnsafeUnpin for ExtractionPipeline<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ExtractionPipeline<P>where
P: UnwindSafe,
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