MemorySync
API Reference

Retrieve Memory

An alias of Query against a second live path. Identical semantics, provided because integrators arriving from other platforms reach for retrieve.

Endpoint

POST/memory/retrieve
200 OK

Retrieve context

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",
)
result = client.retrieve("How should answers be formatted?", k=5)

Result handling

The response is the same shape Query returns: a memories array and an optional context string. An empty array is a valid result, not an error.

Errors and next action

Identical to Query. Correct 4xx before retrying; preserve a recoverable state for 429 and 5xx.

Safety notes