feat(sdk-playground): interactive SDK chat playground - #1437
Conversation
|
Claude finished @ved015's task in 1m 46s —— View job Code Review Complete
Overview: Adds an SDK playground app with Next.js frontend and Python FastAPI backend for interactively testing Supermemory SDK integrations across TypeScript and Python. Issues found: None — this looks good to ship. I reviewed ~5700 lines of new code across 29 files including:
Previous review issues addressed: The latest commits fix the issues from the earlier Cursor Bugbot review:
Security measures in place:
Design choices appropriate for a dev playground:
Score: 9/10 Minor deduction: The debug memory panel explicitly notes it shows a "post-response snapshot" rather than the exact context injected by middleware — this is working as designed and clearly labeled, not a bug. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 8a78b11 | Aug 24 2026, 04:26 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 8a78b11 | Commit Preview URL Branch Preview URL |
Aug 24 2026, 04:28 PM |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| }, | ||
| { status: 400 }, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Context API needs OpenAI key
Medium Severity
The context routes use resolveApiKeys, which returns null unless both Supermemory and OpenAI keys are present. Loading container context only calls Supermemory, and the context panel only validates the Supermemory key, so a dashboard with just a Supermemory key still gets a 400 from /api/context.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| } else { | ||
| delete process.env.OPENAI_API_KEY | ||
| } | ||
| } |
There was a problem hiding this comment.
Shared env keys race
Medium Severity
Chat handlers temporarily overwrite global SUPERMEMORY_API_KEY and OPENAI_API_KEY on the shared Node process and Python process. Overlapping requests with different dashboard keys can read or write the wrong credentials mid-flight.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
| skipMemoryOnError: middlewareConfig.skipMemoryOnError, | ||
| }, | ||
| keys.supermemoryApiKey, | ||
| ) |
There was a problem hiding this comment.
Debug shows post-chat profile
Low Severity
Middleware memory debug is built by fetching profile after the model response (and after auto-save). The “Context injected into prompt” preview can include memories written in that same turn, not what middleware actually injected.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 93f92cd. Configure here.
There was a problem hiding this comment.
Overview: Adds a new SDK playground app with Next.js frontend and Python FastAPI backend for interactively testing Supermemory SDK integrations across TypeScript and Python.
Issues found: None — this looks good to ship.
I reviewed ~4000 lines of new code across 26 files including:
- Next.js API routes (
/api/chat,/api/context) - Python FastAPI server with multiple SDK integration handlers
- Frontend components (chat UI, API keys panel, context panel)
- Core business logic (
chat-handlers.ts,context-api.ts,api-keys.ts)
Design choices appropriate for a dev playground:
- API keys in localStorage with clear user messaging
- Permissive CORS on Python server (
allow_origins=["*"]) - Temporary env var manipulation for SDK compatibility
Code quality observations:
- Good error handling throughout both TypeScript and Python
- Proper API key resolution chain (user input → env vars)
- Clean SDK abstraction via registry pattern
- Tool loop limits prevent runaway execution (8 steps max)
Score: 9/10
Minor deduction for documentation mismatch (README says port 8791, env example says 8792) — not a blocker.
Next.js UI with TypeScript and Python chat backends, context panel, API key management, tools reference, and middleware configuration. Co-authored-by: Cursor <cursoragent@cursor.com>
78269ff to
69def1a
Compare
93f92cd to
4e04a0d
Compare
There was a problem hiding this comment.
Overview: Adds an SDK playground app with Next.js frontend and Python FastAPI backend for interactively testing Supermemory SDK integrations across TypeScript and Python.
Issues found: None — this looks good to ship.
I reviewed ~5000 lines of new code across 29 files including:
- Next.js API routes (
/api/chat,/api/context) with proper request validation - Python FastAPI server with multiple SDK integration handlers
- Frontend components (chat UI, API keys panel, context panel)
- Core business logic (
chat-handlers.ts,context-api.ts,request-validation.ts) - CI workflow additions for Python validation
Previous review issues addressed:
The latest commit (4e04a0d) fixes the two substantive issues from the earlier Cursor Bugbot review:
- ✅ Context API no longer requires OpenAI key (now uses
resolveSupermemoryApiKey) - ✅ API keys are passed directly to SDK clients, eliminating the env-var race condition
Security measures in place:
TrustedHostMiddlewarerestricts Python server to localhost onlyassertTrustedBrowserRequestvalidates request origin and rejects cross-site requestsmayUseEnvironmentKeysrestricts env-key usage to trusted hosts (localhost, sdk.dev.supermemory.ai)- Comprehensive input validation with length limits, pattern matching, and body size checks
SecretStrused for API keys in Python Pydantic models- API keys stored in
sessionStorage(notlocalStorage), scoped to tab lifetime
Design choices appropriate for a dev playground:
- Permissive CORS on Python server (localhost-only anyway)
- 8-step tool loop limit prevents runaway execution
- Proper timeout handling with best-effort debug info collection
Score: 9/10
Minor deduction for documentation mismatch (README mentions port 8791 in one place, env example says 8792) — not a blocker.



Summary
apps/sdk-playground— chat UI to test TS/Python SDK integrationsportless.jsonStacked on #1436
Test plan
cd apps/sdk-playground && bun run check-typesbun run devwith Supermemory + OpenAI keys in UIMade with Cursor