Skip to main content

anamnesis_embedder/
lib.rs

1//! Anamnesis embedding providers.
2//!
3//! Phase-1 scope:
4//!   - `EmbeddingProvider` trait re-export from `anamnesis-core`
5//!   - Curated 5-model `registry` — `default` / `tiny` / `en` /
6//!     `multi-strong` / `cloud-voyage` (data only, zero ML deps)
7//!   - Local provider via `fastembed-rs` (Task #4)
8//!   - Model cache lives under `$XDG_DATA_HOME/anamnesis/models/`; binary
9//!     stays small. See `docs/BLUEPRINT.md §16.7`.
10//!
11//! The cloud provider (`voyage`) implementation lands in Phase 2 alongside
12//! the mem0 adapter.
13
14#![forbid(unsafe_code)]
15#![warn(missing_docs)]
16
17pub mod registry;
18pub mod worker;
19
20#[cfg(feature = "local-fastembed")]
21pub mod local;
22
23#[cfg(feature = "cloud-voyage")]
24pub mod voyage;
25
26#[cfg(feature = "local-fastembed")]
27pub use local::LocalFastembedProvider;
28
29#[cfg(feature = "cloud-voyage")]
30pub use voyage::VoyageProvider;
31
32pub use anamnesis_core::embedding::{EmbeddingProvider, EmbeddingTask, ModelId};
33pub use registry::{available, by_key, default_model, local_only, CuratedModel, REGISTRY};
34pub use worker::{DrainSummary, EmbeddingWorker};
35
36/// Crate version, exposed for diagnostics and `anamnesis status` output.
37pub const CRATE_VERSION: &str = env!("CARGO_PKG_VERSION");
38
39#[cfg(test)]
40mod tests {
41    use super::*;
42
43    #[test]
44    fn crate_version_is_pinned() {
45        assert!(!CRATE_VERSION.is_empty());
46        assert!(CRATE_VERSION.starts_with("0."));
47    }
48}