Skip to content

Topics

Broader groups over your keywords, such as Art over “Painting”, “Photography” and “Museums” (SI-552). A keyword is narrow: one item has “Bauhaus”, the next “Brutalism”. A topic takes them together, so you can browse a whole field at once, for example in the masonry. The AI makes the topics; you pick one. Code: services/topics.ts, the menu in TopicMenu.svelte.

In the stream

Topics in the stream’s lede, beside the order, opens a panel:

  • The topics, the most items first, each with how many items have one of its keywords. A topic filters the stream: /?topic=<id>, with Unread and All, a tag, the order and the score bounds, as a keyword does. The header says so (“12 unread in “Art””) next to a chip whose cross removes the topic.
  • Under each topic, its biggest keywords. One filters the stream by that keyword instead of the topic. “+12” opens the whole topic.
  • Every topic removes the topic and the keyword filter.

The unread count, the “new items” pill and Mark all as read keep to the topic. A topic that no longer exists shows the whole stream. Starred and Filtered show every item of theirs.

The filter is a short walk per stream row: the item’s few keywords in item_keywords (its primary key), each looked up in keywords for its topic. The stream still pages from its own index (the query-plan test checks it).

How the keywords get grouped

One call to GPT-6 Luna (DeepSeek V4.1 Flash when it fails), reasoning off, with every keyword that is on at least one of your items, the most used first, up to 500. The model makes 4 to 24 topics and puts each keyword in exactly one. A keyword that fits nowhere goes in “Other”. The answer is strict JSON.

  • Your current topics are in the prompt. The model keeps their names where they still fit, and a topic whose name stays keeps its id, so a link to it still works. A topic it no longer names is deleted, and its keywords are in none until the next grouping.
  • New topic names in your summary language (summaries.md), or English when summaries keep the item’s own language, as for new keywords.
  • Names are tidied like keyword names (at most 40 characters). Names the model makes up that aren’t your keywords are ignored.

When:

  • The first time you open Topics, once 5 or more keywords are on your items.
  • Again when you open Topics, when new keywords are waiting for a topic and the last grouping is more than a day old. Keywords the AI gives new items stay out of every topic until then.
  • Group again in the panel, whenever you like.

At most 10 groupings in 24 hours. Two tabs opening Topics at once share one grouping.

Keywords you rename, merge or delete keep or lose their topic with them: a merged keyword keeps the topic of the one whose name it takes, and a deleted keyword leaves its topic. A topic with no keywords on items isn’t listed.

What is stored

Migration 0027_topics:

Table
topics id, user_id, name (unique per user ignoring case). Deleted with the user
keywords.topic_id The keyword’s topic, or null. Set to null when the topic is deleted

When the keywords were last grouped is not stored separately: it’s the newest topics call in the cost ledger.

API

Request
GET /api/v1/topics { topics: [{ id, name, itemCount, keywords: [{ id, name, itemCount }] }], status: { groupedAt, ungrouped, due } }, the most items first
POST /api/v1/topics/group { ifDue? } Groups the keywords (a write token). Answers with the topics, grouped and costUsd. With ifDue, only when status.due is true; otherwise nothing runs and grouped is false. 402 over the budget, 403 (no_key) without the right to use AI (costs.md) (with ifDue, grouped is false instead), 422 with fewer than 5 keywords on items, 429 after 10 in 24 hours, 503 without the pipeline

GET /api/v1/stream, /stream/new and POST /stream/read take topic (an id) like keyword (stream.md).

The SDK has topics() and groupTopics({ ifDue }), and topic on stream(), newItems() and markAllRead().

Costs

A grouping is one call with every keyword in and every keyword out again: an estimated $0.002 for 500 keywords, from the tokens at GPT-6 Luna’s price, not yet measured on real keywords. It’s listed under Topics in Settings → Costs (costs.md) and paid within your monthly budget. Over the budget, grouping stops; the topics you have stay.

Not yet

  • Moving a keyword to another topic by hand, and renaming a topic.
  • Topics in Settings → Keywords: the list shows each keyword without its topic.
  • The agent showing a view by topic: its card lists take a keyword or words (views.md).