- Writes are queued.
memories.addreturns anevent_idwith statusPENDING, because extraction runs in the background. Pollevents.getuntil the status isSUCCEEDEDorFAILED. Passinginfer: falsestores the messages verbatim instead, which answers immediately with the stored memories. - A queued delete finishes before its event updates.
memories.deleteAllanswers with anevent_id, but that event can still readPENDINGafter the memories are gone. To confirm a delete, re-read withmemories.listand check thatcountis 0, passingshow_expired: trueand wrapping the scope infilters. Both are needed: withoutshow_expiredan expired memory is hidden, andmemories.listrejects a filter with no entity ID, so a delete scoped only bymetadata,org_idorproject_idcannot be re-read this way. For those, checkevents.getinstead. - Entity IDs. A memory belongs to a user, agent, app or run.
memories.addtakes those IDs at the top level;memories.searchandmemories.listrequire them insidefilters, and Mem0 rejects a top-level entity ID with 400. - Deletes are permanent.
memories.deleteremoves one memory, andmemories.deleteAllremoves every memory matching a filter. Mem0 queuesmemories.deleteAlland answers before the deletion happens. Neither can be undone. - The run ID has two names.
memories.listreturns it assession_idandmemories.searchreturns the same value asrun_id. - Expiration. A memory past its
expiration_datestays stored but is hidden from search and list unless you passshow_expired: true. To clear an expiration date, passexpiration_date: nulltomemories.update. - Rate limits and quotas. Mem0 answers 429 when a project is over its rate limit, and the plugin retries that up to three times with backoff. A free or paid plan’s monthly add and retrieval limits are separate: calls past those fail with a 413, which the plugin does not retry because the limits reset on the billing date.
- Webhooks. The plugin can register, list, change and remove Mem0 webhooks with
webhooks.create,webhooks.list,webhooks.updateandwebhooks.delete, so Mem0 posts memory events to your URL. It does not receive those posts itself: Mem0 publishes no signing secret or signature header, so a receiver built here could not tell a genuine post from a forged one. Verify deliveries in your own endpoint, and pollevents.listorevents.getif you would rather not run one.
memories.add accepts role values of user, assistant and system. memories.history reports events as ADD, UPDATE or DELETE, and events.get reports statuses of PENDING, RUNNING, FAILED and SUCCEEDED.
What you get:
- 16 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
A call with no saved key throws More: API Key
AuthMissingError before it reaches Mem0. Save the key once for the account with tenant.mem0.keys.set_api_key(...), which encrypts it with your KEK, or pass mem0({ key }) yourself.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List a user’s memoriesWhat’s next
API reference
Every
mem0.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.