Skip to main content
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>'
import requests

url = "https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context"

headers = {
"X-Recallr-Project-Id": "<x-recallr-project-id>",
"X-Recallr-Api-Key": "<x-recallr-api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {
'X-Recallr-Project-Id': '<x-recallr-project-id>',
'X-Recallr-Api-Key': '<x-recallr-api-key>'
}
};

fetch('https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Recallr-Api-Key: <x-recallr-api-key>",
"X-Recallr-Project-Id: <x-recallr-project-id>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-Recallr-Project-Id", "<x-recallr-project-id>")
req.Header.Add("X-Recallr-Api-Key", "<x-recallr-api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context")
.header("X-Recallr-Project-Id", "<x-recallr-project-id>")
.header("X-Recallr-Api-Key", "<x-recallr-api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.recallrai.com/api/v1/users/{custom_user_id}/sessions/{session_id}/context")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Recallr-Project-Id"] = '<x-recallr-project-id>'
request["X-Recallr-Api-Key"] = '<x-recallr-api-key>'

response = http.request(request)
puts response.read_body
{
  "is_final": true,
  "context": "# Relevant memories and context."
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Headers

X-Recallr-Project-Id
string<uuid>
required
X-Recallr-Api-Key
string
required

Path Parameters

custom_user_id
string
required
session_id
string<uuid>
required

Query Parameters

recall_strategy
enum<string>
default:auto

Type of recall strategy.

Available options:
low_latency,
balanced,
agentic,
auto
min_top_k
integer
default:15
Required range: 5 <= x <= 50
max_top_k
integer
default:50
Required range: 10 <= x <= 100
memories_threshold
number
default:0.6
Required range: 0.2 <= x <= 0.8
summaries_threshold
number
default:0.5
Required range: 0.2 <= x <= 0.8
last_n_messages
integer | null
Required range: 1 <= x <= 100
last_n_summaries
integer | null
Required range: 1 <= x <= 20
timezone
string
default:UTC
include_system_prompt
boolean
default:true
stream
boolean
default:false
include_metadata_ids
boolean
default:false

Response

Context retrieved successfully

is_final
boolean
required
status_update_message
string | null
error_message
string | null
context
string | null
metadata
ContextMetadata · object | null

Metadata for context generation.