Skip to content

Filters and mute words

Rules that keep items out of your stream before they reach it (SI-554). A mute word is the simplest rule: one word or phrase, anywhere in an item. A rule can also combine conditions: “from The Daily and “sponsored” in the title”. Muted items never go into the AI pipeline, so they cost nothing, and they stay findable in search, marked with the rule that muted them. Code: services/filters.ts, the page in routes/(app)/settings/filters.

Rules

A rule has one to five conditions, and an item has to meet all of them:

  • Words, anywhere, in the title, in the text, or by author. Words match as whole words in any case: “AI” mutes “AI news” but not “said”, and “best VPN” matches across any space. “In the text” is the item’s extracted text, or the feed’s content and excerpt before extraction (filter-match.ts, the SQL function mute_match in db/client.ts).
  • Without words: the other way round, an item that doesn’t have the words, anywhere or in one place. With a source it keeps one topic of a channel: “from Tech Talks and without “Rust” in the title” mutes everything from Tech Talks except its Rust videos. A rule needs at least one other condition, since “without” words alone would mute nearly everything you follow.
  • Source: an item of a source you follow.
  • YouTube video: a Short or a live stream. The account-wide switches under Appearance hide them too (stream.md). A rule can do it for one channel.

A rule without a name is named after its conditions: “Mute “election” anywhere”, “Mute from Tech Talks and without “Rust” in the title”. When its conditions change, the name changes with them, unless you gave it one.

Mute for a day, 7 days, 30 days, or until you delete the rule. An expired rule stays in the list, marked expired, and mutes nothing more: the scheduler gives its items back within a minute (scheduler.md).

At most 200 rules per user.

What muting does

  • When a rule is added, it mutes the items it matches at once, the ones already in your stream included. The editor shows what it would do before you save: “This rule would hide 23 items”, and the newest five.
  • New items are matched when they reach your stream, in the same transaction that hands them out (addItems). The pipeline only queues unmuted items, so a muted item is never extracted, gated, summarized or scored for you (pipeline.md). A new subscription’s first items are matched too.
  • Muted items are out of Unread, All, Filtered, the counts, the “new items” pill, and stories: a story whose lead is muted shows as its next item (dedupe.md). Starred keeps every starred item.
  • Search still finds them, with a “Muted by …” note that links here (search.md).
  • Turning a rule off, changing it, or deleting it gives its items back, unless another rule mutes them. Items that reached your stream in the last 7 days and never went through the pipeline are queued now; older ones stay as they are, so a deleted rule doesn’t pay for old news.
  • The first rule wins. Rules are applied oldest first; an item records the one rule that muted it (user_items.muted_by). The count next to each rule is the items it mutes now.

Rules are per user. Two users who follow the same source each have their own rules, and one user’s rule never hides an item from the other.

Storage

filter_rules holds the rules: name, conditions (JSON, as in the API), enabled, expires_at. user_items.muted_by points to the rule that mutes the item, muted_at says since when. A partial index on muted_by serves the counts and giving items back; deleting a rule sets muted_by to null (migration 0019_filter_rules).

API

GET /api/v1/filters rules: newest first. Each has id, name, description (the conditions in words), conditions, enabled, expiresAt, status (active, paused, expired), mutedCount
POST /api/v1/filters { name?, conditions, enabled?, expiresAt? } → 201 { rule }. Mutes what it matches at once
PATCH /api/v1/filters/:id Any of name, conditions, enabled, expiresAt (null: never) → { rule }
DELETE /api/v1/filters/:id 204. Its items come back
POST /api/v1/filters/preview { conditions, ruleId? } → { count, items }: what the rule would mute, changing nothing. With ruleId, that rule’s own items count too

A condition is { type: 'text', field: 'any' | 'title' | 'content' | 'author', value, negate? } (negate: true: the item doesn’t have the words), { type: 'source', sourceId } or { type: 'video', kind: 'short' | 'live' }. Invalid rules answer 422 with error: 'invalid'; an unknown rule 404. Writing, the preview included, needs a session or a write token. Stream and search items carry mutedBy and mutedByName.

The SDK: filters(), createFilter(), updateFilter(), deleteFilter(), previewFilter().

Not yet

  • Doing something else with matching items, such as marking them read, starring them or saving them to Raindrop: that’s what rules are for.

  • The agent creating and removing rules (“mute ‘election’ for 7 days”) comes with its tools (SI-549), on this API.

  • Regular expressions and “any of” conditions.

  • A muted view listing a rule’s items; search finds them for now.

  • Muting by a check (“hide sponsored items”, SI-567): rules mute items before the pipeline, when no check has answered yet. A check’s bound in the stream’s order menu hides them from the view instead (checks.md).