MemorySync
API Reference

Memory API

Five core endpoints: add, query, summarize, forget, export. All require an API key with memory:* scopes and an X-Project-ID header.

Authentication

Send the API key as Authorization: Bearer ms_live_… or X-API-Key: ms_live_…. The key is environment-bound; the environment is attached to all requests automatically.

Common headers

HeaderRequiredDescription
Authorizationyes (or X-API-Key)Bearer ms_live_…
X-Project-IDrecommendedprj_xxx — defaults to org default project
X-End-User-IDoptionalFor B2B: pin memory to your end user
Idempotency-KeyoptionalReplay-safe writes
Content-Typeyesapplication/json

Add memory

POST/memory/add

Request

JSON
{
"text": "Customer 8821 reported login failures after MFA reset.", // or "content"
"source": "support_ticket",
"event_type": "incident_resolved",
"tags": ["mfa", "incident"],
"importance": 0.6,
"ttl_minutes": 43200,
"metadata": { "ticket_id": "ZD-9128" },
"deduplicate": true
}

Response · 201 Created

JSON
{
"id": 18420,
"user_id": 1042,
"text": "Customer 8821 reported login failures after MFA reset.",
"tier": "hot",
"importance": 0.6,
"tags": ["mfa", "incident"],
"created_at": "2026-05-04T11:42:01Z"
}
Note
When your organisation is over its monthly write quota, the route silently returns 200 with { "status": "ok" } and the memory is not stored. No error is surfaced to the caller.

Query memories

POST/memory/query

Request

JSON
{
"query": "What did we decide about MFA enforcement?",
"k": 5,
"filters": {
"sources": ["support_ticket", "slack"],
"tags": ["decision"],
"since": "2026-04-01T00:00:00Z",
"tier": "hot",
"include_summaries": true
},
"weights": {
"semantic": 0.5, "recency": 0.2, "importance": 0.15,
"quality": 0.05, "decay": 0.0, "usage": 0.05, "graph": 0.05
},
"traversal_depth": 2,
"session_id": "ses_01HMRT…",
"computation_tier": "medium"
}

Response · 200

JSON
{
"memories": [
{
"id": 18420,
"text": "Customer 8821 reported login failures after MFA reset.",
"summary": null,
"tier": "hot",
"score": 0.91,
"scores": { "semantic": 0.88, "recency": 1.0, "importance": 0.6 },
"explain": ["matched topic 'authentication'"],
"tags": ["mfa", "incident"],
"memory_type": "event"
}
],
"computation_tier": "medium",
"session_id": "ses_01HMRT…",
"filter_relaxed": false,
"latency_ms": 28
}

Summarize

POST/memory/summarize
JSON
{
"memory_ids": [18420, 18411, 18399, 18372],
"lossless": false
}

Returns the new summary memory with is_summary: true. With lossless: true the originals are preserved; otherwise they are tiered to cold.

Forget

DELETE/memory/forget
JSON
{
"memory_ids": [18420],
"reason": "GDPR erasure ER-2841"
}

Returns the list of deleted ids. An audit row is written first; PII-tagged memories require a reason.

Export

GET/memory/export

Returns a JSON bundle of all memories owned by the authenticated user, ready for compliance handoff. Pagination via ?cursor=…&limit=500.

Errors

StatusCodeMeaning
400invalid_payloadSchema or constraint violation
401unauthorizedMissing or invalid API key
403scope_requiredKey lacks required scope
404memory_not_foundOn forget/summarize for unknown id
422min_lengthText shorter than 10 characters
429rate_limitedPer-IP/route rate limit exceeded (not billing)
503embedding_unavailableAll providers failed including local

Rate limits

  • Free: 60 requests / minute / project.
  • Starter: 600 / minute.
  • Scale: 6,000 / minute.
  • Enterprise: configurable; default 30,000 / minute.

Limit headers on every response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.