Expand description
Embedding engines + HNSW vector database for post-cortex.
This crate is self-contained: anyone needing a Candle-backed BERT
embedder or an HNSW index for nearest-neighbour search can depend
on it without pulling the post-cortex daemon, storage, or
orchestrator. Implements EmbeddingBackend (BERT via Candle,
static-hash fallback) and ships VectorDB (HNSW with optional
product quantization).
Shared types — [post_cortex_embeddings::VectorMetadata]
and friends — live in post-cortex-core so the storage trait API
can reference them without depending on the ML stack.
Re-exports§
pub use error::Error;pub use error::Result;pub use rerank::Reranker;pub use embeddings::EmbeddingBackend;pub use embeddings::EmbeddingConfig;pub use embeddings::EmbeddingModelType;pub use embeddings::LocalEmbeddingEngine;pub use vector_db::Corpus;pub use vector_db::MESSAGE_CONTENT_TYPE;pub use vector_db::ProductQuantizationCodebook;pub use vector_db::SearchMatch;pub use vector_db::SearchMode;pub use vector_db::SearchQualityPreset;pub use vector_db::StoredVector;pub use vector_db::VectorDB;pub use vector_db::VectorDbConfig;pub use vector_db::VectorDbStats;pub use vector_db::VectorDbStatsSnapshot;pub use vector_db::VectorMetadata;pub use vector_db::cosine_similarity;pub use vector_db::cosine_with_norms;pub use vector_db::dot;pub use vector_db::l2_norm;
Modules§
- embeddings
- Local Embeddings Engine for semantic understanding.
- error
- Typed error hierarchy for
post-cortex-embeddings. - rerank
- Rerankers: score each candidate document against the query so the candidate pool from vector + full-text search can be reordered.
- text
- Tokenizing text for lexical (BM25) search, shared by every backend: the
SurrealDB full-text query and the in-memory index of
VectorDB. Language-independent: no stopword lists. Words too common to help are found from the data instead, by document frequency (VectorDB::query_terms). - vector_
db - HNSW vector database — types + impl.