Dimensions & spaces
How a collection's dimension and space_id lock it to one embedder — why changing model or dimension needs a new collection, and how to migrate by re-embedding.
A Telys collection is bound to one vector space for its whole life. Two numbers fix that space: the dimension (how wide each vector is) and the space ID (a digest of the embedder's EmbeddingProfile). After creation both are frozen — you cannot search with vectors of a different width, and you cannot re-attach an embedder from a different space.
The dimension contract
The dim you declare at creation must agree with the embedder in three places:
the
dimyou pass tocreate_collection,the embedder's
profile.dimension,the width of the array the embedder returns (
shape[1]).
from telys import Telys
from telys.embedding import CallableEmbedder, EmbeddingProfile
profile = EmbeddingProfile("openai", "text-embedding-3-small", "1", dimension=1536)
embedder = CallableEmbedder(embed_fn, profile)
ame = Telys("./store")
col = ame.create_collection("docs", dim=1536, partition_by="scope", embedder=embedder)
# ^^^^ must equal profile.dimension (1536)If those numbers disagree, the collection and embedder describe different spaces and the operation is rejected. After creation, every query vector is checked too: search(vector, ...) validates len(vector) == dim, and add(vectors, ...) requires an (n, dim) array.
What a space ID is
The space ID is EmbeddingProfile.space_id() — "sha256:" plus 16 hex characters, computed from the space-defining fields (provider, model, version, dimension, dtype, normalization, distance, pooling, and the tokenizer/projection tags). It answers one question: are these two sets of vectors comparable?
save() writes the profile to disk. open_collection(...) re-attaches an embedder from the provider registry by matching model_id and space_id(). A provider from a different space will not attach.
Changing the embedder means a new space
Anything that changes the profile's identity changes the space ID, and a new space ID is incompatible with an existing collection:
Change
New space_id()?
Effect on an existing collection
Different model (text-embedding-3-small → bge-base-en-v1.5)
Yes
Incompatible — vectors are not comparable.
Different dimension (1536 → 512)
Yes
Incompatible — and the width no longer matches dim.
Different normalization or distance
Yes
Incompatible — scores would be meaningless.
New model_version
Yes
Incompatible — treat as a fresh space.
Only created (provenance timestamp)
No
Still compatible — reopen keeps working.
There is no in-place "re-embed" and no way to swap a collection onto a new space. A different embedding model is a different space, and a different space is a new collection.
Migrating to a new model
Create a new collection under the new space and re-embed your source text into it. Vectors cannot be reused across spaces, so re-run add_texts from the original documents — keep your source text.
Dimension-mismatch errors
Next steps
Next: work through concrete failures in Embedding dimension mismatches.
Last updated
Was this helpful?