API reference · API
Remember texts, or the facts in a conversation
POST/v1/memoriesAPI key
Embeddings scope; the chat scope too unless infer is false. memories are kept as given; messages are read by a model for at most 20 facts, each with a confidence. A fact like an existing memory of the same user goes to a decision step (ADD, UPDATE, DELETE or NONE against what it was shown); words already kept are NONE with no call. Every model call is a request billed as this key, under strict JSON. async true answers 202 with a memory extraction to follow. A 404 at every path while the operator has not turned memory on.
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| space_id | string | A space id; the key's default space when absent (made on first use). At most 100 characters. |
| user | string or null | Your end user these memories are about; the space's own when absent. |
| memories | array of string or object | |
| messages | array of object | |
| messages[] | string | One of "system", "developer", "user", "assistant", "tool". |
| messages[] | string or array of any or null | |
| infer | boolean | false keeps every new text as it is: no model call but the embedding. |
| metadata | object or null | |
| async | boolean |
Example
{}Answer 200
Each change the write made.
Headers: x-antimatter-cost-micros
| Field | Type | What it is |
|---|---|---|
| object | "memory.write" | |
| space_id | string | |
| results | array of object | |
| results[] | string | |
| results[] | string | One of "ADD", "UPDATE", "DELETE", "NONE". |
| results[] | object or null | |
| results[] | string or null | |
| facts | integer | The facts read or given, after repeats were dropped. |
| model | string or null | The model that read and decided, if any. |
| usage | object | |
| usage. | integer | |
| usage. | array of string |
Answer 202
The conversation, queued.
| Field | Type | What it is |
|---|---|---|
| id | string | mex_ and 24 hex digits. |
| object | "memory.extraction" | |
| status | string | One of "pending", "running", "completed", "failed". |
| space_id | string | |
| results | array of any or null | |
| error | string or null | |
| usage | object | |
| usage. | integer |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 403OpenAI shaped error.
- 404OpenAI shaped error.
- 429Rate limited, or a spent budget or spend cap. The type distinguishes rate_limit_error, policy_exceeded, and spend_cap_exceeded.
- 502OpenAI shaped error.
- 503OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.