Memory API Overview
Choose from every operation in the SDK-backed /memory contract shared by HTTPS, the Python SDK, and the Node.js SDK. The 23 customer control-plane operations are also documented with their published Python and Node.js ControlPlaneClient methods.
Alphabetical operation matrix
| Operation | Python | Node.js | HTTP contract | Successful result |
|---|---|---|---|---|
| Add | add | add | POST /memory/add | 201 Memory or normal 200 skipped |
| Bulk add | bulk_add | bulkAdd | POST /memory/bulk-add | 207 per-item outcomes |
| Compose | compose | compose | POST /memory/compose | 200 composition result |
| Create relation | create_relation | createRelation | POST /memory/{memory_id}/relations | 201 relation |
| Export all | export_all | exportAll | GET /memory/export | 200 export bundle |
| Forget | forget | forget | DELETE /memory/forget | 200 integer IDs |
| Get | get | get | GET /memory/{memory_id} | 200 Memory |
| Query | query | query | POST /memory/query | 200 memories array |
| Summarize | summarize | summarize | POST /memory/summarize | 200 Memory |
| Update | update | update | PATCH /memory/{memory_id} | 200 Memory |
Choose an operation
What does your application need to do?
Maintain data
Update, relate, summarize, or forget selected records.
Use: Use the matching operation page below.
Add then query
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",project_id=os.environ["MEMORYSYNC_PROJECT_ID"],end_user_id="usr_7f3a9c2e",)client.add("The user prefers concise answers.", tags=["preference"])result = client.query("How should answers be formatted?", filters={"tags": ["preference"]})
Shared result handling
{"memories":[{"id":101,"text":"The user prefers concise answers.","tags":["preference"],"is_summary":false,"created_at":"2026-05-04T12:30:11Z"}]}
Each operation page documents verified statuses and the shared REST, Python, and Node.js fields needed for the task. A 2xx response can still require branching, especially for add, bulk add, and empty query results.
Errors and next actions
Correct 4xx requests before trying again. For 429 or 5xx, preserve a recoverable application state and use returned error metadata. Never assume the outcome of an interrupted write.
Shared safety boundary
Memory object anatomy
A customer-visible memory record
SDKs expose the customer-useful subset with language-appropriate naming.
- Identity
- `id`
Integer handle for Get, Update, Relations, Summarize, and Forget.
- Content
- `text`, `summary`
Treat returned content as untrusted application data.
- Classification
- `source`, `event_type`, `tags`
Application-defined context used to understand or narrow records.
- Application data
- `importance`, `metadata`
Optional descriptive values controlled by your integration.
- Lifecycle
- `is_summary`, `created_at`, `updated_at`
Summary marker and timestamps.
Typical memory lifecycle
- 01
Capture
AddAdd one focused candidate or submit an independent batch.
- 02
Retrieve
Query / GetQuery by task intent or fetch a known ID.
- 03
Maintain
MaintainUpdate descriptive fields, create relations, or summarize selected records.
- 04
Transfer
ExportExport data available to the authenticated principal when required.
- 05
Remove
ForgetAuthorize and forget selected IDs.
REST and SDK naming
| Concept | REST / Python | Node.js |
|---|---|---|
| End-user configuration | end_user_id | endUserId |
| Bulk add | bulk_add | bulkAdd |
| Create relation | create_relation | createRelation |
| Export all | export_all | exportAll |
| Memory IDs | memory_ids | memoryIds |
| Created timestamp | created_at | createdAt |
| Summary marker | is_summary | isSummary |