API Reference
Synthesize Answer
Compose a single answer from several memories, with the records it drew on.
Endpoint and request fields
POST/memory/synthesize
200 OK
| Field | Type | Contract |
|---|---|---|
query | string | Optional question to answer. |
memory_ids | integer[] | Optional explicit records to synthesize from. |
max_memories | integer | Optional ceiling on records considered. |
Supply query to let retrieval choose the inputs, or memory_ids to fix them.
Synthesize an answer
import osfrom memorysync import MemorySyncClientclient = 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.synthesize(query="Summarize what we know about this customer", max_memories=20)
Result handling
Returns the synthesized text together with the records it used, so an application can cite them. The SDKs return the payload unmodified.
Errors and next action
Supplying neither query nor memory_ids is a 422. For 429 or 5xx, fall back to Query and compose in your own application.