Repository navigation
feat(dashboard): Mention memories in the composer - #4099
Merged
Merged
Conversation
…Cmd+K Add GET /api/memory/search, a word-prefix search of active public memory backed by a new simple-config GIN index. The composer @ menu gets a Memories source that sends a memory as a labeled link to its page, and Cmd+K's Memories group reads the same search. Co-Authored-By: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
7 screenshot changes — 7 changed · 0 added · 0 removed Review screenshots in Frameshift |
BYK
requested changes
Nov 23, 2026
BYK
left a comment
Member
There was a problem hiding this comment.
See my comments in the thread regarding a better Omni Search for all using the same systems everywhere. This one sounds like very custom with only 4 words etc
This was referenced Nov 23, 2026
BYK
added a commit
that referenced
this pull request
Nov 23, 2026
…ch (#4106) Step 2 of #4095. Cmd+K now sends one `GET /api/search?q=&sources=inboxItems,automations` request for each typed query. Before, it sent a list search to `/api/inbox-items?q=` and another to `/api/automations?q=`. **What matches.** Each source still matches the text that Cmd+K matched before: - Inbox items: title and body. - Automations: title, instruction, skill, and event trigger. A pasted Automation id or dashboard URL also matches. A word matches when it starts a word of the text, so results show while the last word is still half typed. A typo in a title still matches when the trigram overlap is above the `pg_trgm` default threshold, for example one missing letter in a longer word. An untitled Automation shows the same title as on the Automations list. **One ranking.** The parts that memory recall already used are now in `packages/junior/src/search/`: - `typed-query.ts` turns typed text into a prefix tsquery, a fuzzy text, and tokens for id matches. - `text-match.ts` builds the SQL for prefix and fuzzy matches and their ranks (`ts_rank_cd`, `word_similarity`), and holds the capped rank window. - `match-ranking.ts` dense-ranks each match leg (exact, lexical, fuzzy, vector) and fuses the legs with reciprocal rank fusion. `rankMemoryMatches` now calls the same fusion, and memory's `withDenseRanks` moved here. Each source works like memory recall: its GIN indexes find the matches, it keeps the newest 200, and it ranks only those. **Indexes.** - Migration 0163 adds the `pg_trgm` extension. A self-hosted database now needs it as well as pgvector, and the docs say so. - Migration 0164 builds four GIN indexes with `CONCURRENTLY`: a weighted `simple` tsvector document for each table (title weighted `A`, other text `B`), and a `gin_trgm_ops` index on each lowercase title. - The Automation indexes are partial (`status <> 'deleted'`). **Shaped for an agent tool.** `omniSearch` in `chat/omni-search/search.ts` runs the search, outside the HTTP route. Each source applies its own page's access rule there: the viewer's own Inbox, and the Automations that the viewer owns or that are shared to them. An Omni Search tool for Junior can call the same function later. This PR does not add the tool. **Open items:** - Memories move under `/api/search` in a follow-up, after #4099 merges. That PR also uses migration number 0163, so whichever PR merges second renumbers. - Embeddings (the vector leg) for Inbox items and Automations need an embedding pipeline and a backfill for each source. - With `junior_inbox_items` in the big-table list, the versions poll shows a full scan on `junior_inbox_items_open_action_owner_idx`. It has a named allowance here and needs its own fix. - To-dos are the next step of the issue. | | Desktop | Mobile | | --- | --- | --- | | Dark |  |  | | Light |  |  | <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Afdfa7bbd318b8b6ac1a5022815b6670e --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Afdfa7bbd318b8b6ac1a5022815b6670e) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Afdfa7bbd318b8b6ac1a5022815b6670e/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
Co-Authored-By: BYK <[email protected]> # Conflicts: # packages/junior-dashboard/e2e/inbox/command-palette.spec.ts # packages/junior-dashboard/e2e/inbox/memories.spec.ts # packages/junior-dashboard/src/client/components/paletteDirectories.ts # packages/junior-dashboard/src/mock-reporting/routes.ts # packages/junior/migrations/meta/0163_snapshot.json # packages/junior/migrations/meta/_journal.json # packages/junior/tests/fixtures/sql-budget.ts
Drop the custom /api/memory/search route, its index migration, and the Cmd+K switch. The composer @ Memories source now reads /api/search?sources=memories, the same search as Cmd+K, so the bundle fits main's baseline again. Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 23, 2026
22 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Memories as a source in the composer's
@menu, next to people, Conversations, Tasks and files. A person can now point the agent at a saved memory the same way they point it at a Conversation, without copying its text or link.Search
The source reads the shared
/api/search?sources=memories, the same search that Cmd+K uses. It finds active public memories with memory recall's hybrid ranking, so the composer and Cmd+K show the same matches. This PR adds no route, index or migration.What the agent receives
A memory chip is sent in the existing
<url|label>form, with no new format:The URL is the memory's existing dashboard page. The label is the search's title of the memory with line breaks collapsed. Memory links never become linked work on the Conversation.
Composer
The Memories group follows the same menu, card and chip rules as the other
@sources. The chip has a Brain icon, and the card shows the memory text with its line breaks.Screenshots (mock data)
The
@menu with a memory selected:The inserted memory chip:
via @BYK.
--
View Session [Sentry]