pub struct ExtractedEntity {
pub name: String,
pub entity_type: String,
pub description: Option<String>,
pub confidence: f32,
}
pub struct ExtractedRelation {
pub from_name: String,
pub to_name: String,
pub relation_type: String,
pub description: Option<String>,
pub confidence: f32,
}
pub struct ExtractionResult {
pub entities: Vec<ExtractedEntity>,
pub relations: Vec<ExtractedRelation>,
}
pub trait EntityRelationExtractor: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn extract(&self, text: &str) -> Result<ExtractionResult, Self::Error>;
}
pub trait IngestionPipeline: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn ingest(&self, text: &str, source_id: Option<&str>) -> Result<(), Self::Error>;
}
pub trait FederationAdapter: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn search(&self, query: &str, limit: usize) -> Result<Vec<crate::rag::RagContext>, Self::Error>;
}
pub trait CorpusAnalytics: Send + Sync {
type Error: std::error::Error + Send + Sync + 'static;
fn coverage_score(&self) -> Result<f32, Self::Error>;
fn detect_gaps(&self, query: &str) -> Result<Vec<String>, Self::Error>;
}