API Reference agentsea_embeddings v#0.1.0

Copy Markdown

Modules

Turns text into vectors. Adapters: the dependency-free AgentSea.Embedder.Hashing (good for tests/dev) and, in future, Bumblebee/Nx (in-process HF/ONNX models) or remote embedding providers.

Cohere embeddings adapter (POST /v1/embed) over Req — a remote AgentSea.Embedder.

A deterministic, dependency-free embedder using the hashing trick: tokens are hashed into fixed-dimension buckets (bag-of-words), then the vector is L2 normalized. Texts that share words land closer together — enough for tests, local dev, and demos without pulling in an ML runtime.

OpenAI embeddings adapter (POST /v1/embeddings) over Req — a remote AgentSea.Embedder (no local model).

Ties an AgentSea.Embedder to an AgentSea.VectorStore: embed-and-index text documents, then semantic-search by text.

An AgentSea.Tool that lets an agent search a knowledge base — the retrieval half of RAG.

Vector-backed conversation memory: messages are embedded and indexed, so search/2 recalls the most relevant past messages (not just the most recent). Wraps an AgentSea.Embeddings handle (any embedder + vector store).

Small vector math: dot product, L2 norm, normalization, cosine similarity.

Stores vectors and answers nearest-neighbour queries. Adapters: the in-memory AgentSea.VectorStore.Memory and, in future, pgvector (first-class via Ecto) or remote stores (Pinecone/Qdrant) over HTTP.

In-memory vector store backed by a GenServer. Brute-force cosine-similarity search — fine for tests, small corpora, and demos. Records are keyed by id.

A Pinecone AgentSea.VectorStore over its data-plane REST API (Req) — a managed/remote store alongside the in-memory, pgvector, and Qdrant stores.

A pgvector-backed AgentSea.VectorStore over Postgrex — the design's first- class production store.

A Qdrant AgentSea.VectorStore over its REST API (Req) — a managed/remote alternative to the in-memory and pgvector stores.