API Reference
Recall Context
Get a prompt-ready context block for an LLM call, rather than a list of records.
Endpoint and request fields
POST/v1/memory/recall
200 OK
| Field | Type | Contract |
|---|---|---|
tenant_id | string | Required tenant identifier. |
user_id | string | Required end-user identifier. |
prompt | string | Required prompt the context is being assembled for. |
k | integer | Optional ceiling on memories considered. |
types | string[] | Optional content-type filter. |
Build context
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.recall(tenant_id="acme",user_id="usr_7f3a9c2e",prompt="Book me a flight to Berlin",types=["preference", "fact"],)prompt = f"{result['context']}\n\nUser: Book me a flight to Berlin"
Result handling
Returns a context string ready to place in a prompt, plus the sub-queries, intents, entities and cluster hits that produced it. An empty context is a valid result for a user with nothing relevant stored.
How the types filter behaves
Errors and next action
A 422 means a missing required field. For 429 or 5xx, call the model without memory context rather than failing the user's request.