- Format ternary operator on single line per Biome rules
- Replace non-null assertion with proper undefined check
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Portal the invite-teammate dialog into the settings modal and autofocus the email input, matching the delete-org dialog fix. Stacked body-portaled dialogs broke focus so the email field stopped accepting input after the first invite.
Fixes ENG-1110
workspaceDomainFromEmail returned the raw domain for free providers, so a gmail.com user picking Team was shown gmail.com as their company domain. Confirming it named the org "Gmail", persisted brainWorkspaceDomain, and ran company research against Gmail.
It now returns null for consumer providers, so the confirm step starts empty and requires a real company domain.
- Drop the company-brain-beta PostHog flag gate; Team mode is available to all users.
- Remove the invite-only gate card and the effectiveMode downgrade that silently wrote brainMode: "personal" on team signups.
- Add a "Use a personal workspace instead" link to the domain-confirm step, which had no way back once the gate stopped catching users.
Fixes ENG-1106
## Summary
- Documents that mono attaches Scale 14d trial + Company Brain after Slack OAuth from `/brain`.
Stacks on #1310. Billing implementation is in mono.
New /brain route creates the org straight from signup and redirects into the Slack install, so onboarding has no domain-confirmation step. Returning from OAuth shows an Open Slack handoff instead of a toast.
Also models the terminal research error state: polling stops, the UI retries once, and the docked header no longer gates Continue on research finishing.
## Stack context
Stacks on #1306, which moves Company Brain settings into the revamped Configure page.
Backend contract and runtime support: supermemoryai/mono#2581. The UI safely hides any effort controls omitted by an older backend response.
## What changed
- Adds independent Low, Medium, High, and Extra high reasoning controls for Main, Triage, and Research.
- Saves model and reasoning edits together through the existing partial PATCH.
- Keeps controls visible but disabled for non-admin members.
- Explains that Extra high maps to High for Grok and GPT providers.
## Validation
- `bunx biome check apps/web/hooks/use-brain-models.ts apps/web/components/settings/company-brain-models.tsx`
- `bun run build` in `apps/web`
- `git diff --check`
The standalone web TypeScript command still reports pre-existing unrelated errors outside these files.
---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/1c4f3ec7-a536-4105-bbe7-8b19e61f245f)
- Requested by: Sreeram Sreedhar (sreeram@supermemory.com)
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
Adds an admin-gated Models tab (main/triage/research pickers) that reads/writes the mono /brain/models endpoint, shown only for Company Brain orgs. Extracts a shared useOrgMemberRole hook so the brain settings sections dedupe the getActiveMember call.
Fixes ENG-1054
Co-authored-by: Dhravya Shah <dhravya@supermemory.com>
Co-authored-by: Dhravya Shah <dhravyashah@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Adds the **Proactiveness** settings tab for Company Brain channel/DM automations.
- Accordion list of automations — collapsed rows with an instant enable toggle + **Run now**, expand to edit.
- Two-column editor: prompt (left) / deliver-to channel or DM, frequency, day, time (right), with local-timezone-aware cron.
- Preset gallery (connection-first, category-diverse) for empty state + a New-automation menu.
- DM delivery option with a tooltip explaining channel visibility + personal-connection fallback.
- Profile-menu entry (gated on Company Brain).
Pairs with the API automations work: **supermemoryai/mono#2480**.
- Confirm-domain step, then live research transcript + action rail
- Poll research status; client-side force-start fallback
---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/4f4c1321-9b65-4dac-9906-8b78c4c32926)
- Requested by: Unknown
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
### TL;DR
Adds a swipeable "Review suggestions" card to the dashboard that lets users approve or decline inferred memories surfaced by Nova.
### What changed?
- Added a `ReviewMemoriesCard` component that appears in the "Suggested for you" section of the dashboard (both desktop and mobile layouts). The card is hidden when there are no pending inferred memories, so it never renders empty chrome. While the modal is open, the displayed count is frozen so the trigger button doesn't tick down or disappear mid-session. Switching spaces closes the modal automatically.
- Added a `ReviewMemoriesModal` component that presents inferred memories as a swipeable card deck. Users can approve (swipe right / ✓), decline (swipe left / ✗), or skip each memory. The modal includes:
- Drag-to-swipe with a full-card color wash (green for keep, red for decline) and verdict pills that intensify as the swipe threshold approaches
- Keyboard support: `→` to approve, `←` to decline, `↓` or `Space` to skip, and `Cmd/Ctrl+Z` to undo
- An undo button that steps back one card and reverts the server-side decision, using refs to avoid stale-state bugs during rapid interactions
- A progress dot indicator showing position in the queue alongside a numeric counter
- A "All caught up" completion state summarising how many memories were kept
- Reduced-motion support via `useReducedMotion`
- The card queue is snapshotted when the modal opens so cache updates from review mutations don't reshuffle the stack mid-session
- Added a `useInferredMemories` hook to fetch the pending review queue for a given container tag, and a `useReviewInferredMemory` mutation hook that calls the review endpoint. On success it removes the reviewed entry from the cached queue directly; on undo it invalidates the query to refetch the restored memory from the server.
- Registered two new API schema entries: `GET /container-tags/:containerTag/inferred` to fetch the pending queue and `POST /container-tags/:containerTag/inferred/:memoryId/review` to submit an approve, decline, or undo action.
### How to test?
1. Ensure there are inferred memories pending review for a container tag.
2. Open the dashboard — a "Review suggestions" card should appear in the "Suggested for you" section showing the count of pending memories.
3. Click the card to open the modal and swipe or use the buttons/keyboard to approve, decline, or skip memories.
4. Verify that approved and declined memories are removed from the queue after each decision and that the completion state appears once all cards are reviewed.
5. Use the undo button or `Cmd/Ctrl+Z` to step back through decisions and confirm the server-side state is reverted correctly.
6. Confirm the card does not render when there are zero pending inferred memories.
7. Switch spaces while the modal is open and confirm it closes without carrying state into the new space.
### Why make this change?
Nova infers memories on behalf of users but may not always be fully confident in them. This feature gives users a lightweight, low-friction way to review and curate those suggestions directly from the dashboard, improving the quality and trustworthiness of their memory store.
Hide the Getting Started checklist when all 3 onboarding steps complete, letting Recent memories go full-width. Swap the Setup 3/3 stat tile to a live Last updated timestamp once setup is done.
---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/afbb6d10-e42e-4b40-aac9-90aba9532ec7)
- Requested by: Unknown
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
Connections board on brain home: featured app tiles with OAuth/static connect against brain/mcp-connections, agent preview prompts, connector icon set, and reworked company-brain connections in settings.
---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/e37671c7-3893-48d6-ad66-73200826c04d)
- Requested by: Unknown
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
- onboarding: unified About step, mode-aware Sources, Slack-focused Flows step, connect feedback (toast + connected state), auto-draft company description from domain
- brain-home: Active members stat + invite, real OneDrive icon
- useConnectorAccess hook so company_brain unlocks pro-tier connectors across onboarding + integrations
- fix company-brain-connections crash on empty connections
---
**Session Details**
- Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/64a15b29-0848-42d1-af4c-138c5a27136f)
- Requested by: Unknown
- Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
## Docs: add Forget Matching endpoint + fix stale Forget Memory docs
### What this does
- **Adds docs for the new** **`POST /v4/memories/forget-matching`** **endpoint** — semantic/promptable mass-forget. Covers `dryRun` (preview), `threshold`/`maxForget` safety bounds, the request/response shape, and `forgetBatchId`.
- **Corrects the existing "Forget Memory" section** to match the actual implementation.
### ⚠️ No API surface changed
This PR is **docs-only**. The existing forget endpoint's behavior/contract is untouched — the previous docs were simply **wrong** and described a route that has never existed:
| | Old docs (incorrect) | Actual implementation (unchanged) |
| --- | --- | --- |
| Method + path | `POST /v4/memories/{id}/forget` | `DELETE /v4/memories` |
| Body | — | `{ id \| content, containerTag, reason? }` |
The handler (`forgetMemory` in `apps/api/src/routes/v4/memories/handlers.ts`) was not modified — this just makes the docs reflect reality.
### Also
- Small accuracy cleanups (response field descriptions, realistic example IDs).
### TL;DR
Adds documentation for the Memory Review endpoints and Profile Buckets feature.
### What changed?
**Memory Review (`memory-review.mdx`)**
- Added a new documentation page covering the two inferred memory review endpoints: `GET /v3/container-tags/{containerTag}/inferred` and `POST /v3/container-tags/{containerTag}/inferred/{memoryId}/review`.
- Documents the three review actions (`approve`, `decline`, `undo`) and how each affects search ranking and memory state (`isInference`, `isForgotten`, `reviewStatus`).
- Includes request/response examples in both `fetch` and cURL, a field reference table, error codes, and a collapsible React Query hooks example for building a review UI.
- Registered the new page in `docs.json` under the "Manage Content" group and linked to it from the Memory Operations next steps.
**Profile Buckets (`user-profiles.mdx`)**
- Added a "Profile Buckets" section explaining custom topical categories (`preferences`, `goals`, `work`, etc.) as a complement to `static`/`dynamic` profile sections.
- Documents the `include`, `buckets`, and `filters` query parameters on the profile endpoint.
- Covers the `GET /v4/profile/buckets` endpoint for listing configured bucket definitions, with request/response examples and a field reference.
- Explains the `[Recent]` / `[Summary]` label convention used in bucket and dynamic profile entries.
- Updated the `ProfileResponse` TypeScript interface to mark `static` and `dynamic` as optional and add the `buckets` field.
### How to test?
- Navigate to the docs site and confirm "Memory Review" appears in the sidebar under "Manage Content".
- Verify all code examples render correctly and tabs switch between `fetch` and cURL variants.
- Confirm the React Query accordion expands and displays the TypeScript snippet.
- Check that the Profile Buckets section renders inline within the User Profiles page, including the response JSON blocks and the tip/note callouts.
### Why make this change?
Inferred (derived) graph memories are down-weighted in search until reviewed, but there was no documentation explaining how to surface or act on them. Similarly, profile buckets were a shipped feature with no public-facing docs. These additions give developers the reference material needed to build review UIs and use topical bucket filtering in their integrations.
## Summary
- Parse enabled MCP OAuth API keys from the integrations page key list.
- Show MCP as connected in MCP integration cards, the Active filter count, featured CTA, and active connections rail.
- Reuse the existing MCP metadata signal used elsewhere in the app (`sm_source: "mcp"` or `sm_kind: "mcp_oauth_exchange"`).
<img width="1918" height="657" alt="image" src="https://github.com/user-attachments/assets/0dc4dace-9d47-4f05-8aad-55bd947dfe1c" />
## Summary
- Fix delete-organization dialog focus when switching orgs inside Settings.
- Restyle delete-organization modal to match the app modal theme and remove extra organization icons.
- Make the organization switcher list scrollable when many orgs exist.
- Send Create organization directly to onboarding instead of opening the create-org modal.
- Stop onboarding from completing when org creation fails, show an error toast, and return existing users to the dashboard.