Create a collection
Create a Telys collection with a fixed dimension, a partition key, and an optional embedder, then commit it to disk with save().
A collection is Telys's unit of storage and search: records that share one vector dimension, one partition key, and an optional embedder. Telys.create_collection(...) builds the collection in memory and caches it on the facade; nothing touches disk until you call col.save().
Signature
Telys.create_collection(
name,
dim,
partition_by,
embedder=None,
dtype="f32",
filter_columns=(),
tuner=None,
lexical=False,
) -> Collectionname
str
—
Collection name; also the on-disk subdirectory under the store path.
dim
int
—
Vector dimension. Must equal your embedder's profile.dimension (or the width of the vectors you will add).
partition_by
str
—
Metadata column used as the physical partition key. A list/tuple uses only element [0] — see the note below.
embedder
EmbeddingProvider | None
None
Attaches an embedder so add_texts / search_text work. Omit for a vectors-only collection.
dtype
str
"f32"
On-disk vector storage dtype (single-precision float by default).
filter_columns
tuple[str, ...]
()
Extra metadata columns you may constrain with Eq / where.
lexical
bool
False
Retain code tokens at ingest so you can build_lexical and query search_text(mode="lexical") (on-device BM25).
Create a text-backed collection
Construct an embedder and pass its profile.dimension as dim so the collection width always matches the vectors the embedder produces.
Add dtype and filter columns
filter_columns declares which metadata columns you can later constrain with Eq. The partition key is always filterable; any other column must be listed here at creation time.
Records can now be filtered on tenant_id, lang, or source. See Filter results.
Expected result
create_collection returns a Collection with zero records. telys.collections() lists only saved collections, so it stays empty until save():
To reopen a saved collection later, call telys.open_collection("memories", embedder=...), or register the embedder once with telys.register_provider(...) so open_collection re-attaches it automatically.
Next steps
Add & upsert records — put text or vectors into the collection you just made.
Collections — how dimension, partition, and dtype fit together.
Choosing an embedder — lexical vs dense, and bring-your-own.
Last updated
Was this helpful?