Collections
What a Telys collection is — a named, partitioned vector store bound to a single embedding space — and its create → use → save → reopen lifecycle.
A collection is the unit you work with in Telys: a named, partitioned vector store bound to one embedding space. It has a fixed dimensionality, a single partition-key column, an optional embedder, and its own directory on disk. Create one from a Telys handle, add and search records, then save() it to make it durable.
One collection, one embedding space
A collection stores fixed-width vectors of a single dim. Search only compares vectors in the same space, so a collection is pinned to one space for its lifetime — its dim, dtype, and (if attached) its embedder's profile. You cannot mix dimensions or embedders in one collection; use separate collections.
name
yes
Directory name and lookup key under the engine path
dim
yes
Vector width; must match the embedder's profile.dimension
partition_by
yes
Name of the physical partition-key column (a single column)
embedder
optional
Turns text into vectors; required for the *_texts methods
dtype
optional ("f32")
On-disk vector element type
filter_columns
optional (())
Metadata columns you can filter on with Eq
tuner
optional
Strategy used by tune() / apply_tuning()
Creating a collection
create_collection builds a collection in memory and caches it on the handle. It does not write anything to disk until you call save().
from telys import Telys
from telys.embedding import AlgentaMultigramEmbedder
db = Telys("./memory")
emb = AlgentaMultigramEmbedder() # lexical; dim comes from the native kernel
col = db.create_collection(
"articles",
dim=emb.profile.dimension, # read the space dim from the embedder
partition_by="tenant_id", # a single column name
embedder=emb,
dtype="f32",
filter_columns=("lang",), # columns you can Eq-filter later
)Bringing your own vectors instead of text? Skip the embedder — but then only the raw add/upsert/search methods work; the text methods raise RuntimeError.
The lifecycle
Save — the commit point
save() persists the collection and returns its directory. It writes the id_map.npy sidecar first, then collection.json last — that final write is the atomic commit point, so a crash mid-save never leaves a half-written collection.
collection.json records the collection's durable identity: name, dim, dtype, key_name, filter_columns, the id-map sidecar, telys_version, default_target_recall, applied_tuner, lexical, and the embedder_profile.
Listing and looking up collections
collections() returns the sorted names of directories that contain a collection.json — collections that have been saved. A created-but-unsaved collection will not appear.
Where a collection lives on disk
A saved collection is a self-contained directory under the engine path you gave Telys(...):
The collection.json and id_map.npy are the SDK's format; the vector slabs are the runtime's. Copy the whole directory to move or back up a collection — no external service holds any part of it.
Next steps
Last updated
Was this helpful?