Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Filters (Eq)

Reference for Eq — the single equality filter Telys supports on search, search_text, and ids, and how it maps to the single-key dict at the MCP boundary.

Telys has exactly one filter primitive: Eq. It matches rows where a metadata column equals a value. There are no boolean combinators, negation, or comparison operators anywhere in the API.

from telys import Eq

Eq(column, value)

Signature

Constructor
Parameters
Description

Eq(column, value)

column: str, value

Match rows whose column equals value.

Declare a filter column at creation via filter_columns=(...):

from telys import Telys
from telys.embedding import AlgentaMultigramEmbedder

ame = Telys("./memory")
emb = AlgentaMultigramEmbedder()
col = ame.create_collection(
    "notes", dim=emb.profile.dimension, partition_by="scope",
    embedder=emb,
    filter_columns=("tenant_id", "kind"),
)

Where you can pass it

Eq (or an equivalent single-key dict) is accepted by the where= parameter of three methods:

Method
Filter parameter

Collection.search(vector, ..., where=None, ...)

where

Collection.search_text(text, ..., where=None, ...)

where

Collection.ids(where=None)

where

Both forms are equivalent. where=None (the default) filters nothing.

The MCP boundary

Over MCP, telys_search accepts a where object that must be a single-key equality. A dict with more than one key raises an error.

Not supported

None of these exist in the SDK, the CLI, or MCP.

You might want
Status

And(...), Or(...), Not(...)

Not available.

Ne, Gt, Lt, Gte, Lte (comparisons)

Not available.

In([...]), ranges

Not available.

Multi-key where dict at MCP

Raises an error.

Time-travel / as_of() / validity windows

Not available.

Patterns for what Eq cannot express

Model your data so one equality answers the query.

Fold several facets into one column with scope_key, then filter on that exact key. Example: store scope_key("acme", "notes") and query Eq("scope", scope_key("acme", "notes")).

  • Combine tenant and kind: precompute a composite value (f"{tenant}:{kind}") at write time and Eq on it.

  • Scope every query to a subject: put the subject in partition_by, then Eq on a second filter_column within it.

See also

Last updated

Was this helpful?