Repository navigation
Description
Cmd+K already searches most sources, but each source has its own match rule, and several of these rules cannot use an index. Omni Search is one indexed search, with prefix match while the person types, that Cmd+K and the composer @ menu share. A new source, such as Memories under @, is then added one time for both.
Current behavior
Commit ae8bc50. Cmd+K is CommandPaletteDialog.tsx and paletteDirectories.ts.
| Source | Cmd+K | @ menu |
Server match |
|---|---|---|---|
Pages, actions (navPages.ts) |
Client | – | – |
| Conversations | Client (feed) + server | Server | english tsvector, ILIKE '%q%' on title, vector similarity |
| Inbox items | Client (cached list) + server | – | ILIKE '%q%' on title and body, no text index |
| Automations | Client (first 100) + server | – | strpos(lower(concat_ws(…))), no index |
| Memories | Server | – | ILIKE '%term%' on content, no index that it can use |
| People | Client (full directory) | Server | simple prefix, term:* (people/search.query.ts) |
| Pull requests (Changes) | Open repository page only | # menu, server |
simple prefix (code/search.query.ts) |
| Locations, Repositories, Runs, Events | Client (loaded list or history) | Channels in # |
– |
| Plugin pages | Server, one read for each page | – | Each page's own rule |
| Tasks, files of the open Conversation | – | Client | – |
| To-dos | – | – | No read across Conversations |
Gaps:
- Each debounced query in Cmd+K starts one server read for each source: Conversations, Inbox items, Automations, Memories, the open repository's Conversations, and each plugin page. The count grows with each plugin page.
- The dashboard memory search uses
ILIKE '%term%', which cannot use an index. The indexedsearch_vectorusesenglish, so it stems words. A half-typed word, such asdeplo, does not matchdeployment. - To-dos have no search. The only read is the To-dos of one Conversation (
requireConversationTodos). The table has only its primary key(conversation_id, id). - People match on the client in Cmd+K, but on the server with prefix match in
@. The same text can give different rows.
Proposal
Goal. One server search that Cmd+K and @ share. Each caller names the sources it wants.
Sources. Conversations, Inbox items, Automations, Memories, To-dos, People, and Pull requests. Pages, actions, and the lists of the open page stay on the client.
Access. Each source returns only the rows that its own page shows to the viewer:
- Conversations: the Conversation access rules (
policies/conversation-access.md). - Inbox items: the viewer's own Inbox (
forViewer). - Automations: the Automations that the viewer owns or that are shared to the viewer, as the Automations list does.
- Memories: public, active memories (
activeMemoryPredicate). - To-dos: only when the viewer has
canViewPrivateContenton the To-do's Conversation. Other viewers get redacted titles today, so a match on a title must not show that the To-do exists.
Server shape. Recommended: one route, such as GET /api/search?q=&sources=.
- One request for each debounced query. The route runs the sources in parallel (
Promise.allover a fixed list) and returns one group for each source, each with a constant cap. - While the person types, use prefix match: a
simpletsvector andterm:*joined with&, as People and Pull requests do now. Each source gets a GIN expression index on its title text, partial where the access rule allows (for example, public, active memories). - The existing
englishfull-text and vector searches stay on each page's own search. - Budgets (
policies/performance.md):expectSqlBudget,expectNoFullScan, andexpectResponseBudgeton the route. Add an e2e request budget for one typed query in Cmd+K.
Alternative: one prefix route for each source. It is simpler to own, but Cmd+K keeps one request for each source.
Order.
- Memories. Its
ILIKE '%term%'scan grows with the table, and it is the next source for@. - Inbox items and Automations, which also have no index.
- To-dos, the one source that Cmd+K does not search.
Ranking and grouping.
- In a group: a match at the start of the title, then a word start in the title, then other text. Equal matches sort by most recent activity.
- Groups: the open page's group comes first, as now. Then the group with the best match. The client keeps
quickOpenMatchonly for the highlight. - Rows that the client already shows, such as feed Conversations, are not shown two times.
Open questions
- Do plugin pages join through a provider-neutral plugin search contract, or do they keep their own reads?
- Which To-dos: open ones only, or also the To-dos assigned to the viewer that are closed?
- Which sources does
@use? Memories and Automations do not have a composer reference type yet. - Do Inbox item bodies and Automation instructions get prefix match, or only their titles?
via @BYK.
--
Activity
sentry-junior commentedon Nov 23, 2026
Revised direction for step 2 (Inbox items and Automations on
/api/search), per BYK:simple-config GIN index on a weighted document, so a title match ranks above a body match, and a word prefix matches while the person types.ts_rank_cd, the same way memory recall does. A shared module inpackages/junior/src/search/fuses the ranks of each match leg with reciprocal rank fusion. Memory recall'srankMemoryMatchesnow uses the same function.pg_trgmadds a typo-tolerant title leg, indexed withgin_trgm_ops, so a missing letter in a longer word still finds the title.Embeddings (the vector leg) for Inbox items and Automations stay for a follow-up. They need an embedding pipeline and a backfill for each source.
sentry-junior commentedon Nov 23, 2026
Step 2 PR: #4106 (Inbox items and Automations on
/api/search, with body text, the shared ranking, and fuzzy title matching).sentry-junior commentedon Nov 23, 2026
Memories joined #4106 as a third source of
/api/search, so Cmd+K now reads Inbox items, Automations, and memories with one request. The memories source reuses memory recall's own search: the lexicalts_rank_cdand pgvector legs fused byrankMemoryMatches, with recall's vector cutoff, plus word-prefix matching for typed text. It reads active public memory only, as the Memories page does. #4099 stays parked; its separate/api/memory/searchroute and index are not needed.feat(dashboard): Search Inbox items and Automations through /api/sear…
sentry-junior commentedon Nov 23, 2026
To-dos step: #4113 adds To-dos as a source of
/api/search. Open and in-progress To-dos show in a To-dos group in Cmd+K. Done and dropped ones show under Done, after closed Inbox items. A To-do shows only when the viewer can see its Conversation's private content. It uses the shared prefix + trigram matching and fused ranking, with new title GIN indexes.feat(memory): Match half-typed words and cache query embeddings in Cm…
feat(dashboard): Search To-dos through /api/search (#4113)