MemorySync
API Reference

Add Conversation Turn

Send a conversation turn and let extraction decide what is worth remembering from it.

Endpoint and request fields

POST/v1/memory/add_turn
200 OK
FieldTypeContract
tenant_idstringRequired tenant identifier.
user_idstringRequired end-user identifier.
messagesarrayRequired turn, as role and content objects.
session_idstringOptional conversation grouping.
metadataobjectOptional metadata applied to what is extracted.

Add a turn

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.add_turn(
tenant_id="acme",
user_id="usr_7f3a9c2e",
messages=[
{"role": "user", "content": "I always fly with the window seat."},
{"role": "assistant", "content": "Noted."},
],
)

Result handling

Extraction decides what, if anything, is worth storing. A turn that carries no durable fact stores nothing and reports a skip — that is a normal outcome, not a failure.

Errors and next action

A 422 means a missing tenant_id, user_id or messages. For 429 or 5xx, keep the turn so it can be replayed.

Safety notes