Local vs remote
When to run Telys in-process versus behind a shared server — and how RemoteCollection differs as a strict subset of the local Collection API.
Telys runs the same engine two ways. Local execution embeds the runtime in your process: construct Telys(path) and every call runs in-process against a directory on disk — the default, and the fastest. Remote execution puts one store behind a server (telys serve) that many processes or hosts share over a socket, reached with connect() / RemoteTelys. This page covers when to pick each and how the remote surface is a strict subset of the local one.
Two execution models
The engine loads inside your Python process; there is no server, no socket, no auth. Best for a single application, notebooks, batch jobs, and the full API surface (including tuning and in-place update_texts, which remote omits).
from telys import Telys
from telys.embedding import AlgentaMultigramEmbedder
emb = AlgentaMultigramEmbedder()
db = Telys("./memory")
col = db.create_collection("notes", dim=emb.profile.dimension, partition_by="scope", embedder=emb)
col.add_texts(["on-device memory"], ids=["m1"], metadata=[{"scope": "acme"}])RemoteCollection is a strict subset
A remote client speaks to a RemoteCollection, which mirrors the local text surface. Only a few operations — update_texts and tuning — are not on the wire. Design for the remote surface if you might ever serve the store.
Capability
Local Collection
RemoteCollection
add, upsert, add_texts, upsert_texts
yes
yes
search, search_text
yes
yes
ids, delete, compact, save, stats
yes
yes
build_ivf, snapshot
yes
yes
update_texts
yes
no
tune, apply_tuning
yes
no
len(col) / ext in col
yes
no
search(..., target_recall=...)
yes
no target_recall
Two differences bite most often:
No
target_recallon remote search.RemoteCollection.search(vector, top_k=10, where=None, explain=False, with_metadata=False)has notarget_recallargument. Recall is governed server-side by whatever tuning the server owner applied; a client cannot request a per-query recall target.Remote
create_collectiontakes a string embedder and no tuner. Over the wire you cannot pass a Python embedder object or aTuner:
The server pre-registers AlgentaBigramEmbedder under the name "bigram", so text methods work out of the box; register additional embedders with serve(..., embedder_factory=...).
Auth and the network model
How you serve determines what a client must present:
A Unix-domain socket is created 0o600 and treated as trusted — filesystem permissions are the boundary, so no token is required. Ideal for co-located processes on one host.
TCP requires an access token — the server refuses anonymous TCP connections. The client sends an auth handshake first, compared in constant time.
Which should you use?
One application owns the store
Several processes or hosts share one store
You need tuning or in-place update_texts
The common CRUD + search surface is enough
You want the lowest latency
You want a single writer / central store
Notebooks, batch jobs, embedded use
A long-running service fronts the memory
A good rule: build against the local API; if you later serve the same store, keep to the subset above. A remote client cannot tune or run update_texts, so run those steps locally against the same directory before (or between) serving it — index builds (build_ivf) and snapshots work over the wire.
Next steps
Last updated
Was this helpful?