Endpoint
Authentication
Request body
Schema
| Field | Type | Required | Notes |
|---|---|---|---|
external_user_id | string | Yes | End-user identifier inside your tenant |
query | string | Yes | Natural-language retrieval query |
limit | integer | No | Default 10, max 50 |
categories | MemoryCategory[] | No | Optional category filters |
agent_id | string | null | No | Optional agent filter |
time_filter_days | integer | null | No | Return only memories created in the last N days |
format | "bullets" | "json" | "xml" | No | Default bullets |
context_max_tokens | integer | No | Default 500; max context budget for system_prompt_addition |
Response
Response schema
Top-level fields
| Field | Type | Meaning |
|---|---|---|
data | MemorySearchResult[] | Ranked memory results |
cached | boolean | Whether retrieval came from the hot cache |
system_prompt_addition | string | Prompt-ready memory context |
context_token_count | integer | null | Token count of the built context when available |
memories_from_hot_tier | integer | Number of returned memories served from Redis hot tier |
clarification_question | string | null | Optional user-facing question for resolving a pending conflict |
request_id | string | Trace id |
timestamp | datetime | Response timestamp |
Domain-aware retrieval
If a tenant has a domain schema enabled, the same retrieve endpoint returns domain-aware context insystem_prompt_addition.
For example, an EdTech tenant may receive tutoring context about exam goals, weak topics, learning style, or forgetting-stage review urgency.
The request shape does not change:
MemorySearchResult
| Field | Type | Meaning |
|---|---|---|
id | string | Memory id |
content | string | Memory text |
category | string | Memory category |
importance_score | float | Importance score |
last_accessed | datetime | null | Last access timestamp |
relevance_score | float | Final retrieval score |
context_snippet | string | Single-memory rendering in the selected format |
format examples
The format value controls how MemoryOS renders both context_snippet and system_prompt_addition.
bullets
system_prompt_addition:
json
system_prompt_addition:
xml
system_prompt_addition:
Context token limit
Usecontext_max_tokens to limit the size of system_prompt_addition.