Expand description
Pluggable text → vector embedding.
The Agent Memory SDK is bring-your-own-vector: it never generates
embeddings. This crate mirrors the repo’s established pattern (the Python
SDK’s Embedder protocol, the tauri-rag demo’s fastembed backend): an
Embedder trait with a default on-device model and a deterministic,
network-free fallback for tests and air-gapped reproducibility.
Structs§
- Hash
Embedder - Deterministic, network-free embedder (token-hashing into L2-normalized
buckets). Not semantically strong — its purpose is reproducible tests and
offline behavior, exactly like the
fake_embedused in the repo’sagent_memoryexamples. Swap in a real model (e.g.fastembed, all-MiniLM-L6-v2, 384-dim) for production recall quality.
Enums§
- Embed
Error - Failure produced by an
Embedderbackend (e.g. a network-backed embedder that cannot reach its model). The in-memoryHashEmbeddernever fails.
Traits§
- Embedder
- Turns text into a fixed-dimension embedding vector.
Type Aliases§
- DynEmbedder
- A boxed, object-safe embedder. Lets a non-generic
MemoryService<DynEmbedder>be stored behind a concrete type — the MCP server and the language bindings both need this, since handler/pyclass types can’t carry a genericE.