Skip to content

feat(dashboard): Mention memories in the composer - #4099

Merged
BYK merged 4 commits into
mainfrom
feat/composer-memories
Nov 23, 2026
Merged

BYK merged 4 commits into
mainfrom
feat/composer-memories

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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:

<{origin}/memories/{id}|{start of the memory text, on one line}>

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:

Dark Light
Desktop desktop dark menu desktop light menu
Mobile mobile dark menu mobile light menu

The inserted memory chip:

Dark Light
Desktop desktop dark chip desktop light chip
Mobile mobile dark chip mobile light chip

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 23, 2026 15:06
…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]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 23, 2026 15:19
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 23, 2026 7:39pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

7 screenshot changes — 7 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Event Log · Mobile
Conversation Event Log · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed
Inbox Tree State · Desktop
Inbox Tree State · Desktop
Changed
Inbox Tree State Light · Desktop
Inbox Tree State Light · Desktop
Changed
System Cache Tokens · Desktop
System Cache Tokens · Desktop
Changed
Show 1 more changed screenshot
System Cache Warming Refill · Desktop
System Cache Warming Refill · Desktop
Changed

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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 | ![Cmd+K results for "revie", dark,
desktop](https://junior-prod.sentry.dev/public/artifacts/e8c144b8-a923-49cd-834c-324e90b876d6.png)
| ![Cmd+K results for "revie", dark,
mobile](https://junior-prod.sentry.dev/public/artifacts/d1ad7c5f-4c2e-4b4d-b71b-29bfe6ef2bc4.png)
|
| Light | ![Cmd+K results for "revie", light,
desktop](https://junior-prod.sentry.dev/public/artifacts/d07c7f82-5ef2-4af9-98d1-434a766b8ed8.png)
| ![Cmd+K results for "revie", light,
mobile](https://junior-prod.sentry.dev/public/artifacts/197fab98-a1de-477f-a652-0e6904a39204.png)
|

<!-- 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]>
sentry-junior Bot and others added 2 commits November 23, 2026 19:25
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]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 23, 2026 19:39
@sentry-junior sentry-junior Bot changed the title feat(dashboard): Mention memories in the composer and search them in Cmd+K feat(dashboard): Mention memories in the composer Nov 23, 2026
@BYK
BYK merged commit c331dfd into main Nov 23, 2026
55 checks passed
@BYK
BYK deleted the feat/composer-memories branch November 23, 2026 20:14

This branch was successfully deployed

1 active deployment
Preview – junior-docs — baf2acd5 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant