Update an agent
curl --request PATCH \
--url https://api.example.com/agent/{agent_id} \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"name": "<string>",
"system_prompt": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": false
}
}
'import requests
url = "https://api.example.com/agent/{agent_id}"
payload = {
"name": "<string>",
"system_prompt": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work
# Task Overview
{task_overview}
# Current State
{current_state}
# Important Discoveries
{important_discoveries}
# Next Steps
{next_steps}
# Context to Preserve
{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": False
}
}
headers = {
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-user-id': '<x-user-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
system_prompt: '<string>',
context_config: {
trigger_ratio: 0.8,
reserve_ratio: 0.1,
compression_prompt: '<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>',
summary_template: '<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>',
summary_schema: {},
tool_result_limit: 3000
},
react_config: {max_iters: 20, stop_on_reject: false}
})
};
fetch('https://api.example.com/agent/{agent_id}', 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.example.com/agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'system_prompt' => '<string>',
'context_config' => [
'trigger_ratio' => 0.8,
'reserve_ratio' => 0.1,
'compression_prompt' => '<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>',
'summary_template' => '<system-info>Here is a summary of your previous work
# Task Overview
{task_overview}
# Current State
{current_state}
# Important Discoveries
{important_discoveries}
# Next Steps
{next_steps}
# Context to Preserve
{context_to_preserve}</system-info>',
'summary_schema' => [
],
'tool_result_limit' => 3000
],
'react_config' => [
'max_iters' => 20,
'stop_on_reject' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-user-id: <x-user-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent/{agent_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/agent/{agent_id}")
.header("x-user-id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-user-id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"data": {
"name": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": false
},
"id": "<string>",
"system_prompt": "You're a helpful assistant."
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"source": "user"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}agent
Update an agent
Partially update an existing agent configuration.
Only the fields present in the request body are updated; all other fields keep their current values.
Args:
agent_id (str): The agent to update.
body (UpdateAgentRequest): Fields to update.
user_id (str): Injected authenticated user ID.
storage (StorageBase): Injected storage backend.
Returns:
AgentRecord: The full agent record after the update.
Raises:
HTTPException: 404 if the agent does not exist or does not belong
to the authenticated user.
PATCH
/
agent
/
{agent_id}
Update an agent
curl --request PATCH \
--url https://api.example.com/agent/{agent_id} \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"name": "<string>",
"system_prompt": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": false
}
}
'import requests
url = "https://api.example.com/agent/{agent_id}"
payload = {
"name": "<string>",
"system_prompt": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work
# Task Overview
{task_overview}
# Current State
{current_state}
# Important Discoveries
{important_discoveries}
# Next Steps
{next_steps}
# Context to Preserve
{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": False
}
}
headers = {
"x-user-id": "<x-user-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-user-id': '<x-user-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
system_prompt: '<string>',
context_config: {
trigger_ratio: 0.8,
reserve_ratio: 0.1,
compression_prompt: '<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>',
summary_template: '<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>',
summary_schema: {},
tool_result_limit: 3000
},
react_config: {max_iters: 20, stop_on_reject: false}
})
};
fetch('https://api.example.com/agent/{agent_id}', 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.example.com/agent/{agent_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'system_prompt' => '<string>',
'context_config' => [
'trigger_ratio' => 0.8,
'reserve_ratio' => 0.1,
'compression_prompt' => '<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>',
'summary_template' => '<system-info>Here is a summary of your previous work
# Task Overview
{task_overview}
# Current State
{current_state}
# Important Discoveries
{important_discoveries}
# Next Steps
{next_steps}
# Context to Preserve
{context_to_preserve}</system-info>',
'summary_schema' => [
],
'tool_result_limit' => 3000
],
'react_config' => [
'max_iters' => 20,
'stop_on_reject' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-user-id: <x-user-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent/{agent_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/agent/{agent_id}")
.header("x-user-id", "<x-user-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-user-id"] = '<x-user-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"system_prompt\": \"<string>\",\n \"context_config\": {\n \"trigger_ratio\": 0.8,\n \"reserve_ratio\": 0.1,\n \"compression_prompt\": \"<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>\",\n \"summary_template\": \"<system-info>Here is a summary of your previous work\\n# Task Overview\\n{task_overview}\\n\\n# Current State\\n{current_state}\\n\\n# Important Discoveries\\n{important_discoveries}\\n\\n# Next Steps\\n{next_steps}\\n\\n# Context to Preserve\\n{context_to_preserve}</system-info>\",\n \"summary_schema\": {},\n \"tool_result_limit\": 3000\n },\n \"react_config\": {\n \"max_iters\": 20,\n \"stop_on_reject\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"user_id": "<string>",
"data": {
"name": "<string>",
"context_config": {
"trigger_ratio": 0.8,
"reserve_ratio": 0.1,
"compression_prompt": "<system-hint>You have been working on the task described above but have not yet completed it. Now write a continuation summary that will allow you to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable.</system-hint>",
"summary_template": "<system-info>Here is a summary of your previous work\n# Task Overview\n{task_overview}\n\n# Current State\n{current_state}\n\n# Important Discoveries\n{important_discoveries}\n\n# Next Steps\n{next_steps}\n\n# Context to Preserve\n{context_to_preserve}</system-info>",
"summary_schema": {},
"tool_result_limit": 3000
},
"react_config": {
"max_iters": 20,
"stop_on_reject": false
},
"id": "<string>",
"system_prompt": "You're a helpful assistant."
},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"source": "user"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.
Path Parameters
Body
application/json
Request body for partially updating an agent.
Omit any field to keep its current value.
Response
Successful Response
⌘I