Save and recall facts with Supermemory tools — addMemory and searchMemories in a simple Remember / Recall playground.
Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: SUPERMEMORY_API_KEY, AI_GATEWAY_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
AI SDK APIs
generateTextisStepCountExternal services
app/page.tsxapp/layout.tsxapp/api/memory-supermemory/route.tscomponents/memory-demo.tsxcomponents/memory-activity.tsxcomponents/supermemory-icon.tsxhooks/use-memory-playground.tslib/memory-container-tag.tslib/memory-container.tslib/memory-playground.tslib/request-utils.tsREADME.mdnpm packages
6
Registry components
memory-supermemory/route.tsAction-based API (remember|recall) that calls supermemoryTools(apiKey, { containerTags }) with a server-derived preview containerTag via generateText. Bridge the nested ai@5 Tool type to the app's ai@7 ToolSet with a cast — do not invent a thinner tool wrapper or local memory store.
lib/memory-container.tsPreview isolation helper: httpOnly cookie -> containerTag. Production must replace with authenticated user id; never let the model choose container scope.
lib/memory-playground.tsPlayground request contract and prompts for remember vs recall turns.
Save and recall facts with Supermemory tools — addMemory and searchMemories in a simple Remember / Recall playground.
Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: SUPERMEMORY_API_KEY, AI_GATEWAY_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
AI SDK APIs
generateTextisStepCountExternal services
app/page.tsxapp/layout.tsxapp/api/memory-supermemory/route.tscomponents/memory-demo.tsxcomponents/memory-activity.tsxcomponents/supermemory-icon.tsxhooks/use-memory-playground.tslib/memory-container-tag.tslib/memory-container.tslib/memory-playground.tslib/request-utils.tsREADME.mdnpm packages
6
Registry components
memory-supermemory/route.tsAction-based API (remember|recall) that calls supermemoryTools(apiKey, { containerTags }) with a server-derived preview containerTag via generateText. Bridge the nested ai@5 Tool type to the app's ai@7 ToolSet with a cast — do not invent a thinner tool wrapper or local memory store.
lib/memory-container.tsPreview isolation helper: httpOnly cookie -> containerTag. Production must replace with authenticated user id; never let the model choose container scope.
lib/memory-playground.tsPlayground request contract and prompts for remember vs recall turns.
Loading preview…
Early-bird pricing — limited time

Open on desktop for the interactive preview.
Save and recall facts with Supermemory tools — addMemory and searchMemories in a simple Remember / Recall playground.
Loading preview…
Early-bird pricing — limited time

Open on desktop for the interactive preview.
Save and recall facts with Supermemory tools — addMemory and searchMemories in a simple Remember / Recall playground.