Get Context
curl --request GET \
--url https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context \
--header 'X-Recallr-Api-Key: <x-recallr-api-key>' \
--header 'X-Recallr-Project-Id: <x-recallr-project-id>'{
"is_final": true,
"context": "# Relevant memories and context..."
}Sessions
Get Context
Retrieve AI context including relevant memories and recent conversations.
Generate context for LLM prompts by retrieving the most relevant memories and recent messages for a user. Use this to manually inject memory context into your AI applications.
Path Parameters:
custom_user_id(str): Unique identifier for the usersession_id(UUID): Session UUID to get context from
Query Parameters:
recall_strategy(RecallStrategy): Memory retrieval strategy. Options: low_latency, balanced, agentic and auto. Default: balancedmin_top_k(int): Minimum number of memories to return. Range: 5-50. Default: 15max_top_k(int): Maximum number of memories to return. Range: 10-100. Default: 50memories_threshold(float): Similarity threshold for memories. Range: 0.2-0.8. Default: 0.6summaries_threshold(float): Similarity threshold for session summaries. Range: 0.2-0.8. Default: 0.5last_n_messages(int): Number of last messages to include in context. Range: 1-100. Optionallast_n_summaries(int): Number of last summaries to include in context. Range: 1-20. Optionaltimezone(str): Timezone for formatting timestamps (e.g., ‘America/New_York’). Default: UTCinclude_system_prompt(bool): Whether to include the default system prompt. Default: truestream(bool): Whether to stream status updates via Server-Sent Events. Default: false
Returns:
- When
stream=false: JSONGetContextResponsewithis_final=trueandcontextfield - When
stream=true: SSE stream ofGetContextResponseevents with progress updates, ending with a final event containing the context
GET
/
api
/
v1
/
users
/
{custom_user_id}
/
sessions
/
{session_id}
/
context
Get Context
curl --request GET \
--url https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context \
--header 'X-Recallr-Api-Key: <x-recallr-api-key>' \
--header 'X-Recallr-Project-Id: <x-recallr-project-id>'{
"is_final": true,
"context": "# Relevant memories and context..."
}Documentation Index
Fetch the complete documentation index at: https://docs.recallrai.com/llms.txt
Use this file to discover all available pages before exploring further.
Query Parameters
Type of recall strategy.
Available options:
low_latency, balanced, agentic, auto Required range:
5 <= x <= 50Required range:
10 <= x <= 100Required range:
0.2 <= x <= 0.8Required range:
0.2 <= x <= 0.8Required range:
1 <= x <= 100Required range:
1 <= x <= 20Was this page helpful?
⌘I