Skip to content

convex integration with supermemory#880

Open
sreedharsreeram wants to merge 2 commits intomainfrom
convex-docs
Open

convex integration with supermemory#880
sreedharsreeram wants to merge 2 commits intomainfrom
convex-docs

Conversation

@sreedharsreeram
Copy link
Copy Markdown
Member

No description provided.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 23, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
supermemory 🟢 Ready View Preview Apr 23, 2026, 5:48 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add 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.

Copy link
Copy Markdown
Contributor

@vorflux vorflux Bot left a comment

Choose a reason for hiding this comment

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

Reviewed — found 2 issues in the documentation examples.


Review with Vorflux

Comment thread apps/docs/integrations/convex.mdx
Comment thread apps/docs/integrations/convex.mdx
@sreedharsreeram sreedharsreeram marked this pull request as ready for review April 24, 2026 19:12
@sreedharsreeram sreedharsreeram requested a review from Dhravya April 24, 2026 19:12
@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

Claude finished @sreedharsreeram's task in 1m 18s —— View job


Review: PR #880 - Convex Integration Documentation

  • Fetch PR diff and review changes
  • Check existing review comments to avoid duplicates
  • Analyze documentation for technical accuracy
  • Submit review findings

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:

  1. Missing install instructions for AI SDK packages (line 87) — The AI chat example imports ai, @ai-sdk/openai, and @supermemory/tools/ai-sdk, but these aren't in the install command at the top. Users will get Cannot find module errors. Fix this →

Note: The api import issue (previously flagged by Vorflux) has been fixed in commit 393aef1 — line 138 now correctly includes import { api } from "./_generated/api";.

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>
Copy link
Copy Markdown
Contributor

@vorflux vorflux Bot left a comment

Choose a reason for hiding this comment

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

Documentation-only PR for Convex integration. The structure and content are solid overall, but there are a few issues -- most critically, the withSupermemory call in the AI SDK chat example uses the wrong function signature.

A chat endpoint using the Supermemory AI SDK middleware. It automatically injects context and saves memories.

```typescript
// convex/chat.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +83 to +88
## 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment on lines +75 to +77
limit: limit ?? 10,
});
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant