Skip to main content

Crate atomr_agents_embed

Crate atomr_agents_embed 

Source
Expand description

EmbeddingActor + pluggable AnnIndex.

Structs§

EmbeddingToolStrategy
Embeds tool descriptors at construction; at select-time, embeds the user turn and returns top-k tools that fit the budget.
Hit
A single vector-store search result.
InMemoryAnnIndex
Linear-scan, cosine-similarity index. Mirrors the algorithm in atomr_accel_agents::CpuVectorIndex but lives in-process to avoid requiring an ActorSystem for unit tests.
InMemoryVectorStore
In-memory cosine-similarity vector store. Applies MetadataFilter at query time before ranking. Suitable for tests and small hot tiers.
MockEmbedder
Deterministic, dimension-configurable mock embedder. Produces stable vectors so tests are reproducible.

Enums§

MetadataFilter
A set of equality / range predicates over metadata keys, honored by the backend at query time. And composes sub-predicates conjunctively. MetadataFilter::matches is provided for in-memory backends and as a documented fallback for backends that cannot push the predicate down to the engine.

Traits§

AnnIndex
Approximate-nearest-neighbor index. v0 ships an in-memory linear scan; a CUDA / external-service implementation slots in behind the same trait without changing call sites.
Embedder
Single text → vector. The default implementation in production will wrap an atomr-infer ModelRunner configured with an embedding model; for unit tests, MockEmbedder produces deterministic vectors from a hash.
Embeddings
Batch embeddings interface. A blanket impl bridges any existing single-text Embedder, so all current embedders satisfy Embeddings for free.
VectorStore
Backend-agnostic vector store: dense upsert, filtered top-k query, and delete. In-memory impl lives in atomr-agents-embed; pgvector and Redis backends live in this crate behind feature flags.

Functions§

cosine
Cosine similarity (0 for mismatched / zero-norm vectors).

Type Aliases§

AnnId