MemorySync
API Reference

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

OperationPythonNode.jsHTTP contractSuccessful result
AddaddaddPOST /memory/add201 Memory or normal 200 skipped
Bulk addbulk_addbulkAddPOST /memory/bulk-add207 per-item outcomes
ComposecomposecomposePOST /memory/compose200 composition result
Create relationcreate_relationcreateRelationPOST /memory/{memory_id}/relations201 relation
Export allexport_allexportAllGET /memory/export200 export bundle
ForgetforgetforgetDELETE /memory/forget200 integer IDs
GetgetgetGET /memory/{memory_id}200 Memory
QueryqueryqueryPOST /memory/query200 memories array
SummarizesummarizesummarizePOST /memory/summarize200 Memory
UpdateupdateupdatePATCH /memory/{memory_id}200 Memory

Choose an operation

What does your application need to do?

Store context

Submit one candidate or a batch.

Use: Add or Bulk Add

Find or compose context

Retrieve matching records or build a bounded prompt.

Use: Query or Compose

Read or transfer data

Fetch one ID or export the current user scope.

Use: Get or Export

Maintain data

Update, relate, summarize, or forget selected records.

Use: Use the matching operation page below.

Add then query

import os
from memorysync import MemorySyncClient
client = 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

query-response.json
{"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

Shared Memory fields

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

Memory lifecycle
  1. 01

    Capture

    Add

    Add one focused candidate or submit an independent batch.

  2. 02

    Retrieve

    Query / Get

    Query by task intent or fetch a known ID.

  3. 03

    Maintain

    Maintain

    Update descriptive fields, create relations, or summarize selected records.

  4. 04

    Transfer

    Export

    Export data available to the authenticated principal when required.

  5. 05

    Remove

    Forget

    Authorize and forget selected IDs.

REST and SDK naming

ConceptREST / PythonNode.js
End-user configurationend_user_idendUserId
Bulk addbulk_addbulkAdd
Create relationcreate_relationcreateRelation
Export allexport_allexportAll
Memory IDsmemory_idsmemoryIds
Created timestampcreated_atcreatedAt
Summary markeris_summaryisSummary
Was this page helpful?