fix(supermemory): document canonical API surface, ship anti-patterns reference#2
Open
Dhravya wants to merge 1 commit into
Open
fix(supermemory): document canonical API surface, ship anti-patterns reference#2Dhravya wants to merge 1 commit into
Dhravya wants to merge 1 commit into
Conversation
…reference A survey of 52 hackathon projects that integrate Supermemory found the same handful of AI-codegen failure modes over and over: fabricated endpoints, fabricated headers, deprecated plural containerTags, missing containerTag scoping, and SDK methods that don't exist. This skill was contributing to the problem — README and references pointed at /v3/search, the API-reference table documented containerTags (plural) as the canonical parameter, and the SDK integrations file used containerTags: ["user_123"] in every TS and Python example. This PR: - Adds a "Canonical API Surface" + "Things to never emit" block near the top of SKILL.md so agents see it before reading anything else. - Adds references/anti-patterns.md cataloguing every invented header, endpoint, body field, SDK method, and kwarg, paired with the canonical replacement. SKILL.md links to it as the first reference. - Rewrites the v4 search request body table in api-reference.md to use q, containerTag, threshold, rerank, rewriteQuery (the actual v4 params) and notes the legacy names. - Fixes all 10 containerTags: ["..."] / container_tags=["..."] uses in sdk-integrations.md (TS + Python) to containerTag singular. - Fixes the mixed containerTags[0]/containerTag pattern in use-cases.md by splitting the search into two scoped calls and merging by similarity. - Updates "Best Practices" to require Authorization: Bearer, singular containerTag, /v4/search. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A survey of 52 hackathon projects that integrate Supermemory found the same handful of AI-codegen failure modes over and over:
/v1/search,GET /search)x-project-id,X-Workspace-Id,x-sm-user-idoutside infinite-context,x-sm-projectoutside MCP)containerTagsplural array in body — currently the canonical shape in this skill's docscontainerTagscoping (about a sixth of projects had no scoping at all — every user's data collapsed into one bucket)search.execute,documents.add,documents.deleteBulk,documents.batch_add,memories.list,memories.updateMemory)chunk_threshold,sort,order,include_content,include_full_docs)This skill was unintentionally reinforcing several of these —
README.mdpointed agents atPOST /v3/search,references/api-reference.mddocumentedcontainerTags(plural) as the canonical search param, andreferences/sdk-integrations.mdusedcontainerTags: [\"user_123\"]in every TypeScript and Python example.Changes
Out of scope (intentional)
The API still accepts `x-supermemory-api-key`, `x-api-key`, `containerTags` plural, and `/v3/search` for back-compat — this PR doesn't break any of that. It just stops documenting those patterns as canonical and explicitly steers AI codegen toward the v4/Bearer/singular path.
Test plan
🤖 Generated with Claude Code