Module extraction

Module extraction 

Source
Expand description

LLM extraction service with provider fallback LLM Extraction Service — orchestrator that uses AIProvider to extract structured data

Implements ScrapingService by delegating to one or more AIProviders. Supports provider fallback: tries providers in order until one succeeds.

§Architecture

ScrapingService  ←  LlmExtractionService  →  AIProvider (Claude, GPT, Gemini, …)
      ↑                     ↓
 ServiceInput           FallbackChain
 { url, params }     [primary, secondary, …]

The params field of ServiceInput must contain:

  • schema: JSON schema object defining the expected output shape
  • content (optional): If present, used as-is. Otherwise data from a prior pipeline stage should be passed via url.

§Example

use stygian_graph::application::extraction::{LlmExtractionService, ExtractionConfig};
use stygian_graph::ports::{ScrapingService, ServiceInput};
use serde_json::json;

// Provider built separately — inject via Arc<dyn AIProvider>
// let service = LlmExtractionService::new(providers, ExtractionConfig::default());
// let output = service.execute(input).await.unwrap();

Structs§

ExtractionConfig
Configuration for the LLM extraction service
LlmExtractionService
LLM-based structured data extraction service