API Reference
Summarize Memory
Summarize a list of memory ids into one synthesized record. The handler decrypts the source memories with the tenant key, runs the summarization model, and writes a new record marked
is_summary with parent_id linking to the source set.POST/memory/summarize
Authentication
Accepts a JWT bearer token (Authorization: Bearer eyJ…) or an API key (X-API-Key: ms_live_…). API-key callers should send X-Project-ID unless the key is project-locked. Cross-tenant operators must send X-Tenant-ID.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
memory_ids | integer[] | required | Source memory ids to summarize. |
style | string | optional | concise | detailed. Default concise. |
lossless | boolean | optional | When true, sources are kept; when false, sources are tombstoned. |
request.json
{"memory_ids": [184213,184214,184215],"style": "concise","lossless": true}
Response
Returns 200 OK with the following body.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | optional | Id of the new summary record. |
parent_ids | integer[] | optional | Source memories that fed the summary. |
is_summary | boolean | optional | Always true. |
created_at | string | optional | RFC 3339 UTC. |
200.json
{"id": 184221,"parent_ids": [184213,184214,184215],"is_summary": true,"created_at": "2026-05-04T12:31:00Z"}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Body or query failed schema validation. The error includes the offending field name. |
| 401 | unauthenticated | Missing or invalid bearer token / API key. |
| 403 | forbidden | Authenticated principal lacks the required scope, role, or project access. |
| 404 | not_found | Target resource does not exist or is not visible to the calling tenant. |
| 429 | rate_limited | Per-IP or per-route limit exceeded. Respect the Retry-After header. |
| 500 | internal_error | Unhandled server error. Quote the request_id when contacting support. |
Examples
cURL
curl -X POST https://api.memorysync.io/memory/summarize \-H "Authorization: Bearer $MEMORYSYNC_KEY" \-H "Content-Type: application/json" \-d '{"memory_ids": [184213,184214,184215],"style": "concise","lossless": true}'
javascript
import { MemorySync } from 'memorysync'const client = new MemorySync({ apiKey: process.env.MEMORYSYNC_KEY })const result = await client.request({method: 'POST',path: '/memory/summarize',body: {"memory_ids": [184213,184214,184215],"style": "concise","lossless": true},})console.log(result)
python
from memorysync import Clientclient = Client(api_key=os.environ["MEMORYSYNC_KEY"])result = client.request(method="POST",path="/memory/summarize",json={"memory_ids": [184213,184214,184215],"style": "concise","lossless": true},)print(result)
Behavior & notes
Idempotent through Idempotency-Key on writes. Replays within 24h return the original response unchanged.