> For the complete documentation index, see [llms.txt](https://docs.telys.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.telys.ai/reference/filters.md).

# Filters (Eq)

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.

```python
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=(...)`:

```python
from telys.embedding import AlgentaMultigramEmbedder

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`          |

```python
from telys import Eq

# Eq instance
hits = col.search_text("q3 roadmap", where=Eq("tenant_id", "acme"))

# Equivalent single-key dict
hits = col.search_text("q3 roadmap", where={"tenant_id": "acme"})

# Restrict a listing to one tenant
live = col.ids(where=Eq("tenant_id", "acme"))
```

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.

{% code title="telys\_search arguments" %}

```json
{
  "collection": "notes",
  "query": "q3 roadmap",
  "where": { "tenant_id": "acme" }
}
```

{% endcode %}

## 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.

{% hint style="info" %}
Fold several facets into one column with [`scope_key`](/reference/sdk-api-index.md#scope-key), then filter on that exact key. Example: store `scope_key("acme", "notes")` and query `Eq("scope", scope_key("acme", "notes"))`.
{% endhint %}

* 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

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Filter results</strong></td><td>Task walkthrough of scoping queries with Eq.</td><td><a href="/pages/f1kH8mnLEAKBG7sEkDOZ">/pages/f1kH8mnLEAKBG7sEkDOZ</a></td></tr><tr><td><strong>Metadata &#x26; filtering</strong></td><td>How filter columns and metadata relate.</td><td><a href="/pages/mCyhYY8XvfpJT4RScC5i">/pages/mCyhYY8XvfpJT4RScC5i</a></td></tr><tr><td><strong>Partitions &#x26; scope keys</strong></td><td>Compose one key from several fields.</td><td><a href="/pages/Rv5cBr1GHyWvxVC7AeIF">/pages/Rv5cBr1GHyWvxVC7AeIF</a></td></tr><tr><td><strong>SDK API index</strong></td><td>The full public surface.</td><td><a href="/pages/noudKEHV7DgrGM5qy5p6">/pages/noudKEHV7DgrGM5qy5p6</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.telys.ai/reference/filters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
