{"uid":"cap_f_L70_1hEgd_4kqTDDLM3","slug":"mem0-cloud-add-memories-2910fadd","name":"Mem0 Cloud – Add Memories","description":"Store memories from a conversation, like mem0's add: an AI model extracts durable facts about the user from the messages (or, with infer=false, stores each message as is), embeds them and saves them privately under your memory_key (a secret string you generate; required). Identical facts are stored once. Needs at least one of user_id, agent_id, app_id, run_id. Memories are kept for 365 days. Returns {event_id, status, results:[{id, memory, event: ADD|NONE}]}.","url":"https://mem0-cloud.saastemly.com/v3/memories/add?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"infer":{"type":"boolean","description":"Default true: extract facts with the model. false: store each message verbatim (up to 10 messages of 300 characters)"},"app_id":{"type":"string","description":"Entity: the app (1-128 characters)"},"run_id":{"type":"string","description":"Entity: the session or run (1-128 characters)"},"user_id":{"type":"string","description":"Entity: the user the memories are about (1-128 characters)"},"agent_id":{"type":"string","description":"Entity: the agent the memories belong to (1-128 characters)"},"excludes":{"type":"string","description":"Optional: what not to extract"},"includes":{"type":"string","description":"Optional: what to focus on when extracting"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","description":"user, assistant or system"},"content":{"type":"string","description":"The message text"}}},"description":"Conversation turns, each {role: user|assistant|system, content: string}; up to 6000 bytes as JSON. A plain string is also accepted (one user message)."},"metadata":{"type":"object","description":"Custom key/value metadata stored with every memory (up to 2000 bytes as JSON)"},"memory_key":{"type":"string","description":"Your secret: a random string of 16-256 characters that you generate once and keep (also accepted as the X-Memory-Key header). Memories are stored and searched only under its hash, so nobody who lacks it can read them, whatever user_id they send. Lose it and the memories are unreachable."},"expiration_date":{"type":"string","description":"Optional YYYY-MM-DD: the memory is hidden from search and listing after that day (unless show_expired is true)"},"custom_instructions":{"type":"string","description":"Optional extra extraction instructions (with includes and excludes, up to 800 bytes together)"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.008","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OUqa6tYrjSBaBpHHI9pR0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Extracts and stores durable facts from conversation messages into a private, key-protected memory store tied to a user, agent, app, or run identity.","exampleAgentPrompt":"Remember what the user just told me — they said they're lactose intolerant, prefer morning meetings, and live in Austin — store these facts under memory key 'usr_k9x2mNpQrL4vTz8w' for user_id 'user_42'.","exampleUseCases":[{"title":"Personalize assistant across sessions","prompt":"After this conversation, remember that the user prefers concise answers, dislikes bullet points, and works in software engineering — store those facts under memory key 'pref_aK7qLm3NzXvR9sYw' for user_id 'alice_88' so I can use them next time."},{"title":"Track agent context during a run","prompt":"Save the key decisions made so far in this run — the user chose the premium plan, declined onboarding emails, and set their timezone to PST — store them verbatim under memory key 'run_T4kWpNx8LzQvRm2j' for run_id 'run_20240601_001'."},{"title":"Build user profile from support chat","prompt":"Extract any facts about the user from this support conversation and store them under memory key 'sup_Zx9NqLv3TmKpWr7y' for user_id 'cust_5512' and app_id 'helpdesk' — focus on their product usage and reported issues, and skip any sensitive payment info."}],"resultDescription":"Returns a JSON object with an event_id, a status string, and a results array. Each element in results contains an id (the memory's unique identifier), the memory text as stored, and an event field indicating ADD (newly stored) or NONE (duplicate, not re-stored).","failureModes":["Missing memory_key — returns 400/422, memories cannot be stored without the secret key","Missing all of user_id, agent_id, app_id, run_id — at least one is required","Messages payload exceeds 6000 bytes — returns 400","infer=false with messages exceeding 10 items or 300 chars each — payload rejected","Invalid or malformed messages format — returns 400","Payment not attached or insufficient USDC — returns 402","Network timeout on embedding/model inference step — returns 5xx"],"whenToPreferThis":"Choose this endpoint when you need to persistently capture facts or context from a conversation into a private, key-scoped memory store that can be retrieved later via semantic search. It is ideal when you want AI-powered extraction (infer=true) to distill durable facts from raw dialogue, or when you want verbatim message storage (infer=false). Prefer it over general-purpose databases when you need vector-embedded, semantically searchable memory with identity scoping (user/agent/app/run) and built-in deduplication.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:33:48.590Z","isFirstParty":false,"canonicalSlug":"mem0-cloud-add-memories-2910fadd"}