frankensearch-core
Core traits, types, and error types for the frankensearch hybrid search library.
Overview
frankensearch-core is the foundational crate in the frankensearch workspace. Every other crate depends on it. It defines the shared interfaces, result types, error types, text canonicalization, query classification, telemetry structures, and configuration types used across the entire search pipeline.
This crate has minimal external dependencies and is designed to be a stable, lightweight foundation.
Key Types
Traits
Embedder- async trait for text-to-vector embeddingLexicalSearch- async trait for keyword/BM25 search backendsReranker- async trait for cross-encoder rerankingSyncEmbed/SyncRerank- synchronous adapter wrappers for embedders and rerankersMetricsExporter- trait for exporting telemetry dataHostAdapter- trait for host environment integration and conformance
Result and Hit Types
ScoredResult- a search result with doc ID, score, rank, and metadataVectorHit- raw vector similarity hit (doc ID + cosine score)FusedHit- merged result after RRF fusion with provenance trackingIndexableDocument- input document with ID, content, title, and metadata
Configuration and Metrics
TwoTierConfig- configuration for the two-tier progressive search pipelineTwoTierMetrics- per-search timing and diagnostic metricsSearchPhase- enum for progressive result delivery (Initial / Refined / RefinementFailed)QueryClass- automatic query classification (short keyword, natural language, code, etc.)
Error Handling
SearchError- unified error type for all frankensearch operationsSearchResult<T>- type alias forResult<T, SearchError>
Infrastructure
Canonicalizer/DefaultCanonicalizer- Unicode-aware text normalizationDocumentFingerprint- content-hash fingerprinting for change detectionS3FifoCache- S3-FIFO eviction cache for embeddingsRuntimeMetricsCollector- telemetry collection for embedder, index, and search stagesCommitReplayEngine- append-only commit log with replay for crash recoveryRepairOrchestrator- corruption detection and repair coordinationDocumentGraph- directed document relationship graph for graph-boosted rankingGenerationManifest- versioned manifest tracking index artifact generationsDecisionContext/DecisionOutcome- decision-plane types for pipeline orchestration
Usage
use ;
// Classify a query
let class = classify;
// Create a document
let doc = IndexableDocument ;
// Use default search configuration
let config = default;
Dependency Graph Position
frankensearch-core (no internal dependencies -- leaf crate)
^
|-- frankensearch-embed
|-- frankensearch-index
|-- frankensearch-lexical
|-- frankensearch-fusion
|-- frankensearch-rerank
|-- frankensearch-storage
|-- frankensearch-durability
|-- frankensearch-tui
|-- frankensearch-ops
|-- frankensearch-fsfs
|-- frankensearch (root)
License
MIT