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

Text vs vectors

Decide between the text ingest/search path (needs an embedder) and the raw-vector path (bring your own precomputed float32 vectors) in Telys.

Every Telys collection stores vectors. The only choice is who computes them: Telys, from your text through an attached embedder, or you, precomputed from any model. Both paths write to the same collection and query it the same way.

Use the text path
Use the vector path

add_texts / upsert_texts / search_text

add / upsert / search

Collection has an embedder attached

Collection needs no embedder

You pass str documents and queries

You pass float32 arrays of shape (n, dim)

Telys embeds with the collection's embedder

You embed with OpenAI, BGE, or any model you like

Simplest for on-device lexical/semantic memory

Best when you already run a model elsewhere

The text path

Attach an embedder at creation and pass strings. You never touch a vector.

from telys import Telys
from telys.embedding import AlgentaMultigramEmbedder

telys = Telys("telys-store")
embedder = AlgentaMultigramEmbedder()

notes = telys.create_collection(
    "notes",
    dim=embedder.profile.dimension,
    partition_by="scope",
    embedder=embedder,
)

notes.add_texts(
    ["kubernetes rollout stuck on readiness probe"],
    ids=["note-1"],
    metadata=[{"scope": "ops"}],
)
notes.save()

The vector path (bring your own)

If you already produce embeddings, create the collection with dim set to your model's output width and add raw vectors. No embedder is required.

Two rules keep the vector path safe:

  • Shape. Vectors must be (n, dim) with n == len(ids) == len(metadata).

  • Dtype. Vectors must be float32; call .astype("float32") if your model returns float64.

Vector width is fixed at creation. A dim=1536 collection accepts only 1536-wide vectors, and search raises on a wrong-length query. To switch embedding models, create a new collection. See Dimensions & space IDs.

Expected result

Both paths return the external ids they wrote and grow the collection identically:

At query time the two collections are indistinguishable: notes answers search_text, docs answers search, both over the same kind of vectors.

Next steps

Last updated

Was this helpful?