Module extraction

Module extraction 

Source
Expand description

Entity Extraction - LLM-powered entity and relation extraction

TigerStyle: Sim-first, deterministic, graceful degradation.

See ADR-014 for design rationale.

§Architecture

EntityExtractor<P: LLMProvider>
├── extract()         → ExtractionResult
├── extract_entities_only() → Vec<ExtractedEntity>
└── Uses prompts::build_extraction_prompt()

§Usage

use umi_memory::extraction::{EntityExtractor, ExtractionOptions};
use umi_memory::llm::SimLLMProvider;

#[tokio::main]
async fn main() {
    let provider = SimLLMProvider::with_seed(42);
    let extractor = EntityExtractor::new(provider);

    let result = extractor.extract("Alice works at Acme Corp", ExtractionOptions::default()).await.unwrap();
    println!("Found {} entities", result.entity_count());
}

Structs§

EntityExtractor
Entity extractor using LLM.
ExtractedEntity
Entity extracted from text by LLM.
ExtractedRelation
Relation between two entities extracted from text.
ExtractionOptions
Options for entity extraction.
ExtractionResult
Result of entity extraction from text.

Enums§

EntityType
Types of entities that can be extracted.
ExtractionError
Errors from entity extraction.
RelationType
Types of relations between entities.

Functions§

build_extraction_prompt
Build the full extraction prompt.