Skip to main content

Extractor

Trait Extractor 

Source
pub trait Extractor {
    // Required method
    fn extract(&self, text: &str) -> Result<Vec<ExtractedFact>, ExtractError>;
}
Expand description

Turns a passage of raw text into atomic, graph-ready facts.

Implement this to plug in any model — a local LLM, a hosted API, or a deterministic rule set — and feed the result straight into crate::MemoryService::remember_extracted.

Required Methods§

Source

fn extract(&self, text: &str) -> Result<Vec<ExtractedFact>, ExtractError>

Extract the atomic facts a reader would remember from text.

§Errors

Returns ExtractError if the backend fails or its output cannot be parsed into facts.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Extractor + ?Sized> Extractor for Arc<T>

Forward Extractor through an [Arc], so a shared Arc<dyn Extractor> (e.g. one held by the MCP server) satisfies the X: Extractor bound on crate::MemoryService::remember_extracted.

Implementors§