curl -X POST "http://localhost:8000/api/v2/agents/my-agent/recall" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{
"query": "user preferences",
"limit": 10,
"min_similarity": 0.2,
"type": ["preference"]
}'
{
"agent_id": "my-agent",
"session_id": "sess_cf824a95d305",
"query": "user preferences",
"memories": [
{
"id": "3e681f12-a28c-4d1d-9632-b8dadf1f9d0c",
"title": "User Preference Note",
"content": "Prefers email communication",
"text": "[PREFERENCE] User Preference Note\n\nPrefers email communication",
"type": "preference",
"confidence": 0.98,
"status": "active",
"expired_at": null,
"expired_by": null,
"tags": [],
"created_at": "2026-03-26T09:00:00.000000",
"updated_at": "2026-03-26T09:00:00.000000",
"actor_id": "my-agent",
"source": "agent",
"source_ref": null,
"agent_id": "my-agent",
"score": 0.086334,
"provenance": "explicit_statement"
}
],
"count": 1
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "query"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "query_too_long",
"message": "Query exceeds maximum length of 1000 characters",
"actual_length": 1500,
"max_length": 1000
}
}
{
"detail": {
"error": "k_too_large",
"message": "k exceeds maximum of 100",
"actual_k": 200,
"max_k": 100
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}
Search & Discovery
Recall
Run semantic search across an agent’s stored memories using natural language.
POST
/
api
/
v2
/
agents
/
{agent_id}
/
recall
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/recall" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{
"query": "user preferences",
"limit": 10,
"min_similarity": 0.2,
"type": ["preference"]
}'
{
"agent_id": "my-agent",
"session_id": "sess_cf824a95d305",
"query": "user preferences",
"memories": [
{
"id": "3e681f12-a28c-4d1d-9632-b8dadf1f9d0c",
"title": "User Preference Note",
"content": "Prefers email communication",
"text": "[PREFERENCE] User Preference Note\n\nPrefers email communication",
"type": "preference",
"confidence": 0.98,
"status": "active",
"expired_at": null,
"expired_by": null,
"tags": [],
"created_at": "2026-03-26T09:00:00.000000",
"updated_at": "2026-03-26T09:00:00.000000",
"actor_id": "my-agent",
"source": "agent",
"source_ref": null,
"agent_id": "my-agent",
"score": 0.086334,
"provenance": "explicit_statement"
}
],
"count": 1
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "query"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "query_too_long",
"message": "Query exceeds maximum length of 1000 characters",
"actual_length": 1500,
"max_length": 1000
}
}
{
"detail": {
"error": "k_too_large",
"message": "k exceeds maximum of 100",
"actual_k": 200,
"max_k": 100
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}
Overview
Run semantic search across stored memories. This retrieves contextually relevant memories for the active agent based on semantic similarity to the query. Filters are sent as JSON in the request body only (no query-string parameters).Authentication
API clients do not send an API key orAuthorization header.
string
required
Session token from Activate Agent. Must match
agent_id.string
required
Must be
application/jsonPath Parameters
string
required
The unique identifier of the agent.
Body
string
required
Natural-language search text matched against the agent’s memories (max 1000 characters).
integer
Maximum number of results to return. Range
1–100. If omitted, the server default applies (RECALL_LIMIT).number
Minimum similarity score in the range
0.0–1.0 to filter out less relevant memories.array
Optional list of memory type filters (e.g.
["fact", "preference"]).string
default:"all"
Lifecycle filter:
all (default) returns active and expired memories
together so callers can label them, active or expired narrows to one.
See Memory Lifecycle.ITS Scoring System
Memories are scored using Information Theoretic Similarity (ITS), providing nuanced relevance measurements. Use themin_similarity parameter to filter out results below a certain threshold:
| Label | Score Range | Description |
|---|---|---|
| Close Match | score ≥ 0.894 | Near-perfect relevance to the query |
| Very High Relevance | 0.632 ≤ score < 0.894 | Strongly related content |
| High Relevance | 0.447 ≤ score < 0.632 | Significantly related content |
| Good Relevance | 0.316 ≤ score < 0.447 | Moderately related content |
| Low Relevance | 0.224 ≤ score < 0.316 | Minimally related content |
| Very Low Relevance | 0.1 ≤ score < 0.224 | Barely related content |
| Irrelevant | score < 0.1 | No meaningful relation to the query |
curl -X POST "http://localhost:8000/api/v2/agents/my-agent/recall" \
-H "X-Session-Token: your_session_token" \
-H "Content-Type: application/json" \
-d '{
"query": "user preferences",
"limit": 10,
"min_similarity": 0.2,
"type": ["preference"]
}'
{
"agent_id": "my-agent",
"session_id": "sess_cf824a95d305",
"query": "user preferences",
"memories": [
{
"id": "3e681f12-a28c-4d1d-9632-b8dadf1f9d0c",
"title": "User Preference Note",
"content": "Prefers email communication",
"text": "[PREFERENCE] User Preference Note\n\nPrefers email communication",
"type": "preference",
"confidence": 0.98,
"status": "active",
"expired_at": null,
"expired_by": null,
"tags": [],
"created_at": "2026-03-26T09:00:00.000000",
"updated_at": "2026-03-26T09:00:00.000000",
"actor_id": "my-agent",
"source": "agent",
"source_ref": null,
"agent_id": "my-agent",
"score": 0.086334,
"provenance": "explicit_statement"
}
],
"count": 1
}
{
"detail": "Missing session token. Use X-Session-Token header."
}
{
"detail": {
"error": "SessionExpired",
"message": "Session has expired",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": ["body", "query"],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "query_too_long",
"message": "Query exceeds maximum length of 1000 characters",
"actual_length": 1500,
"max_length": 1000
}
}
{
"detail": {
"error": "k_too_large",
"message": "k exceeds maximum of 100",
"actual_k": 200,
"max_k": 100
}
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "Session is for agent 'other-agent', cannot access 'my-agent'"
}
}
}
Next Steps
- Generate AI Answer to have an LLM synthesize the returned memories into a response
- Recall Recent to fetch the most recently stored memories
- Recall As Of for point-in-time queries
- Recall Changed Since for differential retrieval