API reference · API
Search a memory space by meaning
POST/v1/memories/searchAPI key
The query is embedded with the space's model, billed as this key, and the space's memories come back nearest first, held to user, the metadata filters (eq, ne, gt, gte, lt, lte, in, nin, and, or) and the threshold. A 404 at every path while the operator has not turned memory on.
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| queryrequired | string | At most 4000 characters. |
| space_id | string | At most 100 characters. |
| user | string or null | |
| filters | object or null | OpenAI's attribute filter over each memory's metadata: { type: eq | ne | gt | gte | lt | lte | in | nin, key, value } or { type: and | or, filters: [...] }, nested. |
| top_k | integer | From 1 to 100. |
| threshold | number | From 0 to 1. |
Example
{
"query": "string"
}Answer 200
The nearest memories with their scores.
Headers: x-antimatter-cost-micros
| Field | Type | What it is |
|---|---|---|
| object | "list" | |
| data | array of object | |
| data[] | string | mem_ and 24 hex digits. |
| data[] | "memory" | |
| data[] | string | |
| data[] | string | The remembered text. |
| data[] | string or null | Your end user it is about. |
| data[] | object | |
| data[] | string | One of "explicit", "extracted", "chat", "agent". |
| data[] | number or null | 0 to 1, as the extraction gave it; null for a text written as is. |
| data[] | number | On a search: cosine similarity, 0 to 1. |
| data[] | integer | |
| data[] | integer | |
| first_id | string or null | |
| last_id | string or null | |
| has_more | boolean |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI 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.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.