Connect remotely
Connect to a running Telys server with connect() / RemoteTelys, create and open collections remotely, and ingest and search over the length-prefixed socket protocol.
Once a server owns a store (see Run a Telys server), reach it with connect() from telys.client, which returns a RemoteTelys. It behaves like the in-process Telys facade — create and open collections, then ingest and search — but every call is a request to the server, and the returned RemoteCollection is a subset of the local Collection.
Connect
connect(address, token=None) returns a RemoteTelys. Match the address form to how the server listens; pass token only for TCP.
from telys.client import connect
client = connect("unix:///tmp/telys.sock")
print(client.ping())
client.close()Bare paths work too: connect("/tmp/telys.sock") (absolute) and connect("./telys.sock") (relative) equal the unix:// form. No token is needed — the socket is trusted.
from telys.client import connect
client = connect("tcp://memory.internal:9099", token="$TELYS_ACCESS_TOKEN")
print(client.ping())
client.close()host:port without a scheme also works: connect("memory.internal:9099", token="$TELYS_ACCESS_TOKEN"). The token is required — the server refuses anonymous TCP connections.
Create a collection remotely
RemoteTelys.create_collection mirrors the local call with one difference: embedder is a string name, resolved by the server, and there is no tuner argument. The server pre-registers AlgentaBigramEmbedder as "bigram", so that name works out of the box.
from telys.client import connect
with connect("unix:///tmp/telys.sock") as client:
col = client.create_collection(
"notes",
64, # dim — must match the named embedder's dimension
"scope", # partition_by (physical partition key)
embedder="bigram",
)The full signature is create_collection(name, dim, partition_by, *, filter_columns=(), dtype="f32", embedder=None). partition_by names the single physical partition key; for a composite key, compose one string with scope_key(...) — a list/tuple uses only its first element. See Partitions & scope keys.
Ingest and search
RemoteCollection supports the everyday read/write surface. Filters use Eq (or a single-key dict), exactly as in-process.
search and search_text return {"ids": [...], "scores": [...]}, plus "metadata" when with_metadata=True and "explain" when explain=True.
What RemoteCollection supports
Available on RemoteCollection
Not available remotely
add, upsert, add_texts, upsert_texts
update_texts
search, search_text, ids
tune, apply_tuning
delete, compact
len(col), ext in col
build_ivf, snapshot, save, stats
—
Remote search(vector, top_k=10, where=None, explain=False, with_metadata=False) also has no target_recall parameter — recall targets are an owner-side concern applied through tuning. The complete method list is in the Remote API reference.
Expected result
Running the ingest-and-search snippet against a server that owns the notes collection prints a ranked result scoped to ops:
Scores are similarity scores (higher is closer); exact values depend on the embedder and your data. The oncall document ranks first for the oncall query, confirming the round trip — client to server to store and back — works end to end.
Next steps
Next: Auth & network model — the trust model, token handshake, and wire limits behind these calls.
Remote API (connect / RemoteTelys) — every remote method and its signature.
Deployment notes — run the server durably in production.
Last updated
Was this helpful?