ctx_remember
Extract and save durable memories from multi-turn conversations as deduped atomic contexts, scoped by subject or workspace. Preview with dryRun; poll async jobs for long chats.
Instructions
Extract durable memories from a raw multi-turn conversation and save them as deduped atomic contexts. Turn-aware sibling of ctx_ingest: the server builds a speaker-attributed transcript, extracts only durable facts/preferences via LLM (skipping chit-chat), and runs the claims through the SAME kNN-dedup + diff + create/update/archive pipeline ctx_ingest uses. Pass subjectId to scope memories to a single end-user of your application (Mem0-parity user_id) — dedup then only considers that subject's own prior memories, and every created context is tagged with that subjectId so ctx_search (subjectId param) and GET /api/memory can retrieve it later. Set dryRun=true to preview without persisting.
Long conversations run async — the response is { jobId, statusUrl } and you must poll ctx_ingest_status (or GET /api/ingest-jobs/:id) until status='succeeded' or 'failed'. Short conversations return the full result inline. Pass async=true/false to force a path explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| async | No | Force the async path (true) or sync path (false). Omit to let the server auto-pick — conversations longer than MEMORY_ASYNC_THRESHOLD messages (default 8) run async. | |
| dryRun | No | When true, run the full extract + diff pipeline but skip every DB write. Default false. | |
| project | No | Optional project identifier within the workspace. | |
| messages | Yes | Conversation turns in chronological order. | |
| agentSlug | No | Optional identifier of the agent that produced/consumed this conversation. Recorded as metadata only. | |
| maxClaims | No | Cap on claims extracted from the conversation. Default 10, hard max 25. | |
| sessionId | No | Optional conversation/session identifier. Recorded as metadata and on the audit row only. | |
| subjectId | No | End-user identity this conversation belongs to (Mem0-parity user_id). Scopes dedup and tags every created context so it can be retrieved later via ctx_search subjectId or GET /api/memory. | |
| workspace | No | Workspace identifier the extracted memories belong to. Falls back to the request's active scope when omitted. |