README.md
README.mdBrowse 6 files
875 tokens
3,228 bytes
Token encoding: o200k_base
Snapshot 0df3e4b
← Back to SKILL.md
Mem0 Vercel AI SDK Skill for Claude
Add persistent memory to any Vercel AI SDK application using @mem0/vercel-ai-provider.
What This Skill Does
When installed, Claude can:
- Set up
@mem0/vercel-ai-providerin your TypeScript or Next.js project - Generate working code using the wrapped model (
createMem0) or standalone utilities (retrieveMemories,addMemories, etc.) - Configure multi-provider setups (OpenAI, Anthropic, Google, Groq, Cohere)
- Integrate memory into streaming responses, structured output, and API routes
Installation
CLI (Claude Code, OpenCode, OpenClaw, or any tool that supports skills)
npx skills add https://github.com/mem0ai/mem0 --skill mem0-vercel-ai-sdk
Claude.ai
- Download this
skills/mem0-vercel-ai-sdkfolder as a ZIP - Go to Settings > Capabilities > Skills
- Click Upload skill and select the ZIP
Claude API (Skills API)
curl -X POST https://api.anthropic.com/v1/skills \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "mem0-vercel-ai-sdk", "source": "https://github.com/mem0ai/mem0/tree/main/skills/mem0-vercel-ai-sdk"}'
Prerequisites
-
Node.js 18+
-
Vercel AI SDK v5 (
aipackage version 5.x) -
A Mem0 Platform API key (Get one here)
-
An LLM provider API key (OpenAI, Anthropic, Google, Groq, or Cohere)
-
Set environment variables:
export MEM0_API_KEY="m0-xxx" export OPENAI_API_KEY="sk-xxx" # or your chosen provider's key
Quick Start
After installing, just ask Claude:
- "Add memory to my Vercel AI SDK app"
- "Set up mem0 with streamText in my Next.js API route"
- "Use retrieveMemories with Anthropic instead of the wrapped model"
- "Show me how to use graph memories with the Vercel AI provider"
- "Help me store conversation history with addMemories"
What's Inside
skills/mem0-vercel-ai-sdk/
├── SKILL.md # Skill definition and instructions
├── README.md # This file
├── LICENSE # Apache-2.0
└── references/ # Documentation (loaded on demand)
├── provider-api.md # createMem0, Mem0Provider, types, config
├── memory-utilities.md # addMemories, retrieveMemories, getMemories, searchMemories
└── usage-patterns.md # Working examples: streaming, Next.js, multi-provider, graph
Links
- Mem0 Platform Dashboard
- Mem0 Documentation
- Mem0 GitHub
- @mem0/vercel-ai-provider on npm
- Vercel AI SDK Documentation
Skill Graph
This skill is part of the Mem0 skill graph. The three Mem0 skills (mem0, mem0-cli, mem0-vercel-ai-sdk) each cover a different interface to the same Mem0 Platform API.
License
Apache-2.0