Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Choosing an embedder

Compare the on-device lexical embedders against the bring-your-own dense path and pick the right vector space for your collection.

An embedder turns text into a fixed-width float32 vector and defines the vector space a collection lives in. Each collection binds to one embedder through its EmbeddingProfile, written to disk on save(). Picking an embedder is three decisions:

  1. Where embedding runs — on-device in the native kernel, or in your own code.

  2. Similarity type — lexical n-gram hashing, or dense semantic vectors.

  3. Dimension of every vector the collection stores.

You cannot mix spaces in one collection. Changing the embedder changes the space, which means a new collection. See EmbeddingProfile & space compatibility.

Embedders are not top-level exports. Import them from telys.embedding:

from telys.embedding import (
    AlgentaBigramEmbedder,
    AlgentaMultigramEmbedder,
    CallableEmbedder,
    EmbeddingProfile,
)

The three practical choices

Three embedders ship and work in a normal install (given the native kernel):

  • AlgentaBigramEmbedder — compact on-device lexical matching.

  • AlgentaMultigramEmbedder — richer on-device lexical matching; the default for the MCP server and telys mem.

  • CallableEmbedder — wraps your own function for any dense model (OpenAI, BGE, sentence-transformers) or lexical scheme.

A fourth, AlgentaPooledEmbedder, is listed in telys.embedding.__all__ but resolves lazily from the signed runtime and is unavailable in a runtime-free install. See AlgentaPooledEmbedder.

Decision matrix

Embedder
On-device?
Network?
Dimension source
Best for

AlgentaBigramEmbedder

Yes — native kernel

None

Native kernel (hint: 64-d)

Compact lexical matching over short strings: keys, tags, symbol names; lowest memory.

AlgentaMultigramEmbedder

Yes — native kernel

None

Native kernel (hint: 384-d)

Richer lexical recall over prose; the MCP / telys mem default.

CallableEmbedder

Depends on your fn

Depends on your fn

profile.dimension you declare

Bring-your-own dense models and services (OpenAI, BGE, sentence-transformers).

AlgentaPooledEmbedder

Runtime-only

Runtime-defined

Runtime-defined

Only when the signed runtime is installed; not part of the SDK surface.

Dimensions for the Algenta embedders are read from the native kernel at construction time. The 64 and 384 figures are hints, not guaranteed constants — always create the collection with emb.profile.dimension, never a hard-coded number.

Lexical or dense?

The Algenta embedders are lexical: they hash character n-grams into a bounded vector, so similarity rewards shared substrings and exact terms. They run entirely on-device, need no model download, and are strong for code, identifiers, tags, and keyword recall. They cannot match meaning worded differently — "car" and "automobile" do not match unless the characters overlap.

CallableEmbedder is the dense path: hand Telys a function that returns semantic vectors from a model you control. That gives paraphrase-aware recall at the cost of a model dependency (and possibly a network call). For the full tradeoff, see Lexical vs dense embeddings.

Constructing each

Reopening a collection later

save() records the embedder's profile with the collection. open_collection(name) re-attaches the embedder automatically for the Algenta providers. A CallableEmbedder function cannot be serialized, so register the provider first and pass the embedder back:

Reattach succeeds only when the profile matches — same provider, model_id, dimension, and pooling. That is the check compatible_with performs. See Dimensions & space IDs.

Next steps

Last updated

Was this helpful?