convex integration with supermemory#880
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 393aef1 | Commit Preview URL Branch Preview URL |
Apr 24 2026, 07:15 PM |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Claude finished @sreedharsreeram's task in 1m 18s —— View job Review: PR #880 - Convex Integration Documentation
Overview: Adds new documentation for integrating Supermemory with Convex apps, including basic setup, AI chat with memory, and storing memories in Convex tables. Issues found:
Note: The Score: 8/10 Good documentation structure with clear examples. One install instruction gap needs fixing before merge to prevent user friction. |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29aa1c1 to
393aef1
Compare
| A chat endpoint using the Supermemory AI SDK middleware. It automatically injects context and saves memories. | ||
|
|
||
| ```typescript | ||
| // convex/chat.ts |
There was a problem hiding this comment.
withSupermemory is called with (model, userId, options) but the actual signature is (model, options) where containerTag and customId are required fields inside the options object. This will not compile.
Should be:
const model = withSupermemory(openai("gpt-4o-mini"), {
containerTag: userId,
customId: `convex-chat-${userId}`,
mode: "full",
addMemory: "always",
});See the existing AI SDK docs and the wrapVercelLanguageModel signature in packages/tools/src/vercel/index.ts:111.
| ## Example: AI chat with memory | ||
|
|
||
| A chat endpoint using the Supermemory AI SDK middleware. It automatically injects context and saves memories. | ||
|
|
||
| ```typescript | ||
| // convex/chat.ts |
There was a problem hiding this comment.
customId is a required field for withSupermemory (it groups messages into a single document for contextual memory generation) but it is missing entirely from this example. Without it, the call will throw at runtime:
customId is required — provide a non-empty string to group messages into a single document
| limit: limit ?? 10, | ||
| }); | ||
| }, |
There was a problem hiding this comment.
The import from "@supermemory/tools/ai-sdk" is correct, but the doc also imports { openai } from "@ai-sdk/openai" and { generateText } from "ai" — these packages should be listed in the install step or at least mentioned as peer dependencies. Currently the setup section only lists supermemory and convex.
| ```bash | ||
| npx convex env set SUPERMEMORY_API_KEY your-supermemory-api-key | ||
| ``` | ||
|
|
There was a problem hiding this comment.
The install step says npm install supermemory convex but the code examples use two different packages:
- The basic integration (lines 33-65) uses
import Supermemory from "supermemory"(the core SDK) - The AI chat example (lines 75-98) uses
import { withSupermemory } from "@supermemory/tools/ai-sdk"(the tools package)
Either consolidate the install to include both, or split into per-section install commands:
npm install supermemory @supermemory/tools @ai-sdk/openai ai convex| icon: "database" | ||
| --- | ||
|
|
||
| Convex apps don't have built-in memory for AI. Supermemory fixes that. You get a memory layer that stores conversations, builds user profiles, and gives your AI context about who it's talking to. |
There was a problem hiding this comment.
Minor: "Convex apps don't have built-in memory for AI" reads as a slight against Convex. Consider softening to something like "Add a persistent memory layer to your Convex apps" to keep the tone neutral and focused on what Supermemory adds rather than what Convex lacks.
| ```typescript | ||
| // convex/memory.ts | ||
| import { action, mutation, query } from "./_generated/server"; | ||
| import { api } from "./_generated/api"; |
There was a problem hiding this comment.
The addMemory action stores to both Supermemory and Convex, but there is no error handling if one succeeds and the other fails. Since this is docs, it is fine to keep it simple, but consider adding a brief note that production code should handle partial failures (e.g., Supermemory write succeeds but Convex mutation fails, leaving them out of sync).

No description provided.