[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-mem0-mem0-vercel-ai-sdk":3,"mdc-b1a7jz-key":47,"related-repo-mem0-mem0-vercel-ai-sdk":2776,"related-org-mem0-mem0-vercel-ai-sdk":2864},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":42,"sourceUrl":45,"mdContent":46},"mem0-vercel-ai-sdk","integrate Mem0 with Vercel AI SDK","Mem0 provider for Vercel AI SDK (@mem0\u002Fvercel-ai-provider). TRIGGER when: user mentions \"vercel ai sdk\", \"@mem0\u002Fvercel-ai-provider\", \"createMem0\", \"retrieveMemories\", \"addMemories\", \"getMemories\", \"searchMemories\", \"mem0 vercel\", \"AI SDK provider\", \"AI SDK memory\", or is using generateText\u002FstreamText with mem0. Also triggers for Next.js apps needing memory-augmented AI. DO NOT TRIGGER when: user asks about direct Python\u002FTS SDK calls without Vercel (use mem0 skill), or CLI terminal commands (use mem0-cli skill).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"mem0","Mem0","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmem0.png","mem0ai",[13,17,20],{"name":14,"slug":15,"type":16},"Vercel","vercel","tag",{"name":18,"slug":19,"type":16},"Memory","memory",{"name":21,"slug":22,"type":16},"AI SDK","ai-sdk",60691,"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0","2026-07-13T06:12:45.120354","Apache-2.0",7066,[29,30,31,32,33,34,35,36,37,19,38,39,40,41],"agents","ai","ai-agents","application","chatbots","chatgpt","genai","llm","long-term-memory","memory-management","python","rag","state-management",{"repoUrl":24,"stars":23,"forks":27,"topics":43,"description":44},[29,30,31,32,33,34,35,36,37,19,38,39,40,41],"Universal memory layer for AI Agents","https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002FHEAD\u002Fskills\u002Fmem0-vercel-ai-sdk","---\nname: mem0-vercel-ai-sdk\ndescription: >\n  Mem0 provider for Vercel AI SDK (@mem0\u002Fvercel-ai-provider).\n  TRIGGER when: user mentions \"vercel ai sdk\", \"@mem0\u002Fvercel-ai-provider\",\n  \"createMem0\", \"retrieveMemories\", \"addMemories\", \"getMemories\",\n  \"searchMemories\", \"mem0 vercel\", \"AI SDK provider\", \"AI SDK memory\",\n  or is using generateText\u002FstreamText with mem0. Also triggers for Next.js\n  apps needing memory-augmented AI.\n  DO NOT TRIGGER when: user asks about direct Python\u002FTS SDK calls without Vercel\n  (use mem0 skill), or CLI terminal commands (use mem0-cli skill).\nlicense: Apache-2.0\nmetadata:\n  author: mem0ai\n  version: \"1.1.0\"\n  category: ai-memory\n  tags: \"vercel, ai-sdk, memory, nextjs, typescript, provider\"\ncompatibility: Node.js 18+, npm install @mem0\u002Fvercel-ai-provider, Vercel AI SDK v5 (ai package), MEM0_API_KEY + LLM provider API key\n---\n\n# Mem0 Vercel AI SDK Provider\n\nMemory-enhanced AI provider for Vercel AI SDK. Automatically retrieves and stores memories during LLM calls.\n\n## Step 1: Install\n\n```bash\nnpm install @mem0\u002Fvercel-ai-provider ai\n```\n\n## Step 2: Set up environment variables\n\n```bash\nexport MEM0_API_KEY=\"m0-xxx\"\nexport OPENAI_API_KEY=\"sk-xxx\"   # or ANTHROPIC_API_KEY, GOOGLE_API_KEY, etc.\n```\n\nGet a Mem0 API key at: https:\u002F\u002Fapp.mem0.ai\u002Fdashboard\u002Fapi-keys?utm_source=oss&utm_medium=skill-mem0-vercel-ai-sdk\n\n## Pattern 1: Wrapped Model\n\nThe wrapped model approach is the simplest. `createMem0` returns a provider that wraps any supported LLM with automatic memory retrieval and storage.\n\n```typescript\nimport { generateText } from \"ai\";\nimport { createMem0 } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst mem0 = createMem0();\nconst { text } = await generateText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"Recommend a restaurant\",\n});\n```\n\nWhat happens under the hood:\n1. The prompt is sent to Mem0 search (`POST \u002Fv3\u002Fmemories\u002Fsearch\u002F`) to retrieve relevant memories\n2. Retrieved memories are injected as a system message at the start of the prompt\n3. The underlying LLM (e.g., OpenAI gpt-5-mini) generates a response using the enriched prompt\n4. The conversation is stored back to Mem0 (`POST \u002Fv3\u002Fmemories\u002Fadd\u002F`) as a fire-and-forget async call (no await)\n\n## Pattern 2: Standalone Utilities\n\nUse standalone utilities when you want full control over the memory retrieve\u002Fstore cycle, or you want to use a provider that is already configured separately.\n\n```typescript\nimport { openai } from \"@ai-sdk\u002Fopenai\";\nimport { generateText } from \"ai\";\nimport { retrieveMemories, addMemories } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst prompt = \"Recommend a restaurant\";\n\n\u002F\u002F Retrieve memories -- returns a formatted system prompt string\nconst memories = await retrieveMemories(prompt, {\n  user_id: \"alice\",\n  mem0ApiKey: \"m0-xxx\",\n});\n\n\u002F\u002F Generate using any provider with injected memories\nconst { text } = await generateText({\n  model: openai(\"gpt-5-mini\"),\n  prompt,\n  system: memories,\n});\n\n\u002F\u002F Optionally store the conversation back\nawait addMemories(\n  [\n    { role: \"user\", content: [{ type: \"text\", text: prompt }] },\n    { role: \"assistant\", content: [{ type: \"text\", text }] },\n  ],\n  { user_id: \"alice\", mem0ApiKey: \"m0-xxx\" }\n);\n```\n\n## Pattern 3: Streaming\n\nUse `streamText` for streaming responses with memory augmentation:\n\n```typescript\nimport { streamText } from \"ai\";\nimport { createMem0 } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst mem0 = createMem0();\nconst result = streamText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"What should I cook for dinner?\",\n});\n\nfor await (const chunk of result.textStream) {\n  process.stdout.write(chunk);\n}\n```\n\nThe wrapped model handles memory retrieval before streaming begins and stores the conversation after.\n\n## Supported Providers\n\n| Provider | Config value | Required env var |\n|----------|-------------|------------------|\n| OpenAI (default) | `\"openai\"` | `OPENAI_API_KEY` |\n| Anthropic | `\"anthropic\"` | `ANTHROPIC_API_KEY` |\n| Google | `\"google\"` | `GOOGLE_GENERATIVE_AI_API_KEY` |\n| Groq | `\"groq\"` | `GROQ_API_KEY` |\n| Cohere | `\"cohere\"` | `COHERE_API_KEY` |\n\nSelect a provider when creating the Mem0 instance:\n\n```typescript\nconst mem0 = createMem0({ provider: \"anthropic\" });\nconst { text } = await generateText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"Hello!\",\n});\n```\n\n## How It Works Internally\n\n### Wrapped model flow\n\n```\nUser prompt\n  --> searchInternalMemories (POST \u002Fv3\u002Fmemories\u002Fsearch\u002F)\n  --> memories injected as system message at start of prompt\n  --> underlying LLM generates response (doGenerate or doStream)\n  --> processMemories fires addMemories as fire-and-forget (no await)\n  --> response returned to caller\n```\n\n### Standalone flow\n\n```\nUser controls each step:\n  1. retrieveMemories \u002F getMemories \u002F searchMemories -> fetch memories\n  2. inject into system prompt manually\n  3. call generateText \u002F streamText with any provider\n  4. addMemories -> store new conversation to Mem0\n```\n\n## Key Differences Between the 4 Utility Functions\n\n| Function | Returns | Use when |\n|----------|---------|----------|\n| `retrieveMemories` | Formatted system prompt **string** | Injecting directly into `system` parameter |\n| `getMemories` | Raw memory **array** | Processing memories programmatically |\n| `searchMemories` | Full search **response** (results + relations) | Need relations, scores, metadata |\n| `addMemories` | API response | Storing new messages to Mem0 |\n\nAll four accept `LanguageModelV2Prompt | string` as the first argument and optional `Mem0ConfigSettings` as the second.\n\n## Common Edge Cases and Tips\n\n- **Always provide `user_id`** (or `agent_id`\u002F`app_id`\u002F`run_id`) for consistent memory retrieval. Without an entity identifier, memories cannot be scoped.\n- **Standalone utilities require explicit API key**: pass `mem0ApiKey` in the config object, or set the `MEM0_API_KEY` environment variable.\n- **This uses Vercel AI SDK v5** (LanguageModelV2 \u002F ProviderV2 interfaces). It is not compatible with AI SDK v3 or v4.\n- **`processMemories` fires `addMemories` as fire-and-forget** (`.then()` without `await`). Memory storage happens asynchronously and does not block the LLM response.\n- **The `\"gemini\"` alias** exists in the provider switch but is NOT in the `supportedProviders` list. Use `\"google\"` instead.\n- **Custom host**: set `host` in the config to point to a different Mem0 API endpoint (default: `https:\u002F\u002Fapi.mem0.ai`).\n\n## References\n\n| Topic | File |\n|-------|------|\n| Provider API (`createMem0`, `Mem0Provider`, types) | [local](references\u002Fprovider-api.md) \u002F [GitHub](https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fprovider-api.md) |\n| Memory utilities (`addMemories`, `retrieveMemories`, etc.) | [local](references\u002Fmemory-utilities.md) \u002F [GitHub](https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fmemory-utilities.md) |\n| Usage patterns and examples | [local](references\u002Fusage-patterns.md) \u002F [GitHub](https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fusage-patterns.md) |\n\n## Related Mem0 Skills\n\n| Skill | When to use | Link |\n|-------|-------------|------|\n| mem0 | Python\u002FTypeScript SDK, REST API, framework integrations | [local](..\u002Fmem0\u002FSKILL.md) \u002F [GitHub](https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0) |\n| mem0-cli | Terminal commands, scripting, CI\u002FCD, agent tool loops | [local](..\u002Fmem0-cli\u002FSKILL.md) \u002F [GitHub](https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-cli) |\n",{"data":48,"body":54},{"name":4,"description":6,"license":26,"metadata":49,"compatibility":53},{"author":11,"version":50,"category":51,"tags":52},"1.1.0","ai-memory","vercel, ai-sdk, memory, nextjs, typescript, provider","Node.js 18+, npm install @mem0\u002Fvercel-ai-provider, Vercel AI SDK v5 (ai package), MEM0_API_KEY + LLM provider API key",{"type":55,"children":56},"root",[57,66,72,79,119,125,204,217,223,236,549,554,595,601,606,1378,1384,1397,1767,1772,1778,1941,1946,2167,2173,2180,2190,2196,2205,2211,2352,2373,2379,2554,2560,2682,2688,2770],{"type":58,"tag":59,"props":60,"children":62},"element","h1",{"id":61},"mem0-vercel-ai-sdk-provider",[63],{"type":64,"value":65},"text","Mem0 Vercel AI SDK Provider",{"type":58,"tag":67,"props":68,"children":69},"p",{},[70],{"type":64,"value":71},"Memory-enhanced AI provider for Vercel AI SDK. Automatically retrieves and stores memories during LLM calls.",{"type":58,"tag":73,"props":74,"children":76},"h2",{"id":75},"step-1-install",[77],{"type":64,"value":78},"Step 1: Install",{"type":58,"tag":80,"props":81,"children":86},"pre",{"className":82,"code":83,"language":84,"meta":85,"style":85},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @mem0\u002Fvercel-ai-provider ai\n","bash","",[87],{"type":58,"tag":88,"props":89,"children":90},"code",{"__ignoreMap":85},[91],{"type":58,"tag":92,"props":93,"children":96},"span",{"class":94,"line":95},"line",1,[97,103,109,114],{"type":58,"tag":92,"props":98,"children":100},{"style":99},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[101],{"type":64,"value":102},"npm",{"type":58,"tag":92,"props":104,"children":106},{"style":105},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[107],{"type":64,"value":108}," install",{"type":58,"tag":92,"props":110,"children":111},{"style":105},[112],{"type":64,"value":113}," @mem0\u002Fvercel-ai-provider",{"type":58,"tag":92,"props":115,"children":116},{"style":105},[117],{"type":64,"value":118}," ai\n",{"type":58,"tag":73,"props":120,"children":122},{"id":121},"step-2-set-up-environment-variables",[123],{"type":64,"value":124},"Step 2: Set up environment variables",{"type":58,"tag":80,"props":126,"children":128},{"className":82,"code":127,"language":84,"meta":85,"style":85},"export MEM0_API_KEY=\"m0-xxx\"\nexport OPENAI_API_KEY=\"sk-xxx\"   # or ANTHROPIC_API_KEY, GOOGLE_API_KEY, etc.\n",[129],{"type":58,"tag":88,"props":130,"children":131},{"__ignoreMap":85},[132,168],{"type":58,"tag":92,"props":133,"children":134},{"class":94,"line":95},[135,141,147,153,158,163],{"type":58,"tag":92,"props":136,"children":138},{"style":137},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[139],{"type":64,"value":140},"export",{"type":58,"tag":92,"props":142,"children":144},{"style":143},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[145],{"type":64,"value":146}," MEM0_API_KEY",{"type":58,"tag":92,"props":148,"children":150},{"style":149},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[151],{"type":64,"value":152},"=",{"type":58,"tag":92,"props":154,"children":155},{"style":149},[156],{"type":64,"value":157},"\"",{"type":58,"tag":92,"props":159,"children":160},{"style":105},[161],{"type":64,"value":162},"m0-xxx",{"type":58,"tag":92,"props":164,"children":165},{"style":149},[166],{"type":64,"value":167},"\"\n",{"type":58,"tag":92,"props":169,"children":171},{"class":94,"line":170},2,[172,176,181,185,189,194,198],{"type":58,"tag":92,"props":173,"children":174},{"style":137},[175],{"type":64,"value":140},{"type":58,"tag":92,"props":177,"children":178},{"style":143},[179],{"type":64,"value":180}," OPENAI_API_KEY",{"type":58,"tag":92,"props":182,"children":183},{"style":149},[184],{"type":64,"value":152},{"type":58,"tag":92,"props":186,"children":187},{"style":149},[188],{"type":64,"value":157},{"type":58,"tag":92,"props":190,"children":191},{"style":105},[192],{"type":64,"value":193},"sk-xxx",{"type":58,"tag":92,"props":195,"children":196},{"style":149},[197],{"type":64,"value":157},{"type":58,"tag":92,"props":199,"children":201},{"style":200},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[202],{"type":64,"value":203},"   # or ANTHROPIC_API_KEY, GOOGLE_API_KEY, etc.\n",{"type":58,"tag":67,"props":205,"children":206},{},[207,209],{"type":64,"value":208},"Get a Mem0 API key at: ",{"type":58,"tag":210,"props":211,"children":215},"a",{"href":212,"rel":213},"https:\u002F\u002Fapp.mem0.ai\u002Fdashboard\u002Fapi-keys?utm_source=oss&utm_medium=skill-mem0-vercel-ai-sdk",[214],"nofollow",[216],{"type":64,"value":212},{"type":58,"tag":73,"props":218,"children":220},{"id":219},"pattern-1-wrapped-model",[221],{"type":64,"value":222},"Pattern 1: Wrapped Model",{"type":58,"tag":67,"props":224,"children":225},{},[226,228,234],{"type":64,"value":227},"The wrapped model approach is the simplest. ",{"type":58,"tag":88,"props":229,"children":231},{"className":230},[],[232],{"type":64,"value":233},"createMem0",{"type":64,"value":235}," returns a provider that wraps any supported LLM with automatic memory retrieval and storage.",{"type":58,"tag":80,"props":237,"children":241},{"className":238,"code":239,"language":240,"meta":85,"style":85},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { generateText } from \"ai\";\nimport { createMem0 } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst mem0 = createMem0();\nconst { text } = await generateText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"Recommend a restaurant\",\n});\n","typescript",[242],{"type":58,"tag":88,"props":243,"children":244},{"__ignoreMap":85},[245,292,333,343,375,421,503,533],{"type":58,"tag":92,"props":246,"children":247},{"class":94,"line":95},[248,254,259,264,269,274,279,283,287],{"type":58,"tag":92,"props":249,"children":251},{"style":250},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[252],{"type":64,"value":253},"import",{"type":58,"tag":92,"props":255,"children":256},{"style":149},[257],{"type":64,"value":258}," {",{"type":58,"tag":92,"props":260,"children":261},{"style":143},[262],{"type":64,"value":263}," generateText",{"type":58,"tag":92,"props":265,"children":266},{"style":149},[267],{"type":64,"value":268}," }",{"type":58,"tag":92,"props":270,"children":271},{"style":250},[272],{"type":64,"value":273}," from",{"type":58,"tag":92,"props":275,"children":276},{"style":149},[277],{"type":64,"value":278}," \"",{"type":58,"tag":92,"props":280,"children":281},{"style":105},[282],{"type":64,"value":30},{"type":58,"tag":92,"props":284,"children":285},{"style":149},[286],{"type":64,"value":157},{"type":58,"tag":92,"props":288,"children":289},{"style":149},[290],{"type":64,"value":291},";\n",{"type":58,"tag":92,"props":293,"children":294},{"class":94,"line":170},[295,299,303,308,312,316,320,325,329],{"type":58,"tag":92,"props":296,"children":297},{"style":250},[298],{"type":64,"value":253},{"type":58,"tag":92,"props":300,"children":301},{"style":149},[302],{"type":64,"value":258},{"type":58,"tag":92,"props":304,"children":305},{"style":143},[306],{"type":64,"value":307}," createMem0",{"type":58,"tag":92,"props":309,"children":310},{"style":149},[311],{"type":64,"value":268},{"type":58,"tag":92,"props":313,"children":314},{"style":250},[315],{"type":64,"value":273},{"type":58,"tag":92,"props":317,"children":318},{"style":149},[319],{"type":64,"value":278},{"type":58,"tag":92,"props":321,"children":322},{"style":105},[323],{"type":64,"value":324},"@mem0\u002Fvercel-ai-provider",{"type":58,"tag":92,"props":326,"children":327},{"style":149},[328],{"type":64,"value":157},{"type":58,"tag":92,"props":330,"children":331},{"style":149},[332],{"type":64,"value":291},{"type":58,"tag":92,"props":334,"children":336},{"class":94,"line":335},3,[337],{"type":58,"tag":92,"props":338,"children":340},{"emptyLinePlaceholder":339},true,[341],{"type":64,"value":342},"\n",{"type":58,"tag":92,"props":344,"children":346},{"class":94,"line":345},4,[347,352,357,361,366,371],{"type":58,"tag":92,"props":348,"children":349},{"style":137},[350],{"type":64,"value":351},"const",{"type":58,"tag":92,"props":353,"children":354},{"style":143},[355],{"type":64,"value":356}," mem0 ",{"type":58,"tag":92,"props":358,"children":359},{"style":149},[360],{"type":64,"value":152},{"type":58,"tag":92,"props":362,"children":364},{"style":363},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[365],{"type":64,"value":307},{"type":58,"tag":92,"props":367,"children":368},{"style":143},[369],{"type":64,"value":370},"()",{"type":58,"tag":92,"props":372,"children":373},{"style":149},[374],{"type":64,"value":291},{"type":58,"tag":92,"props":376,"children":378},{"class":94,"line":377},5,[379,383,387,392,397,402,407,411,416],{"type":58,"tag":92,"props":380,"children":381},{"style":137},[382],{"type":64,"value":351},{"type":58,"tag":92,"props":384,"children":385},{"style":149},[386],{"type":64,"value":258},{"type":58,"tag":92,"props":388,"children":389},{"style":143},[390],{"type":64,"value":391}," text ",{"type":58,"tag":92,"props":393,"children":394},{"style":149},[395],{"type":64,"value":396},"}",{"type":58,"tag":92,"props":398,"children":399},{"style":149},[400],{"type":64,"value":401}," =",{"type":58,"tag":92,"props":403,"children":404},{"style":250},[405],{"type":64,"value":406}," await",{"type":58,"tag":92,"props":408,"children":409},{"style":363},[410],{"type":64,"value":263},{"type":58,"tag":92,"props":412,"children":413},{"style":143},[414],{"type":64,"value":415},"(",{"type":58,"tag":92,"props":417,"children":418},{"style":149},[419],{"type":64,"value":420},"{\n",{"type":58,"tag":92,"props":422,"children":424},{"class":94,"line":423},6,[425,431,436,441,445,449,454,458,463,467,472,476,480,485,489,493,498],{"type":58,"tag":92,"props":426,"children":428},{"style":427},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[429],{"type":64,"value":430},"  model",{"type":58,"tag":92,"props":432,"children":433},{"style":149},[434],{"type":64,"value":435},":",{"type":58,"tag":92,"props":437,"children":438},{"style":363},[439],{"type":64,"value":440}," mem0",{"type":58,"tag":92,"props":442,"children":443},{"style":143},[444],{"type":64,"value":415},{"type":58,"tag":92,"props":446,"children":447},{"style":149},[448],{"type":64,"value":157},{"type":58,"tag":92,"props":450,"children":451},{"style":105},[452],{"type":64,"value":453},"gpt-5-mini",{"type":58,"tag":92,"props":455,"children":456},{"style":149},[457],{"type":64,"value":157},{"type":58,"tag":92,"props":459,"children":460},{"style":149},[461],{"type":64,"value":462},",",{"type":58,"tag":92,"props":464,"children":465},{"style":149},[466],{"type":64,"value":258},{"type":58,"tag":92,"props":468,"children":469},{"style":427},[470],{"type":64,"value":471}," user_id",{"type":58,"tag":92,"props":473,"children":474},{"style":149},[475],{"type":64,"value":435},{"type":58,"tag":92,"props":477,"children":478},{"style":149},[479],{"type":64,"value":278},{"type":58,"tag":92,"props":481,"children":482},{"style":105},[483],{"type":64,"value":484},"alice",{"type":58,"tag":92,"props":486,"children":487},{"style":149},[488],{"type":64,"value":157},{"type":58,"tag":92,"props":490,"children":491},{"style":149},[492],{"type":64,"value":268},{"type":58,"tag":92,"props":494,"children":495},{"style":143},[496],{"type":64,"value":497},")",{"type":58,"tag":92,"props":499,"children":500},{"style":149},[501],{"type":64,"value":502},",\n",{"type":58,"tag":92,"props":504,"children":506},{"class":94,"line":505},7,[507,512,516,520,525,529],{"type":58,"tag":92,"props":508,"children":509},{"style":427},[510],{"type":64,"value":511},"  prompt",{"type":58,"tag":92,"props":513,"children":514},{"style":149},[515],{"type":64,"value":435},{"type":58,"tag":92,"props":517,"children":518},{"style":149},[519],{"type":64,"value":278},{"type":58,"tag":92,"props":521,"children":522},{"style":105},[523],{"type":64,"value":524},"Recommend a restaurant",{"type":58,"tag":92,"props":526,"children":527},{"style":149},[528],{"type":64,"value":157},{"type":58,"tag":92,"props":530,"children":531},{"style":149},[532],{"type":64,"value":502},{"type":58,"tag":92,"props":534,"children":536},{"class":94,"line":535},8,[537,541,545],{"type":58,"tag":92,"props":538,"children":539},{"style":149},[540],{"type":64,"value":396},{"type":58,"tag":92,"props":542,"children":543},{"style":143},[544],{"type":64,"value":497},{"type":58,"tag":92,"props":546,"children":547},{"style":149},[548],{"type":64,"value":291},{"type":58,"tag":67,"props":550,"children":551},{},[552],{"type":64,"value":553},"What happens under the hood:",{"type":58,"tag":555,"props":556,"children":557},"ol",{},[558,572,577,582],{"type":58,"tag":559,"props":560,"children":561},"li",{},[562,564,570],{"type":64,"value":563},"The prompt is sent to Mem0 search (",{"type":58,"tag":88,"props":565,"children":567},{"className":566},[],[568],{"type":64,"value":569},"POST \u002Fv3\u002Fmemories\u002Fsearch\u002F",{"type":64,"value":571},") to retrieve relevant memories",{"type":58,"tag":559,"props":573,"children":574},{},[575],{"type":64,"value":576},"Retrieved memories are injected as a system message at the start of the prompt",{"type":58,"tag":559,"props":578,"children":579},{},[580],{"type":64,"value":581},"The underlying LLM (e.g., OpenAI gpt-5-mini) generates a response using the enriched prompt",{"type":58,"tag":559,"props":583,"children":584},{},[585,587,593],{"type":64,"value":586},"The conversation is stored back to Mem0 (",{"type":58,"tag":88,"props":588,"children":590},{"className":589},[],[591],{"type":64,"value":592},"POST \u002Fv3\u002Fmemories\u002Fadd\u002F",{"type":64,"value":594},") as a fire-and-forget async call (no await)",{"type":58,"tag":73,"props":596,"children":598},{"id":597},"pattern-2-standalone-utilities",[599],{"type":64,"value":600},"Pattern 2: Standalone Utilities",{"type":58,"tag":67,"props":602,"children":603},{},[604],{"type":64,"value":605},"Use standalone utilities when you want full control over the memory retrieve\u002Fstore cycle, or you want to use a provider that is already configured separately.",{"type":58,"tag":80,"props":607,"children":609},{"className":238,"code":608,"language":240,"meta":85,"style":85},"import { openai } from \"@ai-sdk\u002Fopenai\";\nimport { generateText } from \"ai\";\nimport { retrieveMemories, addMemories } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst prompt = \"Recommend a restaurant\";\n\n\u002F\u002F Retrieve memories -- returns a formatted system prompt string\nconst memories = await retrieveMemories(prompt, {\n  user_id: \"alice\",\n  mem0ApiKey: \"m0-xxx\",\n});\n\n\u002F\u002F Generate using any provider with injected memories\nconst { text } = await generateText({\n  model: openai(\"gpt-5-mini\"),\n  prompt,\n  system: memories,\n});\n\n\u002F\u002F Optionally store the conversation back\nawait addMemories(\n  [\n    { role: \"user\", content: [{ type: \"text\", text: prompt }] },\n    { role: \"assistant\", content: [{ type: \"text\", text }] },\n  ],\n  { user_id: \"alice\", mem0ApiKey: \"m0-xxx\" }\n);\n",[610],{"type":58,"tag":88,"props":611,"children":612},{"__ignoreMap":85},[613,654,693,742,749,781,788,796,834,863,892,908,916,925,965,1005,1017,1039,1055,1063,1072,1090,1099,1205,1294,1307,1366],{"type":58,"tag":92,"props":614,"children":615},{"class":94,"line":95},[616,620,624,629,633,637,641,646,650],{"type":58,"tag":92,"props":617,"children":618},{"style":250},[619],{"type":64,"value":253},{"type":58,"tag":92,"props":621,"children":622},{"style":149},[623],{"type":64,"value":258},{"type":58,"tag":92,"props":625,"children":626},{"style":143},[627],{"type":64,"value":628}," openai",{"type":58,"tag":92,"props":630,"children":631},{"style":149},[632],{"type":64,"value":268},{"type":58,"tag":92,"props":634,"children":635},{"style":250},[636],{"type":64,"value":273},{"type":58,"tag":92,"props":638,"children":639},{"style":149},[640],{"type":64,"value":278},{"type":58,"tag":92,"props":642,"children":643},{"style":105},[644],{"type":64,"value":645},"@ai-sdk\u002Fopenai",{"type":58,"tag":92,"props":647,"children":648},{"style":149},[649],{"type":64,"value":157},{"type":58,"tag":92,"props":651,"children":652},{"style":149},[653],{"type":64,"value":291},{"type":58,"tag":92,"props":655,"children":656},{"class":94,"line":170},[657,661,665,669,673,677,681,685,689],{"type":58,"tag":92,"props":658,"children":659},{"style":250},[660],{"type":64,"value":253},{"type":58,"tag":92,"props":662,"children":663},{"style":149},[664],{"type":64,"value":258},{"type":58,"tag":92,"props":666,"children":667},{"style":143},[668],{"type":64,"value":263},{"type":58,"tag":92,"props":670,"children":671},{"style":149},[672],{"type":64,"value":268},{"type":58,"tag":92,"props":674,"children":675},{"style":250},[676],{"type":64,"value":273},{"type":58,"tag":92,"props":678,"children":679},{"style":149},[680],{"type":64,"value":278},{"type":58,"tag":92,"props":682,"children":683},{"style":105},[684],{"type":64,"value":30},{"type":58,"tag":92,"props":686,"children":687},{"style":149},[688],{"type":64,"value":157},{"type":58,"tag":92,"props":690,"children":691},{"style":149},[692],{"type":64,"value":291},{"type":58,"tag":92,"props":694,"children":695},{"class":94,"line":335},[696,700,704,709,713,718,722,726,730,734,738],{"type":58,"tag":92,"props":697,"children":698},{"style":250},[699],{"type":64,"value":253},{"type":58,"tag":92,"props":701,"children":702},{"style":149},[703],{"type":64,"value":258},{"type":58,"tag":92,"props":705,"children":706},{"style":143},[707],{"type":64,"value":708}," retrieveMemories",{"type":58,"tag":92,"props":710,"children":711},{"style":149},[712],{"type":64,"value":462},{"type":58,"tag":92,"props":714,"children":715},{"style":143},[716],{"type":64,"value":717}," addMemories",{"type":58,"tag":92,"props":719,"children":720},{"style":149},[721],{"type":64,"value":268},{"type":58,"tag":92,"props":723,"children":724},{"style":250},[725],{"type":64,"value":273},{"type":58,"tag":92,"props":727,"children":728},{"style":149},[729],{"type":64,"value":278},{"type":58,"tag":92,"props":731,"children":732},{"style":105},[733],{"type":64,"value":324},{"type":58,"tag":92,"props":735,"children":736},{"style":149},[737],{"type":64,"value":157},{"type":58,"tag":92,"props":739,"children":740},{"style":149},[741],{"type":64,"value":291},{"type":58,"tag":92,"props":743,"children":744},{"class":94,"line":345},[745],{"type":58,"tag":92,"props":746,"children":747},{"emptyLinePlaceholder":339},[748],{"type":64,"value":342},{"type":58,"tag":92,"props":750,"children":751},{"class":94,"line":377},[752,756,761,765,769,773,777],{"type":58,"tag":92,"props":753,"children":754},{"style":137},[755],{"type":64,"value":351},{"type":58,"tag":92,"props":757,"children":758},{"style":143},[759],{"type":64,"value":760}," prompt ",{"type":58,"tag":92,"props":762,"children":763},{"style":149},[764],{"type":64,"value":152},{"type":58,"tag":92,"props":766,"children":767},{"style":149},[768],{"type":64,"value":278},{"type":58,"tag":92,"props":770,"children":771},{"style":105},[772],{"type":64,"value":524},{"type":58,"tag":92,"props":774,"children":775},{"style":149},[776],{"type":64,"value":157},{"type":58,"tag":92,"props":778,"children":779},{"style":149},[780],{"type":64,"value":291},{"type":58,"tag":92,"props":782,"children":783},{"class":94,"line":423},[784],{"type":58,"tag":92,"props":785,"children":786},{"emptyLinePlaceholder":339},[787],{"type":64,"value":342},{"type":58,"tag":92,"props":789,"children":790},{"class":94,"line":505},[791],{"type":58,"tag":92,"props":792,"children":793},{"style":200},[794],{"type":64,"value":795},"\u002F\u002F Retrieve memories -- returns a formatted system prompt string\n",{"type":58,"tag":92,"props":797,"children":798},{"class":94,"line":535},[799,803,808,812,816,820,825,829],{"type":58,"tag":92,"props":800,"children":801},{"style":137},[802],{"type":64,"value":351},{"type":58,"tag":92,"props":804,"children":805},{"style":143},[806],{"type":64,"value":807}," memories ",{"type":58,"tag":92,"props":809,"children":810},{"style":149},[811],{"type":64,"value":152},{"type":58,"tag":92,"props":813,"children":814},{"style":250},[815],{"type":64,"value":406},{"type":58,"tag":92,"props":817,"children":818},{"style":363},[819],{"type":64,"value":708},{"type":58,"tag":92,"props":821,"children":822},{"style":143},[823],{"type":64,"value":824},"(prompt",{"type":58,"tag":92,"props":826,"children":827},{"style":149},[828],{"type":64,"value":462},{"type":58,"tag":92,"props":830,"children":831},{"style":149},[832],{"type":64,"value":833}," {\n",{"type":58,"tag":92,"props":835,"children":837},{"class":94,"line":836},9,[838,843,847,851,855,859],{"type":58,"tag":92,"props":839,"children":840},{"style":427},[841],{"type":64,"value":842},"  user_id",{"type":58,"tag":92,"props":844,"children":845},{"style":149},[846],{"type":64,"value":435},{"type":58,"tag":92,"props":848,"children":849},{"style":149},[850],{"type":64,"value":278},{"type":58,"tag":92,"props":852,"children":853},{"style":105},[854],{"type":64,"value":484},{"type":58,"tag":92,"props":856,"children":857},{"style":149},[858],{"type":64,"value":157},{"type":58,"tag":92,"props":860,"children":861},{"style":149},[862],{"type":64,"value":502},{"type":58,"tag":92,"props":864,"children":866},{"class":94,"line":865},10,[867,872,876,880,884,888],{"type":58,"tag":92,"props":868,"children":869},{"style":427},[870],{"type":64,"value":871},"  mem0ApiKey",{"type":58,"tag":92,"props":873,"children":874},{"style":149},[875],{"type":64,"value":435},{"type":58,"tag":92,"props":877,"children":878},{"style":149},[879],{"type":64,"value":278},{"type":58,"tag":92,"props":881,"children":882},{"style":105},[883],{"type":64,"value":162},{"type":58,"tag":92,"props":885,"children":886},{"style":149},[887],{"type":64,"value":157},{"type":58,"tag":92,"props":889,"children":890},{"style":149},[891],{"type":64,"value":502},{"type":58,"tag":92,"props":893,"children":895},{"class":94,"line":894},11,[896,900,904],{"type":58,"tag":92,"props":897,"children":898},{"style":149},[899],{"type":64,"value":396},{"type":58,"tag":92,"props":901,"children":902},{"style":143},[903],{"type":64,"value":497},{"type":58,"tag":92,"props":905,"children":906},{"style":149},[907],{"type":64,"value":291},{"type":58,"tag":92,"props":909,"children":911},{"class":94,"line":910},12,[912],{"type":58,"tag":92,"props":913,"children":914},{"emptyLinePlaceholder":339},[915],{"type":64,"value":342},{"type":58,"tag":92,"props":917,"children":919},{"class":94,"line":918},13,[920],{"type":58,"tag":92,"props":921,"children":922},{"style":200},[923],{"type":64,"value":924},"\u002F\u002F Generate using any provider with injected memories\n",{"type":58,"tag":92,"props":926,"children":928},{"class":94,"line":927},14,[929,933,937,941,945,949,953,957,961],{"type":58,"tag":92,"props":930,"children":931},{"style":137},[932],{"type":64,"value":351},{"type":58,"tag":92,"props":934,"children":935},{"style":149},[936],{"type":64,"value":258},{"type":58,"tag":92,"props":938,"children":939},{"style":143},[940],{"type":64,"value":391},{"type":58,"tag":92,"props":942,"children":943},{"style":149},[944],{"type":64,"value":396},{"type":58,"tag":92,"props":946,"children":947},{"style":149},[948],{"type":64,"value":401},{"type":58,"tag":92,"props":950,"children":951},{"style":250},[952],{"type":64,"value":406},{"type":58,"tag":92,"props":954,"children":955},{"style":363},[956],{"type":64,"value":263},{"type":58,"tag":92,"props":958,"children":959},{"style":143},[960],{"type":64,"value":415},{"type":58,"tag":92,"props":962,"children":963},{"style":149},[964],{"type":64,"value":420},{"type":58,"tag":92,"props":966,"children":968},{"class":94,"line":967},15,[969,973,977,981,985,989,993,997,1001],{"type":58,"tag":92,"props":970,"children":971},{"style":427},[972],{"type":64,"value":430},{"type":58,"tag":92,"props":974,"children":975},{"style":149},[976],{"type":64,"value":435},{"type":58,"tag":92,"props":978,"children":979},{"style":363},[980],{"type":64,"value":628},{"type":58,"tag":92,"props":982,"children":983},{"style":143},[984],{"type":64,"value":415},{"type":58,"tag":92,"props":986,"children":987},{"style":149},[988],{"type":64,"value":157},{"type":58,"tag":92,"props":990,"children":991},{"style":105},[992],{"type":64,"value":453},{"type":58,"tag":92,"props":994,"children":995},{"style":149},[996],{"type":64,"value":157},{"type":58,"tag":92,"props":998,"children":999},{"style":143},[1000],{"type":64,"value":497},{"type":58,"tag":92,"props":1002,"children":1003},{"style":149},[1004],{"type":64,"value":502},{"type":58,"tag":92,"props":1006,"children":1008},{"class":94,"line":1007},16,[1009,1013],{"type":58,"tag":92,"props":1010,"children":1011},{"style":143},[1012],{"type":64,"value":511},{"type":58,"tag":92,"props":1014,"children":1015},{"style":149},[1016],{"type":64,"value":502},{"type":58,"tag":92,"props":1018,"children":1020},{"class":94,"line":1019},17,[1021,1026,1030,1035],{"type":58,"tag":92,"props":1022,"children":1023},{"style":427},[1024],{"type":64,"value":1025},"  system",{"type":58,"tag":92,"props":1027,"children":1028},{"style":149},[1029],{"type":64,"value":435},{"type":58,"tag":92,"props":1031,"children":1032},{"style":143},[1033],{"type":64,"value":1034}," memories",{"type":58,"tag":92,"props":1036,"children":1037},{"style":149},[1038],{"type":64,"value":502},{"type":58,"tag":92,"props":1040,"children":1042},{"class":94,"line":1041},18,[1043,1047,1051],{"type":58,"tag":92,"props":1044,"children":1045},{"style":149},[1046],{"type":64,"value":396},{"type":58,"tag":92,"props":1048,"children":1049},{"style":143},[1050],{"type":64,"value":497},{"type":58,"tag":92,"props":1052,"children":1053},{"style":149},[1054],{"type":64,"value":291},{"type":58,"tag":92,"props":1056,"children":1058},{"class":94,"line":1057},19,[1059],{"type":58,"tag":92,"props":1060,"children":1061},{"emptyLinePlaceholder":339},[1062],{"type":64,"value":342},{"type":58,"tag":92,"props":1064,"children":1066},{"class":94,"line":1065},20,[1067],{"type":58,"tag":92,"props":1068,"children":1069},{"style":200},[1070],{"type":64,"value":1071},"\u002F\u002F Optionally store the conversation back\n",{"type":58,"tag":92,"props":1073,"children":1075},{"class":94,"line":1074},21,[1076,1081,1085],{"type":58,"tag":92,"props":1077,"children":1078},{"style":250},[1079],{"type":64,"value":1080},"await",{"type":58,"tag":92,"props":1082,"children":1083},{"style":363},[1084],{"type":64,"value":717},{"type":58,"tag":92,"props":1086,"children":1087},{"style":143},[1088],{"type":64,"value":1089},"(\n",{"type":58,"tag":92,"props":1091,"children":1093},{"class":94,"line":1092},22,[1094],{"type":58,"tag":92,"props":1095,"children":1096},{"style":143},[1097],{"type":64,"value":1098},"  [\n",{"type":58,"tag":92,"props":1100,"children":1102},{"class":94,"line":1101},23,[1103,1108,1113,1117,1121,1126,1130,1134,1139,1143,1148,1153,1158,1162,1166,1170,1174,1178,1183,1187,1191,1195,1200],{"type":58,"tag":92,"props":1104,"children":1105},{"style":149},[1106],{"type":64,"value":1107},"    {",{"type":58,"tag":92,"props":1109,"children":1110},{"style":427},[1111],{"type":64,"value":1112}," role",{"type":58,"tag":92,"props":1114,"children":1115},{"style":149},[1116],{"type":64,"value":435},{"type":58,"tag":92,"props":1118,"children":1119},{"style":149},[1120],{"type":64,"value":278},{"type":58,"tag":92,"props":1122,"children":1123},{"style":105},[1124],{"type":64,"value":1125},"user",{"type":58,"tag":92,"props":1127,"children":1128},{"style":149},[1129],{"type":64,"value":157},{"type":58,"tag":92,"props":1131,"children":1132},{"style":149},[1133],{"type":64,"value":462},{"type":58,"tag":92,"props":1135,"children":1136},{"style":427},[1137],{"type":64,"value":1138}," content",{"type":58,"tag":92,"props":1140,"children":1141},{"style":149},[1142],{"type":64,"value":435},{"type":58,"tag":92,"props":1144,"children":1145},{"style":143},[1146],{"type":64,"value":1147}," [",{"type":58,"tag":92,"props":1149,"children":1150},{"style":149},[1151],{"type":64,"value":1152},"{",{"type":58,"tag":92,"props":1154,"children":1155},{"style":427},[1156],{"type":64,"value":1157}," type",{"type":58,"tag":92,"props":1159,"children":1160},{"style":149},[1161],{"type":64,"value":435},{"type":58,"tag":92,"props":1163,"children":1164},{"style":149},[1165],{"type":64,"value":278},{"type":58,"tag":92,"props":1167,"children":1168},{"style":105},[1169],{"type":64,"value":64},{"type":58,"tag":92,"props":1171,"children":1172},{"style":149},[1173],{"type":64,"value":157},{"type":58,"tag":92,"props":1175,"children":1176},{"style":149},[1177],{"type":64,"value":462},{"type":58,"tag":92,"props":1179,"children":1180},{"style":427},[1181],{"type":64,"value":1182}," text",{"type":58,"tag":92,"props":1184,"children":1185},{"style":149},[1186],{"type":64,"value":435},{"type":58,"tag":92,"props":1188,"children":1189},{"style":143},[1190],{"type":64,"value":760},{"type":58,"tag":92,"props":1192,"children":1193},{"style":149},[1194],{"type":64,"value":396},{"type":58,"tag":92,"props":1196,"children":1197},{"style":143},[1198],{"type":64,"value":1199},"] ",{"type":58,"tag":92,"props":1201,"children":1202},{"style":149},[1203],{"type":64,"value":1204},"},\n",{"type":58,"tag":92,"props":1206,"children":1208},{"class":94,"line":1207},24,[1209,1213,1217,1221,1225,1230,1234,1238,1242,1246,1250,1254,1258,1262,1266,1270,1274,1278,1282,1286,1290],{"type":58,"tag":92,"props":1210,"children":1211},{"style":149},[1212],{"type":64,"value":1107},{"type":58,"tag":92,"props":1214,"children":1215},{"style":427},[1216],{"type":64,"value":1112},{"type":58,"tag":92,"props":1218,"children":1219},{"style":149},[1220],{"type":64,"value":435},{"type":58,"tag":92,"props":1222,"children":1223},{"style":149},[1224],{"type":64,"value":278},{"type":58,"tag":92,"props":1226,"children":1227},{"style":105},[1228],{"type":64,"value":1229},"assistant",{"type":58,"tag":92,"props":1231,"children":1232},{"style":149},[1233],{"type":64,"value":157},{"type":58,"tag":92,"props":1235,"children":1236},{"style":149},[1237],{"type":64,"value":462},{"type":58,"tag":92,"props":1239,"children":1240},{"style":427},[1241],{"type":64,"value":1138},{"type":58,"tag":92,"props":1243,"children":1244},{"style":149},[1245],{"type":64,"value":435},{"type":58,"tag":92,"props":1247,"children":1248},{"style":143},[1249],{"type":64,"value":1147},{"type":58,"tag":92,"props":1251,"children":1252},{"style":149},[1253],{"type":64,"value":1152},{"type":58,"tag":92,"props":1255,"children":1256},{"style":427},[1257],{"type":64,"value":1157},{"type":58,"tag":92,"props":1259,"children":1260},{"style":149},[1261],{"type":64,"value":435},{"type":58,"tag":92,"props":1263,"children":1264},{"style":149},[1265],{"type":64,"value":278},{"type":58,"tag":92,"props":1267,"children":1268},{"style":105},[1269],{"type":64,"value":64},{"type":58,"tag":92,"props":1271,"children":1272},{"style":149},[1273],{"type":64,"value":157},{"type":58,"tag":92,"props":1275,"children":1276},{"style":149},[1277],{"type":64,"value":462},{"type":58,"tag":92,"props":1279,"children":1280},{"style":143},[1281],{"type":64,"value":391},{"type":58,"tag":92,"props":1283,"children":1284},{"style":149},[1285],{"type":64,"value":396},{"type":58,"tag":92,"props":1287,"children":1288},{"style":143},[1289],{"type":64,"value":1199},{"type":58,"tag":92,"props":1291,"children":1292},{"style":149},[1293],{"type":64,"value":1204},{"type":58,"tag":92,"props":1295,"children":1297},{"class":94,"line":1296},25,[1298,1303],{"type":58,"tag":92,"props":1299,"children":1300},{"style":143},[1301],{"type":64,"value":1302},"  ]",{"type":58,"tag":92,"props":1304,"children":1305},{"style":149},[1306],{"type":64,"value":502},{"type":58,"tag":92,"props":1308,"children":1310},{"class":94,"line":1309},26,[1311,1316,1320,1324,1328,1332,1336,1340,1345,1349,1353,1357,1361],{"type":58,"tag":92,"props":1312,"children":1313},{"style":149},[1314],{"type":64,"value":1315},"  {",{"type":58,"tag":92,"props":1317,"children":1318},{"style":427},[1319],{"type":64,"value":471},{"type":58,"tag":92,"props":1321,"children":1322},{"style":149},[1323],{"type":64,"value":435},{"type":58,"tag":92,"props":1325,"children":1326},{"style":149},[1327],{"type":64,"value":278},{"type":58,"tag":92,"props":1329,"children":1330},{"style":105},[1331],{"type":64,"value":484},{"type":58,"tag":92,"props":1333,"children":1334},{"style":149},[1335],{"type":64,"value":157},{"type":58,"tag":92,"props":1337,"children":1338},{"style":149},[1339],{"type":64,"value":462},{"type":58,"tag":92,"props":1341,"children":1342},{"style":427},[1343],{"type":64,"value":1344}," mem0ApiKey",{"type":58,"tag":92,"props":1346,"children":1347},{"style":149},[1348],{"type":64,"value":435},{"type":58,"tag":92,"props":1350,"children":1351},{"style":149},[1352],{"type":64,"value":278},{"type":58,"tag":92,"props":1354,"children":1355},{"style":105},[1356],{"type":64,"value":162},{"type":58,"tag":92,"props":1358,"children":1359},{"style":149},[1360],{"type":64,"value":157},{"type":58,"tag":92,"props":1362,"children":1363},{"style":149},[1364],{"type":64,"value":1365}," }\n",{"type":58,"tag":92,"props":1367,"children":1369},{"class":94,"line":1368},27,[1370,1374],{"type":58,"tag":92,"props":1371,"children":1372},{"style":143},[1373],{"type":64,"value":497},{"type":58,"tag":92,"props":1375,"children":1376},{"style":149},[1377],{"type":64,"value":291},{"type":58,"tag":73,"props":1379,"children":1381},{"id":1380},"pattern-3-streaming",[1382],{"type":64,"value":1383},"Pattern 3: Streaming",{"type":58,"tag":67,"props":1385,"children":1386},{},[1387,1389,1395],{"type":64,"value":1388},"Use ",{"type":58,"tag":88,"props":1390,"children":1392},{"className":1391},[],[1393],{"type":64,"value":1394},"streamText",{"type":64,"value":1396}," for streaming responses with memory augmentation:",{"type":58,"tag":80,"props":1398,"children":1400},{"className":238,"code":1399,"language":240,"meta":85,"style":85},"import { streamText } from \"ai\";\nimport { createMem0 } from \"@mem0\u002Fvercel-ai-provider\";\n\nconst mem0 = createMem0();\nconst result = streamText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"What should I cook for dinner?\",\n});\n\nfor await (const chunk of result.textStream) {\n  process.stdout.write(chunk);\n}\n",[1401],{"type":58,"tag":88,"props":1402,"children":1403},{"__ignoreMap":85},[1404,1444,1483,1490,1517,1545,1616,1644,1659,1666,1716,1759],{"type":58,"tag":92,"props":1405,"children":1406},{"class":94,"line":95},[1407,1411,1415,1420,1424,1428,1432,1436,1440],{"type":58,"tag":92,"props":1408,"children":1409},{"style":250},[1410],{"type":64,"value":253},{"type":58,"tag":92,"props":1412,"children":1413},{"style":149},[1414],{"type":64,"value":258},{"type":58,"tag":92,"props":1416,"children":1417},{"style":143},[1418],{"type":64,"value":1419}," streamText",{"type":58,"tag":92,"props":1421,"children":1422},{"style":149},[1423],{"type":64,"value":268},{"type":58,"tag":92,"props":1425,"children":1426},{"style":250},[1427],{"type":64,"value":273},{"type":58,"tag":92,"props":1429,"children":1430},{"style":149},[1431],{"type":64,"value":278},{"type":58,"tag":92,"props":1433,"children":1434},{"style":105},[1435],{"type":64,"value":30},{"type":58,"tag":92,"props":1437,"children":1438},{"style":149},[1439],{"type":64,"value":157},{"type":58,"tag":92,"props":1441,"children":1442},{"style":149},[1443],{"type":64,"value":291},{"type":58,"tag":92,"props":1445,"children":1446},{"class":94,"line":170},[1447,1451,1455,1459,1463,1467,1471,1475,1479],{"type":58,"tag":92,"props":1448,"children":1449},{"style":250},[1450],{"type":64,"value":253},{"type":58,"tag":92,"props":1452,"children":1453},{"style":149},[1454],{"type":64,"value":258},{"type":58,"tag":92,"props":1456,"children":1457},{"style":143},[1458],{"type":64,"value":307},{"type":58,"tag":92,"props":1460,"children":1461},{"style":149},[1462],{"type":64,"value":268},{"type":58,"tag":92,"props":1464,"children":1465},{"style":250},[1466],{"type":64,"value":273},{"type":58,"tag":92,"props":1468,"children":1469},{"style":149},[1470],{"type":64,"value":278},{"type":58,"tag":92,"props":1472,"children":1473},{"style":105},[1474],{"type":64,"value":324},{"type":58,"tag":92,"props":1476,"children":1477},{"style":149},[1478],{"type":64,"value":157},{"type":58,"tag":92,"props":1480,"children":1481},{"style":149},[1482],{"type":64,"value":291},{"type":58,"tag":92,"props":1484,"children":1485},{"class":94,"line":335},[1486],{"type":58,"tag":92,"props":1487,"children":1488},{"emptyLinePlaceholder":339},[1489],{"type":64,"value":342},{"type":58,"tag":92,"props":1491,"children":1492},{"class":94,"line":345},[1493,1497,1501,1505,1509,1513],{"type":58,"tag":92,"props":1494,"children":1495},{"style":137},[1496],{"type":64,"value":351},{"type":58,"tag":92,"props":1498,"children":1499},{"style":143},[1500],{"type":64,"value":356},{"type":58,"tag":92,"props":1502,"children":1503},{"style":149},[1504],{"type":64,"value":152},{"type":58,"tag":92,"props":1506,"children":1507},{"style":363},[1508],{"type":64,"value":307},{"type":58,"tag":92,"props":1510,"children":1511},{"style":143},[1512],{"type":64,"value":370},{"type":58,"tag":92,"props":1514,"children":1515},{"style":149},[1516],{"type":64,"value":291},{"type":58,"tag":92,"props":1518,"children":1519},{"class":94,"line":377},[1520,1524,1529,1533,1537,1541],{"type":58,"tag":92,"props":1521,"children":1522},{"style":137},[1523],{"type":64,"value":351},{"type":58,"tag":92,"props":1525,"children":1526},{"style":143},[1527],{"type":64,"value":1528}," result ",{"type":58,"tag":92,"props":1530,"children":1531},{"style":149},[1532],{"type":64,"value":152},{"type":58,"tag":92,"props":1534,"children":1535},{"style":363},[1536],{"type":64,"value":1419},{"type":58,"tag":92,"props":1538,"children":1539},{"style":143},[1540],{"type":64,"value":415},{"type":58,"tag":92,"props":1542,"children":1543},{"style":149},[1544],{"type":64,"value":420},{"type":58,"tag":92,"props":1546,"children":1547},{"class":94,"line":423},[1548,1552,1556,1560,1564,1568,1572,1576,1580,1584,1588,1592,1596,1600,1604,1608,1612],{"type":58,"tag":92,"props":1549,"children":1550},{"style":427},[1551],{"type":64,"value":430},{"type":58,"tag":92,"props":1553,"children":1554},{"style":149},[1555],{"type":64,"value":435},{"type":58,"tag":92,"props":1557,"children":1558},{"style":363},[1559],{"type":64,"value":440},{"type":58,"tag":92,"props":1561,"children":1562},{"style":143},[1563],{"type":64,"value":415},{"type":58,"tag":92,"props":1565,"children":1566},{"style":149},[1567],{"type":64,"value":157},{"type":58,"tag":92,"props":1569,"children":1570},{"style":105},[1571],{"type":64,"value":453},{"type":58,"tag":92,"props":1573,"children":1574},{"style":149},[1575],{"type":64,"value":157},{"type":58,"tag":92,"props":1577,"children":1578},{"style":149},[1579],{"type":64,"value":462},{"type":58,"tag":92,"props":1581,"children":1582},{"style":149},[1583],{"type":64,"value":258},{"type":58,"tag":92,"props":1585,"children":1586},{"style":427},[1587],{"type":64,"value":471},{"type":58,"tag":92,"props":1589,"children":1590},{"style":149},[1591],{"type":64,"value":435},{"type":58,"tag":92,"props":1593,"children":1594},{"style":149},[1595],{"type":64,"value":278},{"type":58,"tag":92,"props":1597,"children":1598},{"style":105},[1599],{"type":64,"value":484},{"type":58,"tag":92,"props":1601,"children":1602},{"style":149},[1603],{"type":64,"value":157},{"type":58,"tag":92,"props":1605,"children":1606},{"style":149},[1607],{"type":64,"value":268},{"type":58,"tag":92,"props":1609,"children":1610},{"style":143},[1611],{"type":64,"value":497},{"type":58,"tag":92,"props":1613,"children":1614},{"style":149},[1615],{"type":64,"value":502},{"type":58,"tag":92,"props":1617,"children":1618},{"class":94,"line":505},[1619,1623,1627,1631,1636,1640],{"type":58,"tag":92,"props":1620,"children":1621},{"style":427},[1622],{"type":64,"value":511},{"type":58,"tag":92,"props":1624,"children":1625},{"style":149},[1626],{"type":64,"value":435},{"type":58,"tag":92,"props":1628,"children":1629},{"style":149},[1630],{"type":64,"value":278},{"type":58,"tag":92,"props":1632,"children":1633},{"style":105},[1634],{"type":64,"value":1635},"What should I cook for dinner?",{"type":58,"tag":92,"props":1637,"children":1638},{"style":149},[1639],{"type":64,"value":157},{"type":58,"tag":92,"props":1641,"children":1642},{"style":149},[1643],{"type":64,"value":502},{"type":58,"tag":92,"props":1645,"children":1646},{"class":94,"line":535},[1647,1651,1655],{"type":58,"tag":92,"props":1648,"children":1649},{"style":149},[1650],{"type":64,"value":396},{"type":58,"tag":92,"props":1652,"children":1653},{"style":143},[1654],{"type":64,"value":497},{"type":58,"tag":92,"props":1656,"children":1657},{"style":149},[1658],{"type":64,"value":291},{"type":58,"tag":92,"props":1660,"children":1661},{"class":94,"line":836},[1662],{"type":58,"tag":92,"props":1663,"children":1664},{"emptyLinePlaceholder":339},[1665],{"type":64,"value":342},{"type":58,"tag":92,"props":1667,"children":1668},{"class":94,"line":865},[1669,1674,1678,1683,1687,1692,1697,1702,1707,1712],{"type":58,"tag":92,"props":1670,"children":1671},{"style":250},[1672],{"type":64,"value":1673},"for",{"type":58,"tag":92,"props":1675,"children":1676},{"style":250},[1677],{"type":64,"value":406},{"type":58,"tag":92,"props":1679,"children":1680},{"style":143},[1681],{"type":64,"value":1682}," (",{"type":58,"tag":92,"props":1684,"children":1685},{"style":137},[1686],{"type":64,"value":351},{"type":58,"tag":92,"props":1688,"children":1689},{"style":143},[1690],{"type":64,"value":1691}," chunk ",{"type":58,"tag":92,"props":1693,"children":1694},{"style":149},[1695],{"type":64,"value":1696},"of",{"type":58,"tag":92,"props":1698,"children":1699},{"style":143},[1700],{"type":64,"value":1701}," result",{"type":58,"tag":92,"props":1703,"children":1704},{"style":149},[1705],{"type":64,"value":1706},".",{"type":58,"tag":92,"props":1708,"children":1709},{"style":143},[1710],{"type":64,"value":1711},"textStream) ",{"type":58,"tag":92,"props":1713,"children":1714},{"style":149},[1715],{"type":64,"value":420},{"type":58,"tag":92,"props":1717,"children":1718},{"class":94,"line":894},[1719,1724,1728,1733,1737,1742,1746,1751,1755],{"type":58,"tag":92,"props":1720,"children":1721},{"style":143},[1722],{"type":64,"value":1723},"  process",{"type":58,"tag":92,"props":1725,"children":1726},{"style":149},[1727],{"type":64,"value":1706},{"type":58,"tag":92,"props":1729,"children":1730},{"style":143},[1731],{"type":64,"value":1732},"stdout",{"type":58,"tag":92,"props":1734,"children":1735},{"style":149},[1736],{"type":64,"value":1706},{"type":58,"tag":92,"props":1738,"children":1739},{"style":363},[1740],{"type":64,"value":1741},"write",{"type":58,"tag":92,"props":1743,"children":1744},{"style":427},[1745],{"type":64,"value":415},{"type":58,"tag":92,"props":1747,"children":1748},{"style":143},[1749],{"type":64,"value":1750},"chunk",{"type":58,"tag":92,"props":1752,"children":1753},{"style":427},[1754],{"type":64,"value":497},{"type":58,"tag":92,"props":1756,"children":1757},{"style":149},[1758],{"type":64,"value":291},{"type":58,"tag":92,"props":1760,"children":1761},{"class":94,"line":910},[1762],{"type":58,"tag":92,"props":1763,"children":1764},{"style":149},[1765],{"type":64,"value":1766},"}\n",{"type":58,"tag":67,"props":1768,"children":1769},{},[1770],{"type":64,"value":1771},"The wrapped model handles memory retrieval before streaming begins and stores the conversation after.",{"type":58,"tag":73,"props":1773,"children":1775},{"id":1774},"supported-providers",[1776],{"type":64,"value":1777},"Supported Providers",{"type":58,"tag":1779,"props":1780,"children":1781},"table",{},[1782,1806],{"type":58,"tag":1783,"props":1784,"children":1785},"thead",{},[1786],{"type":58,"tag":1787,"props":1788,"children":1789},"tr",{},[1790,1796,1801],{"type":58,"tag":1791,"props":1792,"children":1793},"th",{},[1794],{"type":64,"value":1795},"Provider",{"type":58,"tag":1791,"props":1797,"children":1798},{},[1799],{"type":64,"value":1800},"Config value",{"type":58,"tag":1791,"props":1802,"children":1803},{},[1804],{"type":64,"value":1805},"Required env var",{"type":58,"tag":1807,"props":1808,"children":1809},"tbody",{},[1810,1837,1863,1889,1915],{"type":58,"tag":1787,"props":1811,"children":1812},{},[1813,1819,1828],{"type":58,"tag":1814,"props":1815,"children":1816},"td",{},[1817],{"type":64,"value":1818},"OpenAI (default)",{"type":58,"tag":1814,"props":1820,"children":1821},{},[1822],{"type":58,"tag":88,"props":1823,"children":1825},{"className":1824},[],[1826],{"type":64,"value":1827},"\"openai\"",{"type":58,"tag":1814,"props":1829,"children":1830},{},[1831],{"type":58,"tag":88,"props":1832,"children":1834},{"className":1833},[],[1835],{"type":64,"value":1836},"OPENAI_API_KEY",{"type":58,"tag":1787,"props":1838,"children":1839},{},[1840,1845,1854],{"type":58,"tag":1814,"props":1841,"children":1842},{},[1843],{"type":64,"value":1844},"Anthropic",{"type":58,"tag":1814,"props":1846,"children":1847},{},[1848],{"type":58,"tag":88,"props":1849,"children":1851},{"className":1850},[],[1852],{"type":64,"value":1853},"\"anthropic\"",{"type":58,"tag":1814,"props":1855,"children":1856},{},[1857],{"type":58,"tag":88,"props":1858,"children":1860},{"className":1859},[],[1861],{"type":64,"value":1862},"ANTHROPIC_API_KEY",{"type":58,"tag":1787,"props":1864,"children":1865},{},[1866,1871,1880],{"type":58,"tag":1814,"props":1867,"children":1868},{},[1869],{"type":64,"value":1870},"Google",{"type":58,"tag":1814,"props":1872,"children":1873},{},[1874],{"type":58,"tag":88,"props":1875,"children":1877},{"className":1876},[],[1878],{"type":64,"value":1879},"\"google\"",{"type":58,"tag":1814,"props":1881,"children":1882},{},[1883],{"type":58,"tag":88,"props":1884,"children":1886},{"className":1885},[],[1887],{"type":64,"value":1888},"GOOGLE_GENERATIVE_AI_API_KEY",{"type":58,"tag":1787,"props":1890,"children":1891},{},[1892,1897,1906],{"type":58,"tag":1814,"props":1893,"children":1894},{},[1895],{"type":64,"value":1896},"Groq",{"type":58,"tag":1814,"props":1898,"children":1899},{},[1900],{"type":58,"tag":88,"props":1901,"children":1903},{"className":1902},[],[1904],{"type":64,"value":1905},"\"groq\"",{"type":58,"tag":1814,"props":1907,"children":1908},{},[1909],{"type":58,"tag":88,"props":1910,"children":1912},{"className":1911},[],[1913],{"type":64,"value":1914},"GROQ_API_KEY",{"type":58,"tag":1787,"props":1916,"children":1917},{},[1918,1923,1932],{"type":58,"tag":1814,"props":1919,"children":1920},{},[1921],{"type":64,"value":1922},"Cohere",{"type":58,"tag":1814,"props":1924,"children":1925},{},[1926],{"type":58,"tag":88,"props":1927,"children":1929},{"className":1928},[],[1930],{"type":64,"value":1931},"\"cohere\"",{"type":58,"tag":1814,"props":1933,"children":1934},{},[1935],{"type":58,"tag":88,"props":1936,"children":1938},{"className":1937},[],[1939],{"type":64,"value":1940},"COHERE_API_KEY",{"type":58,"tag":67,"props":1942,"children":1943},{},[1944],{"type":64,"value":1945},"Select a provider when creating the Mem0 instance:",{"type":58,"tag":80,"props":1947,"children":1949},{"className":238,"code":1948,"language":240,"meta":85,"style":85},"const mem0 = createMem0({ provider: \"anthropic\" });\nconst { text } = await generateText({\n  model: mem0(\"gpt-5-mini\", { user_id: \"alice\" }),\n  prompt: \"Hello!\",\n});\n",[1950],{"type":58,"tag":88,"props":1951,"children":1952},{"__ignoreMap":85},[1953,2014,2053,2124,2152],{"type":58,"tag":92,"props":1954,"children":1955},{"class":94,"line":95},[1956,1960,1964,1968,1972,1976,1980,1985,1989,1993,1998,2002,2006,2010],{"type":58,"tag":92,"props":1957,"children":1958},{"style":137},[1959],{"type":64,"value":351},{"type":58,"tag":92,"props":1961,"children":1962},{"style":143},[1963],{"type":64,"value":356},{"type":58,"tag":92,"props":1965,"children":1966},{"style":149},[1967],{"type":64,"value":152},{"type":58,"tag":92,"props":1969,"children":1970},{"style":363},[1971],{"type":64,"value":307},{"type":58,"tag":92,"props":1973,"children":1974},{"style":143},[1975],{"type":64,"value":415},{"type":58,"tag":92,"props":1977,"children":1978},{"style":149},[1979],{"type":64,"value":1152},{"type":58,"tag":92,"props":1981,"children":1982},{"style":427},[1983],{"type":64,"value":1984}," provider",{"type":58,"tag":92,"props":1986,"children":1987},{"style":149},[1988],{"type":64,"value":435},{"type":58,"tag":92,"props":1990,"children":1991},{"style":149},[1992],{"type":64,"value":278},{"type":58,"tag":92,"props":1994,"children":1995},{"style":105},[1996],{"type":64,"value":1997},"anthropic",{"type":58,"tag":92,"props":1999,"children":2000},{"style":149},[2001],{"type":64,"value":157},{"type":58,"tag":92,"props":2003,"children":2004},{"style":149},[2005],{"type":64,"value":268},{"type":58,"tag":92,"props":2007,"children":2008},{"style":143},[2009],{"type":64,"value":497},{"type":58,"tag":92,"props":2011,"children":2012},{"style":149},[2013],{"type":64,"value":291},{"type":58,"tag":92,"props":2015,"children":2016},{"class":94,"line":170},[2017,2021,2025,2029,2033,2037,2041,2045,2049],{"type":58,"tag":92,"props":2018,"children":2019},{"style":137},[2020],{"type":64,"value":351},{"type":58,"tag":92,"props":2022,"children":2023},{"style":149},[2024],{"type":64,"value":258},{"type":58,"tag":92,"props":2026,"children":2027},{"style":143},[2028],{"type":64,"value":391},{"type":58,"tag":92,"props":2030,"children":2031},{"style":149},[2032],{"type":64,"value":396},{"type":58,"tag":92,"props":2034,"children":2035},{"style":149},[2036],{"type":64,"value":401},{"type":58,"tag":92,"props":2038,"children":2039},{"style":250},[2040],{"type":64,"value":406},{"type":58,"tag":92,"props":2042,"children":2043},{"style":363},[2044],{"type":64,"value":263},{"type":58,"tag":92,"props":2046,"children":2047},{"style":143},[2048],{"type":64,"value":415},{"type":58,"tag":92,"props":2050,"children":2051},{"style":149},[2052],{"type":64,"value":420},{"type":58,"tag":92,"props":2054,"children":2055},{"class":94,"line":335},[2056,2060,2064,2068,2072,2076,2080,2084,2088,2092,2096,2100,2104,2108,2112,2116,2120],{"type":58,"tag":92,"props":2057,"children":2058},{"style":427},[2059],{"type":64,"value":430},{"type":58,"tag":92,"props":2061,"children":2062},{"style":149},[2063],{"type":64,"value":435},{"type":58,"tag":92,"props":2065,"children":2066},{"style":363},[2067],{"type":64,"value":440},{"type":58,"tag":92,"props":2069,"children":2070},{"style":143},[2071],{"type":64,"value":415},{"type":58,"tag":92,"props":2073,"children":2074},{"style":149},[2075],{"type":64,"value":157},{"type":58,"tag":92,"props":2077,"children":2078},{"style":105},[2079],{"type":64,"value":453},{"type":58,"tag":92,"props":2081,"children":2082},{"style":149},[2083],{"type":64,"value":157},{"type":58,"tag":92,"props":2085,"children":2086},{"style":149},[2087],{"type":64,"value":462},{"type":58,"tag":92,"props":2089,"children":2090},{"style":149},[2091],{"type":64,"value":258},{"type":58,"tag":92,"props":2093,"children":2094},{"style":427},[2095],{"type":64,"value":471},{"type":58,"tag":92,"props":2097,"children":2098},{"style":149},[2099],{"type":64,"value":435},{"type":58,"tag":92,"props":2101,"children":2102},{"style":149},[2103],{"type":64,"value":278},{"type":58,"tag":92,"props":2105,"children":2106},{"style":105},[2107],{"type":64,"value":484},{"type":58,"tag":92,"props":2109,"children":2110},{"style":149},[2111],{"type":64,"value":157},{"type":58,"tag":92,"props":2113,"children":2114},{"style":149},[2115],{"type":64,"value":268},{"type":58,"tag":92,"props":2117,"children":2118},{"style":143},[2119],{"type":64,"value":497},{"type":58,"tag":92,"props":2121,"children":2122},{"style":149},[2123],{"type":64,"value":502},{"type":58,"tag":92,"props":2125,"children":2126},{"class":94,"line":345},[2127,2131,2135,2139,2144,2148],{"type":58,"tag":92,"props":2128,"children":2129},{"style":427},[2130],{"type":64,"value":511},{"type":58,"tag":92,"props":2132,"children":2133},{"style":149},[2134],{"type":64,"value":435},{"type":58,"tag":92,"props":2136,"children":2137},{"style":149},[2138],{"type":64,"value":278},{"type":58,"tag":92,"props":2140,"children":2141},{"style":105},[2142],{"type":64,"value":2143},"Hello!",{"type":58,"tag":92,"props":2145,"children":2146},{"style":149},[2147],{"type":64,"value":157},{"type":58,"tag":92,"props":2149,"children":2150},{"style":149},[2151],{"type":64,"value":502},{"type":58,"tag":92,"props":2153,"children":2154},{"class":94,"line":377},[2155,2159,2163],{"type":58,"tag":92,"props":2156,"children":2157},{"style":149},[2158],{"type":64,"value":396},{"type":58,"tag":92,"props":2160,"children":2161},{"style":143},[2162],{"type":64,"value":497},{"type":58,"tag":92,"props":2164,"children":2165},{"style":149},[2166],{"type":64,"value":291},{"type":58,"tag":73,"props":2168,"children":2170},{"id":2169},"how-it-works-internally",[2171],{"type":64,"value":2172},"How It Works Internally",{"type":58,"tag":2174,"props":2175,"children":2177},"h3",{"id":2176},"wrapped-model-flow",[2178],{"type":64,"value":2179},"Wrapped model flow",{"type":58,"tag":80,"props":2181,"children":2185},{"className":2182,"code":2184,"language":64},[2183],"language-text","User prompt\n  --> searchInternalMemories (POST \u002Fv3\u002Fmemories\u002Fsearch\u002F)\n  --> memories injected as system message at start of prompt\n  --> underlying LLM generates response (doGenerate or doStream)\n  --> processMemories fires addMemories as fire-and-forget (no await)\n  --> response returned to caller\n",[2186],{"type":58,"tag":88,"props":2187,"children":2188},{"__ignoreMap":85},[2189],{"type":64,"value":2184},{"type":58,"tag":2174,"props":2191,"children":2193},{"id":2192},"standalone-flow",[2194],{"type":64,"value":2195},"Standalone flow",{"type":58,"tag":80,"props":2197,"children":2200},{"className":2198,"code":2199,"language":64},[2183],"User controls each step:\n  1. retrieveMemories \u002F getMemories \u002F searchMemories -> fetch memories\n  2. inject into system prompt manually\n  3. call generateText \u002F streamText with any provider\n  4. addMemories -> store new conversation to Mem0\n",[2201],{"type":58,"tag":88,"props":2202,"children":2203},{"__ignoreMap":85},[2204],{"type":64,"value":2199},{"type":58,"tag":73,"props":2206,"children":2208},{"id":2207},"key-differences-between-the-4-utility-functions",[2209],{"type":64,"value":2210},"Key Differences Between the 4 Utility Functions",{"type":58,"tag":1779,"props":2212,"children":2213},{},[2214,2235],{"type":58,"tag":1783,"props":2215,"children":2216},{},[2217],{"type":58,"tag":1787,"props":2218,"children":2219},{},[2220,2225,2230],{"type":58,"tag":1791,"props":2221,"children":2222},{},[2223],{"type":64,"value":2224},"Function",{"type":58,"tag":1791,"props":2226,"children":2227},{},[2228],{"type":64,"value":2229},"Returns",{"type":58,"tag":1791,"props":2231,"children":2232},{},[2233],{"type":64,"value":2234},"Use when",{"type":58,"tag":1807,"props":2236,"children":2237},{},[2238,2274,2301,2330],{"type":58,"tag":1787,"props":2239,"children":2240},{},[2241,2250,2261],{"type":58,"tag":1814,"props":2242,"children":2243},{},[2244],{"type":58,"tag":88,"props":2245,"children":2247},{"className":2246},[],[2248],{"type":64,"value":2249},"retrieveMemories",{"type":58,"tag":1814,"props":2251,"children":2252},{},[2253,2255],{"type":64,"value":2254},"Formatted system prompt ",{"type":58,"tag":2256,"props":2257,"children":2258},"strong",{},[2259],{"type":64,"value":2260},"string",{"type":58,"tag":1814,"props":2262,"children":2263},{},[2264,2266,2272],{"type":64,"value":2265},"Injecting directly into ",{"type":58,"tag":88,"props":2267,"children":2269},{"className":2268},[],[2270],{"type":64,"value":2271},"system",{"type":64,"value":2273}," parameter",{"type":58,"tag":1787,"props":2275,"children":2276},{},[2277,2286,2296],{"type":58,"tag":1814,"props":2278,"children":2279},{},[2280],{"type":58,"tag":88,"props":2281,"children":2283},{"className":2282},[],[2284],{"type":64,"value":2285},"getMemories",{"type":58,"tag":1814,"props":2287,"children":2288},{},[2289,2291],{"type":64,"value":2290},"Raw memory ",{"type":58,"tag":2256,"props":2292,"children":2293},{},[2294],{"type":64,"value":2295},"array",{"type":58,"tag":1814,"props":2297,"children":2298},{},[2299],{"type":64,"value":2300},"Processing memories programmatically",{"type":58,"tag":1787,"props":2302,"children":2303},{},[2304,2313,2325],{"type":58,"tag":1814,"props":2305,"children":2306},{},[2307],{"type":58,"tag":88,"props":2308,"children":2310},{"className":2309},[],[2311],{"type":64,"value":2312},"searchMemories",{"type":58,"tag":1814,"props":2314,"children":2315},{},[2316,2318,2323],{"type":64,"value":2317},"Full search ",{"type":58,"tag":2256,"props":2319,"children":2320},{},[2321],{"type":64,"value":2322},"response",{"type":64,"value":2324}," (results + relations)",{"type":58,"tag":1814,"props":2326,"children":2327},{},[2328],{"type":64,"value":2329},"Need relations, scores, metadata",{"type":58,"tag":1787,"props":2331,"children":2332},{},[2333,2342,2347],{"type":58,"tag":1814,"props":2334,"children":2335},{},[2336],{"type":58,"tag":88,"props":2337,"children":2339},{"className":2338},[],[2340],{"type":64,"value":2341},"addMemories",{"type":58,"tag":1814,"props":2343,"children":2344},{},[2345],{"type":64,"value":2346},"API response",{"type":58,"tag":1814,"props":2348,"children":2349},{},[2350],{"type":64,"value":2351},"Storing new messages to Mem0",{"type":58,"tag":67,"props":2353,"children":2354},{},[2355,2357,2363,2365,2371],{"type":64,"value":2356},"All four accept ",{"type":58,"tag":88,"props":2358,"children":2360},{"className":2359},[],[2361],{"type":64,"value":2362},"LanguageModelV2Prompt | string",{"type":64,"value":2364}," as the first argument and optional ",{"type":58,"tag":88,"props":2366,"children":2368},{"className":2367},[],[2369],{"type":64,"value":2370},"Mem0ConfigSettings",{"type":64,"value":2372}," as the second.",{"type":58,"tag":73,"props":2374,"children":2376},{"id":2375},"common-edge-cases-and-tips",[2377],{"type":64,"value":2378},"Common Edge Cases and Tips",{"type":58,"tag":2380,"props":2381,"children":2382},"ul",{},[2383,2422,2448,2458,2495,2528],{"type":58,"tag":559,"props":2384,"children":2385},{},[2386,2397,2399,2405,2407,2413,2414,2420],{"type":58,"tag":2256,"props":2387,"children":2388},{},[2389,2391],{"type":64,"value":2390},"Always provide ",{"type":58,"tag":88,"props":2392,"children":2394},{"className":2393},[],[2395],{"type":64,"value":2396},"user_id",{"type":64,"value":2398}," (or ",{"type":58,"tag":88,"props":2400,"children":2402},{"className":2401},[],[2403],{"type":64,"value":2404},"agent_id",{"type":64,"value":2406},"\u002F",{"type":58,"tag":88,"props":2408,"children":2410},{"className":2409},[],[2411],{"type":64,"value":2412},"app_id",{"type":64,"value":2406},{"type":58,"tag":88,"props":2415,"children":2417},{"className":2416},[],[2418],{"type":64,"value":2419},"run_id",{"type":64,"value":2421},") for consistent memory retrieval. Without an entity identifier, memories cannot be scoped.",{"type":58,"tag":559,"props":2423,"children":2424},{},[2425,2430,2432,2438,2440,2446],{"type":58,"tag":2256,"props":2426,"children":2427},{},[2428],{"type":64,"value":2429},"Standalone utilities require explicit API key",{"type":64,"value":2431},": pass ",{"type":58,"tag":88,"props":2433,"children":2435},{"className":2434},[],[2436],{"type":64,"value":2437},"mem0ApiKey",{"type":64,"value":2439}," in the config object, or set the ",{"type":58,"tag":88,"props":2441,"children":2443},{"className":2442},[],[2444],{"type":64,"value":2445},"MEM0_API_KEY",{"type":64,"value":2447}," environment variable.",{"type":58,"tag":559,"props":2449,"children":2450},{},[2451,2456],{"type":58,"tag":2256,"props":2452,"children":2453},{},[2454],{"type":64,"value":2455},"This uses Vercel AI SDK v5",{"type":64,"value":2457}," (LanguageModelV2 \u002F ProviderV2 interfaces). It is not compatible with AI SDK v3 or v4.",{"type":58,"tag":559,"props":2459,"children":2460},{},[2461,2479,2480,2486,2488,2493],{"type":58,"tag":2256,"props":2462,"children":2463},{},[2464,2470,2472,2477],{"type":58,"tag":88,"props":2465,"children":2467},{"className":2466},[],[2468],{"type":64,"value":2469},"processMemories",{"type":64,"value":2471}," fires ",{"type":58,"tag":88,"props":2473,"children":2475},{"className":2474},[],[2476],{"type":64,"value":2341},{"type":64,"value":2478}," as fire-and-forget",{"type":64,"value":1682},{"type":58,"tag":88,"props":2481,"children":2483},{"className":2482},[],[2484],{"type":64,"value":2485},".then()",{"type":64,"value":2487}," without ",{"type":58,"tag":88,"props":2489,"children":2491},{"className":2490},[],[2492],{"type":64,"value":1080},{"type":64,"value":2494},"). Memory storage happens asynchronously and does not block the LLM response.",{"type":58,"tag":559,"props":2496,"children":2497},{},[2498,2511,2513,2519,2521,2526],{"type":58,"tag":2256,"props":2499,"children":2500},{},[2501,2503,2509],{"type":64,"value":2502},"The ",{"type":58,"tag":88,"props":2504,"children":2506},{"className":2505},[],[2507],{"type":64,"value":2508},"\"gemini\"",{"type":64,"value":2510}," alias",{"type":64,"value":2512}," exists in the provider switch but is NOT in the ",{"type":58,"tag":88,"props":2514,"children":2516},{"className":2515},[],[2517],{"type":64,"value":2518},"supportedProviders",{"type":64,"value":2520}," list. Use ",{"type":58,"tag":88,"props":2522,"children":2524},{"className":2523},[],[2525],{"type":64,"value":1879},{"type":64,"value":2527}," instead.",{"type":58,"tag":559,"props":2529,"children":2530},{},[2531,2536,2538,2544,2546,2552],{"type":58,"tag":2256,"props":2532,"children":2533},{},[2534],{"type":64,"value":2535},"Custom host",{"type":64,"value":2537},": set ",{"type":58,"tag":88,"props":2539,"children":2541},{"className":2540},[],[2542],{"type":64,"value":2543},"host",{"type":64,"value":2545}," in the config to point to a different Mem0 API endpoint (default: ",{"type":58,"tag":88,"props":2547,"children":2549},{"className":2548},[],[2550],{"type":64,"value":2551},"https:\u002F\u002Fapi.mem0.ai",{"type":64,"value":2553},").",{"type":58,"tag":73,"props":2555,"children":2557},{"id":2556},"references",[2558],{"type":64,"value":2559},"References",{"type":58,"tag":1779,"props":2561,"children":2562},{},[2563,2579],{"type":58,"tag":1783,"props":2564,"children":2565},{},[2566],{"type":58,"tag":1787,"props":2567,"children":2568},{},[2569,2574],{"type":58,"tag":1791,"props":2570,"children":2571},{},[2572],{"type":64,"value":2573},"Topic",{"type":58,"tag":1791,"props":2575,"children":2576},{},[2577],{"type":64,"value":2578},"File",{"type":58,"tag":1807,"props":2580,"children":2581},{},[2582,2623,2659],{"type":58,"tag":1787,"props":2583,"children":2584},{},[2585,2605],{"type":58,"tag":1814,"props":2586,"children":2587},{},[2588,2590,2595,2597,2603],{"type":64,"value":2589},"Provider API (",{"type":58,"tag":88,"props":2591,"children":2593},{"className":2592},[],[2594],{"type":64,"value":233},{"type":64,"value":2596},", ",{"type":58,"tag":88,"props":2598,"children":2600},{"className":2599},[],[2601],{"type":64,"value":2602},"Mem0Provider",{"type":64,"value":2604},", types)",{"type":58,"tag":1814,"props":2606,"children":2607},{},[2608,2614,2616],{"type":58,"tag":210,"props":2609,"children":2611},{"href":2610},"references\u002Fprovider-api.md",[2612],{"type":64,"value":2613},"local",{"type":64,"value":2615}," \u002F ",{"type":58,"tag":210,"props":2617,"children":2620},{"href":2618,"rel":2619},"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fprovider-api.md",[214],[2621],{"type":64,"value":2622},"GitHub",{"type":58,"tag":1787,"props":2624,"children":2625},{},[2626,2644],{"type":58,"tag":1814,"props":2627,"children":2628},{},[2629,2631,2636,2637,2642],{"type":64,"value":2630},"Memory utilities (",{"type":58,"tag":88,"props":2632,"children":2634},{"className":2633},[],[2635],{"type":64,"value":2341},{"type":64,"value":2596},{"type":58,"tag":88,"props":2638,"children":2640},{"className":2639},[],[2641],{"type":64,"value":2249},{"type":64,"value":2643},", etc.)",{"type":58,"tag":1814,"props":2645,"children":2646},{},[2647,2652,2653],{"type":58,"tag":210,"props":2648,"children":2650},{"href":2649},"references\u002Fmemory-utilities.md",[2651],{"type":64,"value":2613},{"type":64,"value":2615},{"type":58,"tag":210,"props":2654,"children":2657},{"href":2655,"rel":2656},"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fmemory-utilities.md",[214],[2658],{"type":64,"value":2622},{"type":58,"tag":1787,"props":2660,"children":2661},{},[2662,2667],{"type":58,"tag":1814,"props":2663,"children":2664},{},[2665],{"type":64,"value":2666},"Usage patterns and examples",{"type":58,"tag":1814,"props":2668,"children":2669},{},[2670,2675,2676],{"type":58,"tag":210,"props":2671,"children":2673},{"href":2672},"references\u002Fusage-patterns.md",[2674],{"type":64,"value":2613},{"type":64,"value":2615},{"type":58,"tag":210,"props":2677,"children":2680},{"href":2678,"rel":2679},"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-vercel-ai-sdk\u002Freferences\u002Fusage-patterns.md",[214],[2681],{"type":64,"value":2622},{"type":58,"tag":73,"props":2683,"children":2685},{"id":2684},"related-mem0-skills",[2686],{"type":64,"value":2687},"Related Mem0 Skills",{"type":58,"tag":1779,"props":2689,"children":2690},{},[2691,2712],{"type":58,"tag":1783,"props":2692,"children":2693},{},[2694],{"type":58,"tag":1787,"props":2695,"children":2696},{},[2697,2702,2707],{"type":58,"tag":1791,"props":2698,"children":2699},{},[2700],{"type":64,"value":2701},"Skill",{"type":58,"tag":1791,"props":2703,"children":2704},{},[2705],{"type":64,"value":2706},"When to use",{"type":58,"tag":1791,"props":2708,"children":2709},{},[2710],{"type":64,"value":2711},"Link",{"type":58,"tag":1807,"props":2713,"children":2714},{},[2715,2742],{"type":58,"tag":1787,"props":2716,"children":2717},{},[2718,2722,2727],{"type":58,"tag":1814,"props":2719,"children":2720},{},[2721],{"type":64,"value":8},{"type":58,"tag":1814,"props":2723,"children":2724},{},[2725],{"type":64,"value":2726},"Python\u002FTypeScript SDK, REST API, framework integrations",{"type":58,"tag":1814,"props":2728,"children":2729},{},[2730,2735,2736],{"type":58,"tag":210,"props":2731,"children":2733},{"href":2732},"..\u002Fmem0\u002FSKILL.md",[2734],{"type":64,"value":2613},{"type":64,"value":2615},{"type":58,"tag":210,"props":2737,"children":2740},{"href":2738,"rel":2739},"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0",[214],[2741],{"type":64,"value":2622},{"type":58,"tag":1787,"props":2743,"children":2744},{},[2745,2750,2755],{"type":58,"tag":1814,"props":2746,"children":2747},{},[2748],{"type":64,"value":2749},"mem0-cli",{"type":58,"tag":1814,"props":2751,"children":2752},{},[2753],{"type":64,"value":2754},"Terminal commands, scripting, CI\u002FCD, agent tool loops",{"type":58,"tag":1814,"props":2756,"children":2757},{},[2758,2763,2764],{"type":58,"tag":210,"props":2759,"children":2761},{"href":2760},"..\u002Fmem0-cli\u002FSKILL.md",[2762],{"type":64,"value":2613},{"type":64,"value":2615},{"type":58,"tag":210,"props":2765,"children":2768},{"href":2766,"rel":2767},"https:\u002F\u002Fgithub.com\u002Fmem0ai\u002Fmem0\u002Ftree\u002Fmain\u002Fskills\u002Fmem0-cli",[214],[2769],{"type":64,"value":2622},{"type":58,"tag":2771,"props":2772,"children":2773},"style",{},[2774],{"type":64,"value":2775},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2777,"total":1101},[2778,2791,2803,2816,2830,2844,2855],{"slug":2779,"name":2779,"fn":2780,"description":2781,"org":2782,"tags":2783,"stars":23,"repoUrl":24,"updatedAt":2790},"context-loader","load project context from Mem0","Searches and injects relevant memories into context before starting work on a task. Use when beginning a new task, switching context, or when project history, past decisions, or coding conventions need to be loaded.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2784,2786,2789],{"name":2785,"slug":29,"type":16},"Agents",{"name":2787,"slug":2788,"type":16},"Context","context",{"name":18,"slug":19,"type":16},"2026-07-13T06:13:15.682218",{"slug":2792,"name":2792,"fn":2793,"description":2794,"org":2795,"tags":2796,"stars":23,"repoUrl":24,"updatedAt":2802},"dream","consolidate and prune stored memories","Consolidates stored memories by merging duplicates, resolving contradictions, and pruning stale entries. Use when memory count is high, search results feel noisy or repetitive, or periodic cleanup is needed to maintain memory quality.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2797,2798,2801],{"name":2785,"slug":29,"type":16},{"name":2799,"slug":2800,"type":16},"Data Cleaning","data-cleaning",{"name":18,"slug":19,"type":16},"2026-07-13T06:12:54.000421",{"slug":140,"name":140,"fn":2804,"description":2805,"org":2806,"tags":2807,"stars":23,"repoUrl":24,"updatedAt":2815},"export project memories to Markdown files","Exports all project memories to a portable Markdown file for backup or migration. Use when backing up memories, migrating to another project, sharing memory state with teammates, or archiving before cleanup.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2808,2811,2812],{"name":2809,"slug":2810,"type":16},"Backup","backup",{"name":18,"slug":19,"type":16},{"name":2813,"slug":2814,"type":16},"Migration","migration","2026-07-13T06:13:05.091831",{"slug":2817,"name":2817,"fn":2818,"description":2819,"org":2820,"tags":2821,"stars":23,"repoUrl":24,"updatedAt":2829},"forget","delete outdated or incorrect memories","Deletes memories by search query or memory ID with confirmation before removal. Use when removing outdated decisions, incorrect memories, sensitive data, or cleaning up after experiments. Also handles undo of recent additions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2822,2825,2826],{"name":2823,"slug":2824,"type":16},"Maintenance","maintenance",{"name":18,"slug":19,"type":16},{"name":2827,"slug":2828,"type":16},"Privacy","privacy","2026-07-13T06:13:00.862899",{"slug":2831,"name":2831,"fn":2832,"description":2833,"org":2834,"tags":2835,"stars":23,"repoUrl":24,"updatedAt":2843},"health","diagnose Mem0 connectivity and health","Diagnoses mem0 connectivity, API key validity, and memory read\u002Fwrite functionality. Use when memory operations fail, searches return empty, add_memory errors occur, MCP connection drops, or to verify the plugin is working correctly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2836,2839,2840],{"name":2837,"slug":2838,"type":16},"Debugging","debugging",{"name":18,"slug":19,"type":16},{"name":2841,"slug":2842,"type":16},"Monitoring","monitoring","2026-07-13T06:13:06.569475",{"slug":253,"name":253,"fn":2845,"description":2846,"org":2847,"tags":2848,"stars":23,"repoUrl":24,"updatedAt":2854},"import project memories from Markdown files","Imports memories from an exported Markdown file or MEMORY.md into the current project. Use when migrating from another project, restoring from backup, importing Claude Code native MEMORY.md content, or setting up a new project with existing knowledge.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2849,2852,2853],{"name":2850,"slug":2851,"type":16},"Markdown","markdown",{"name":18,"slug":19,"type":16},{"name":2813,"slug":2814,"type":16},"2026-07-13T06:12:59.389494",{"slug":2856,"name":2856,"fn":2857,"description":2858,"org":2859,"tags":2860,"stars":23,"repoUrl":24,"updatedAt":2863},"list-projects","list projects with stored memories","Lists all projects with stored memories for the current user, showing memory counts and last activity dates. Use when checking which projects have memories, comparing memory distribution across repos, or finding a specific project scope.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2861,2862],{"name":2785,"slug":29,"type":16},{"name":18,"slug":19,"type":16},"2026-07-13T06:13:27.80043",{"items":2865,"total":1101},[2866,2872,2878,2884,2890,2896,2902,2907,2918,2931,2943,2953],{"slug":2779,"name":2779,"fn":2780,"description":2781,"org":2867,"tags":2868,"stars":23,"repoUrl":24,"updatedAt":2790},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2869,2870,2871],{"name":2785,"slug":29,"type":16},{"name":2787,"slug":2788,"type":16},{"name":18,"slug":19,"type":16},{"slug":2792,"name":2792,"fn":2793,"description":2794,"org":2873,"tags":2874,"stars":23,"repoUrl":24,"updatedAt":2802},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2875,2876,2877],{"name":2785,"slug":29,"type":16},{"name":2799,"slug":2800,"type":16},{"name":18,"slug":19,"type":16},{"slug":140,"name":140,"fn":2804,"description":2805,"org":2879,"tags":2880,"stars":23,"repoUrl":24,"updatedAt":2815},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2881,2882,2883],{"name":2809,"slug":2810,"type":16},{"name":18,"slug":19,"type":16},{"name":2813,"slug":2814,"type":16},{"slug":2817,"name":2817,"fn":2818,"description":2819,"org":2885,"tags":2886,"stars":23,"repoUrl":24,"updatedAt":2829},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2887,2888,2889],{"name":2823,"slug":2824,"type":16},{"name":18,"slug":19,"type":16},{"name":2827,"slug":2828,"type":16},{"slug":2831,"name":2831,"fn":2832,"description":2833,"org":2891,"tags":2892,"stars":23,"repoUrl":24,"updatedAt":2843},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2893,2894,2895],{"name":2837,"slug":2838,"type":16},{"name":18,"slug":19,"type":16},{"name":2841,"slug":2842,"type":16},{"slug":253,"name":253,"fn":2845,"description":2846,"org":2897,"tags":2898,"stars":23,"repoUrl":24,"updatedAt":2854},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2899,2900,2901],{"name":2850,"slug":2851,"type":16},{"name":18,"slug":19,"type":16},{"name":2813,"slug":2814,"type":16},{"slug":2856,"name":2856,"fn":2857,"description":2858,"org":2903,"tags":2904,"stars":23,"repoUrl":24,"updatedAt":2863},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2905,2906],{"name":2785,"slug":29,"type":16},{"name":18,"slug":19,"type":16},{"slug":8,"name":8,"fn":2908,"description":2909,"org":2910,"tags":2911,"stars":23,"repoUrl":24,"updatedAt":2917},"add persistent memory to AI applications","Mem0 Platform SDK for adding persistent memory to AI applications. TRIGGER when: user mentions \"mem0\", \"MemoryClient\", \"memory layer\", \"remember user preferences\", \"persistent context\", \"personalization\", or needs to add long-term memory to chatbots, agents, or AI apps. Covers Python SDK (mem0ai), TypeScript SDK (mem0ai), and framework integrations (LangChain, CrewAI, OpenAI Agents SDK, Pipecat, LlamaIndex, AutoGen, LangGraph). Also covers the open-source self-hosted Memory class. This is the DEFAULT mem0 skill for ambiguous queries. DO NOT TRIGGER when: user asks about CLI commands, terminal usage, or shell scripts (use mem0-cli), or Vercel AI SDK \u002F @mem0\u002Fvercel-ai-provider \u002F createMem0 (use mem0-vercel-ai-sdk).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2912,2913,2916],{"name":2785,"slug":29,"type":16},{"name":2914,"slug":2915,"type":16},"AI Infrastructure","ai-infrastructure",{"name":18,"slug":19,"type":16},"2026-07-13T06:12:42.552904",{"slug":2749,"name":2749,"fn":2919,"description":2920,"org":2921,"tags":2922,"stars":23,"repoUrl":24,"updatedAt":2930},"manage Mem0 memory via command line","Mem0 CLI -- the command-line interface for mem0 memory operations. TRIGGER when: user mentions \"mem0 cli\", \"mem0 command line\", \"@mem0\u002Fcli\", \"mem0-cli\", \"pip install mem0-cli\", \"npm install -g @mem0\u002Fcli\", or is running mem0 commands in a terminal\u002Fshell (mem0 add, mem0 search, mem0 list, mem0 get, mem0 init, mem0 config, mem0 import). Also triggers when query includes CLI flags like --user-id, --output, --json, --agent, or describes bash\u002Fzsh\u002Fterminal\u002Fshell usage. DO NOT TRIGGER when: user asks about programmatic SDK integration in Python\u002FTS code (use mem0 skill), or Vercel AI SDK provider (use mem0-vercel-ai-sdk skill).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2923,2926,2929],{"name":2924,"slug":2925,"type":16},"Automation","automation",{"name":2927,"slug":2928,"type":16},"CLI","cli",{"name":18,"slug":19,"type":16},"2026-07-13T06:12:48.46494",{"slug":2932,"name":2932,"fn":2933,"description":2934,"org":2935,"tags":2936,"stars":23,"repoUrl":24,"updatedAt":2942},"mem0-integrate","integrate Mem0 into repositories","Integrate Mem0 into an existing repository using a goal-driven, TDD pipeline. Detects the repo's language automatically and asks the user to pick between Mem0 Platform (managed) and Mem0 Open Source (self-hosted). Writes failing tests before any implementation. Produces a local feature branch plus `.mem0-integration\u002F` artifacts consumed by the paired verification skill. TRIGGER when: user says \"integrate mem0\", \"add mem0 to this repo\", \"wire mem0 into \u003Crepo>\", or asks how to add memory to an existing project. DO NOT TRIGGER when: the user wants general SDK usage (use skill:mem0), CLI usage (use skill:mem0-cli), or Vercel AI SDK (use skill:mem0-vercel-ai-sdk). After success, invoke skill:mem0-test-integration to verify in the same workspace (loose coupling).\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2937,2938,2941],{"name":2785,"slug":29,"type":16},{"name":2939,"slug":2940,"type":16},"API Development","api-development",{"name":18,"slug":19,"type":16},"2026-07-13T06:12:46.60755",{"slug":2944,"name":2944,"fn":2945,"description":2946,"org":2947,"tags":2948,"stars":23,"repoUrl":24,"updatedAt":2952},"mem0-oss-to-platform","migrate Mem0 projects to platform","Plan and then execute a migration of a project from the mem0 open-source \u002F self-hosted SDK (the local `Memory` class) to the mem0 Platform \u002F hosted \u002F managed SDK (the `MemoryClient` class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS\u002Fself-hosted to the hosted API — e.g. \"migrate my mem0 setup to the platform\", \"switch from self-hosted mem0 to MemoryClient\", \"use my mem0 API key instead of a local Qdrant\", \"move mem0 to the cloud\u002Fhosted\u002Fmanaged service\", or \"replace my local mem0 vector store + embedder config with the platform\". Applies to Python (`from mem0 import Memory` → `from mem0 import MemoryClient`) and TypeScript\u002FJavaScript (`import { Memory } from \"mem0ai\u002Foss\"` → `import MemoryClient from \"mem0ai\"`). Trigger even when the user doesn't say the word \"migrate\" but clearly wants their existing mem0 integration to run against the hosted platform. It first produces a reviewable migration plan, then executes it after the developer approves. Strictly scoped to the mem0 integration — it does not refactor, restructure, or \"improve\" any unrelated code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2949,2950,2951],{"name":2785,"slug":29,"type":16},{"name":18,"slug":19,"type":16},{"name":2813,"slug":2814,"type":16},"2026-07-13T06:12:43.848266",{"slug":2954,"name":2954,"fn":2955,"description":2956,"org":2957,"tags":2958,"stars":23,"repoUrl":24,"updatedAt":2967},"mem0-test-integration","verify Mem0 integration tests","Verify a Mem0 integration produced by \u002Fmem0-integrate. Runs in the same workspace on the same branch (loose coupling) — installs dependencies, runs the repo's native test suite, then exercises a real end-to-end smoke flow against the user's API key. Produces a scorecard. TRIGGER when: user has just run \u002Fmem0-integrate and says \"verify\", \"test the integration\", \"run \u002Fmem0-test-integration\", or when a .mem0-integration\u002F directory exists and tests have not been run yet on the current branch. DO NOT TRIGGER when: the user wants to run general project tests (defer to the repo's native test command), or when no prior \u002Fmem0-integrate run exists in the current branch (ask them to run \u002Fmem0-integrate first). This skill ONLY catches compile and runtime bugs by design. Logical integration errors — wrong data stored, wrong time retrieved, wrong user scoping — are on the human reviewer.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2959,2960,2961,2964],{"name":2785,"slug":29,"type":16},{"name":18,"slug":19,"type":16},{"name":2962,"slug":2963,"type":16},"QA","qa",{"name":2965,"slug":2966,"type":16},"Testing","testing","2026-07-13T06:12:50.669701"]