mem0-vercel-ai-sdk

mem0-vercel-ai-sdk is a skill for Claude Code, Codex from mem0ai/mem0. It costs 146 tokens per session (1,995 once invoked), scanned A, original, Apache-2.0.

A connection between the Vercel AI SDK and Mem0, a service that stores and retrieves information from previous AI conversations. It can wrap a language model so relevant memories are retrieved and new ones are stored during calls.

In plain words
What is it for?
Use it in Vercel AI SDK applications that call models with functions such as generateText or streamText and need user-specific memories.
Why use it?
It removes the need to build conversation-memory retrieval and storage around each language-model request yourself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it in Vercel AI SDK applications that call models with functions such as generateText or streamText and need user-specific memories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mem0ai/mem0/mem0-vercel-ai-sdk
About the project

mem0 is memory infrastructure that lets AI agents and applications store and retrieve information across interactions. It supports agents and developers who need persistent context for AI systems.

mem0ai/mem0 · 65,043 stars · on GitHub · mem0.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mem0ai/mem0 --skill mem0-vercel-ai-sdk
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mem0-vercel-ai-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/mem0ai/mem0/mem0-vercel-ai-sdk/github.svg)](https://agentmods.dev/skills/mem0ai/mem0/mem0-vercel-ai-sdk)
Your own site
<a href="https://agentmods.dev/skills/mem0ai/mem0/mem0-vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/mem0ai/mem0/mem0-vercel-ai-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mem0-vercel-ai-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/mem0ai/mem0/mem0-vercel-ai-sdk"><img src="https://agentmods.dev/badge/skills/mem0ai/mem0/mem0-vercel-ai-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,995 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 27 Apr 2026
  • Snyk fail 27 Apr 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00146 $0.01995
Opus 5 $0.00073 $0.00997
Sonnet 5 $0.00029 $0.00399
Haiku 4.5 $0.00015 $0.00199

Measured 10d ago against content hash 0745976ea6d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mem0-vercel-ai-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mem0-vercel-ai-sdk/SKILL.md · 193 lines

How it starts

The opening of the file, as written. The whole thing — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mem0 Vercel AI SDK Provider

Memory-enhanced AI provider for Vercel AI SDK. Automatically retrieves and stores memories during LLM calls.

Step 1: Install

npm install @mem0/vercel-ai-provider ai

Step 2: Set up environment variables

export MEM0_API_KEY="m0-xxx"
export OPENAI_API_KEY="sk-xxx"   # or ANTHROPIC_API_KEY, GOOGLE_API_KEY, etc.

Get a Mem0 API key at: https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=skill-mem0-vercel-ai-sdk

Pattern 1: Wrapped Model

The wrapped model approach is the simplest. createMem0 returns a provider that wraps any supported LLM with automatic memory retrieval and storage.

import { generateText } from "ai";
import { createMem0 } from "@mem0/vercel-ai-provider";

const mem0 = createMem0();
const { text } = await generateText({
  model: mem0("gpt-5-mini", { user_id: "alice" }),
  prompt: "Recommend a restaurant",
});

What happens under the hood:

  1. The prompt is sent to Mem0 search (POST /v3/memories/search/) to retrieve relevant memories
  2. Retrieved memories are injected as a system message at the start of the prompt
  3. The underlying LLM (e.g., OpenAI gpt-5-mini) generates a response using the enriched prompt
  4. The conversation is stored back to Mem0 (POST /v3/memories/add/) as a fire-and-forget async call (no await)

Pattern 2: Standalone Utilities

Use standalone utilities when you want full control over the memory retrieve/store cycle, or you want to use a provider that is already configured separately.

import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { retrieveMemories, addMemories } from "@mem0/vercel-ai-provider";

const prompt = "Recommend a restaurant";

// Retrieve memories -- returns a formatted system prompt string
const memories = await retrieveMemories(prompt, {
  user_id: "alice",
  mem0ApiKey: "m0-xxx",
});

// Generate using any provider with injected memories
const { text } = await generateText({
  model: openai("gpt-5-mini"),
  prompt,
  system: memories,
});

// Optionally store the conversation back
await addMemories(
  [
    { role: "user", content: [{ type: "text", text: prompt }] },
    { role: "assistant", content: [{ type: "text", text }] },
  ],
  { user_id: "alice", mem0ApiKey: "m0-xxx" }
);

Read the full file on GitHub · 193 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 193 lines · 146 tokens per session scan A 0745976ea6d0

Subscribe to this mod's changes

mem0-vercel-ai-sdk is a skill published in the GitHub repository mem0ai/mem0 (65,043 stars, last pushed today), licensed Apache-2.0. It adds 146 tokens to every session and 1,995 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

pinecone-research

Agent RAG and long-term memory with Pinecone.

NousResearch/hermes-agent · 16 tokens

browserwing-executor

Control browser automation through HTTP API. Supports page navigation, element interaction (click, type, select), data extraction, accessibility snapshot analysis, screenshot, JavaScript execution, and batch operations.

MemTensor/MemOS · 42 tokens

dev-browser

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website"…

MemTensor/MemOS · 84 tokens

ask-user-question

Ask users questions via the UI. Use when you need clarification, user preferences, or confirmation before proceeding. The user CANNOT see CLI output - this tool is the ONLY way to communicate with them.

MemTensor/MemOS · 44 tokens

memos-memory-guide

Use the MemOS Local memory system to search and use the user's past conversations. Use this skill whenever the user refers to past chats, their own preferences or history, or when you need to answer from prior context. When auto-recall returns nothing (long or unclear user query), generate your own short search query…

MemTensor/MemOS · 131 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens