The Agent RSI & Self-Tuning API powers two related self-improvement subsystems that run as background jobs with Server-Sent Events (SSE) progress streaming. Use these endpoints to start RSI (Recursive Self-Improvement) review passes and self-tuning runs against a session, then subscribe to the returned job’s stream endpoint for live progress events.
RSI (Recursive Self-Improvement)
Section titled “RSI (Recursive Self-Improvement)”The RSI subsystem runs a “Reviewer-Selected-Improvement” pass over a session transcript. Each configured reviewer model reads the transcript and emits findings. Start a review to receive a jobID, then stream that job for progress.
Start an RSI review
Section titled “Start an RSI review”POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/review
Fan out a Reviewer-Selected-Improvement pass: each configured reviewer model reads the session transcript and emits findings. Returns a queued jobID; subscribe to /rsi/runs/{jobID}/stream for progress and final output.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspaceID | path | string | Yes | Workspace identifier. |
sessionID | path | string | Yes | Session identifier. |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
focus | string | No | Optional focus instructions appended to each reviewer prompt. Max 10K chars. |
reviewers | array | No | Reviewers to run for this call. Each entry is either a string (filter by name into config) or an inline object that overrides config fields per-call. Omit to use all configured reviewers. Max 20 entries. |
When reviewers entries are inline objects, each accepts name (required, 1-64 chars), model (optional, providerID/modelID format), fallbacks (optional, up to 5 fallback models tried in order), and prompt (optional, overrides the configured prompt for this call only).
Example
Section titled “Example”curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/rsi/review" \ -H "Authorization: Bearer $HOODY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "focus": "Focus on tool-call efficiency and final-answer correctness.", "reviewers": [ "accuracy", { "name": "clarity", "prompt": "Be terse; max 200 words per finding." } ] }'const { jobID, sessionID, status } = await client.agent.rsi.rsiReviewStart({ workspaceID: "ws_alpha", sessionID: "sess_42", data: { focus: "Focus on tool-call efficiency and final-answer correctness.", reviewers: [ "accuracy", { name: "clarity", prompt: "Be terse; max 200 words per finding." } ] }});{ "jobID": "rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ", "sessionID": "sess_42", "status": "queued"}{ "error": "RSI reviews are disabled for this workspace."}{ "error": "Rate limit exceeded; retry later.", "retryAfterMs": 30000}Stream RSI review progress
Section titled “Stream RSI review progress”GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/rsi/runs/{jobID}/stream
Server-sent-events stream of progress events for an RSI review job. Emits a snapshot first (so late subscribers see current state), then live events; if the job is already terminal, emits the completion event and closes.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspaceID | path | string | Yes | Workspace identifier. |
sessionID | path | string | Yes | Session identifier. |
jobID | path | string | Yes | Job identifier returned from the start endpoint. |
Example
Section titled “Example”curl -N "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/rsi/runs/rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ/stream" \ -H "Authorization: Bearer $HOODY_API_KEY" \ -H "Accept: text/event-stream"const stream = await client.agent.rsi.rsiStream({ workspaceID: "ws_alpha", sessionID: "sess_42", jobID: "rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ"});
for await (const event of stream) { console.log(event.event, event.data);}event: snapshotdata: {"jobID":"rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ","status":"running","completedReviewers":1,"totalReviewers":3}
event: reviewer.progressdata: {"reviewer":"accuracy","status":"done","findings":4}
event: donedata: {"jobID":"rsi_01HQZ9X7K4G3D7M5B6V2R8NJTQ","status":"succeeded","totalFindings":11}Self-Tuning
Section titled “Self-Tuning”The self-tuning subsystem runs verifier-driven improvement loops on a session. Two modes are available:
tune— single iterative loop, capped at 20 iterations.amplify— best-of-N loop with majority voting (N must be odd, max 11).
Both return a jobID; stream that job’s progress via /self-tuning/runs/{jobID}/stream.
Start a self-tuning tune run
Section titled “Start a self-tuning tune run”POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/tune
Run a single-iteration self-tuning loop against the session’s verifier. Returns a queued jobID; subscribe to /self-tuning/runs/{jobID}/stream for progress and final output.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspaceID | path | string | Yes | Workspace identifier. |
sessionID | path | string | Yes | Session identifier. |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
task | string | Yes | The task / goal description for the tune run. Max 100K chars. |
verifier_name | string | Yes | Name of a configured verifier program. Max 128 chars. |
max_iterations | integer | No | Cap on iteration count (1-20). |
model | object | No | Override the worker LLM for this call only. Requires providerID and modelID; both must already be configured or registered via PATCH /config beforehand. |
Example
Section titled “Example”curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/tune" \ -H "Authorization: Bearer $HOODY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "task": "Reduce average tool-call latency below 1.2s while preserving task success rate.", "verifier_name": "perf_v1", "max_iterations": 8, "model": { "providerID": "openai", "modelID": "gpt-4o-mini" } }'const { jobID, sessionID, status } = await client.agent.selfTuning.selfTuningTuneStart({ workspaceID: "ws_alpha", sessionID: "sess_42", data: { task: "Reduce average tool-call latency below 1.2s while preserving task success rate.", verifier_name: "perf_v1", max_iterations: 8, model: { providerID: "openai", modelID: "gpt-4o-mini" } }});{ "jobID": "tune_01HQZA3K8N5F2P4Q7M9B6V3WYX", "sessionID": "sess_42", "status": "queued"}{ "error": "Self-tuning is not enabled for this workspace."}{ "error": "Rate limit exceeded; retry later.", "retryAfterMs": 60000}Start a self-tuning amplify run
Section titled “Start a self-tuning amplify run”POST /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/amplify
Run a best-of-N amplify loop against the session’s verifier (N must be odd, max 11, for majority voting). Returns a queued jobID; subscribe to /self-tuning/runs/{jobID}/stream for progress.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspaceID | path | string | Yes | Workspace identifier. |
sessionID | path | string | Yes | Session identifier. |
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
task | string | Yes | The task / goal description for the amplify run. Max 100K chars. |
verifier_name | string | Yes | Name of a configured verifier program. Max 128 chars. |
n | integer | Yes | Number of trials (odd, max 11) for majority voting. |
model | object | No | Override the worker LLM for this call only. Requires providerID and modelID; both must already be configured or registered via PATCH /config beforehand. |
Example
Section titled “Example”curl -X POST "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/amplify" \ -H "Authorization: Bearer $HOODY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "task": "Generate a SQL query that lists the top 10 customers by lifetime spend.", "verifier_name": "sql_v1", "n": 5, "model": { "providerID": "anthropic", "modelID": "claude-3-5-sonnet" } }'const { jobID, sessionID, status } = await client.agent.selfTuning.selfTuningAmplifyStart({ workspaceID: "ws_alpha", sessionID: "sess_42", data: { task: "Generate a SQL query that lists the top 10 customers by lifetime spend.", verifier_name: "sql_v1", n: 5, model: { providerID: "anthropic", modelID: "claude-3-5-sonnet" } }});{ "jobID": "amp_01HQZB5M2P7H4R6T9K1C8X4ZGB", "sessionID": "sess_42", "status": "queued"}Stream self-tuning run progress
Section titled “Stream self-tuning run progress”GET /api/v1/workspaces/{workspaceID}/sessions/{sessionID}/self-tuning/runs/{jobID}/stream
Server-sent-events stream of progress events for a self-tuning tune or amplify job. Emits a snapshot first (so late subscribers see current state), then live events; if the job is already terminal, emits the completion event and closes.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
workspaceID | path | string | Yes | Workspace identifier. |
sessionID | path | string | Yes | Session identifier. |
jobID | path | string | Yes | Job identifier returned from the tune or amplify start endpoint. |
Example
Section titled “Example”curl -N "https://api.hoody.com/api/v1/workspaces/ws_alpha/sessions/sess_42/self-tuning/runs/tune_01HQZA3K8N5F2P4Q7M9B6V3WYX/stream" \ -H "Authorization: Bearer $HOODY_API_KEY" \ -H "Accept: text/event-stream"const stream = await client.agent.selfTuning.selfTuningStream({ workspaceID: "ws_alpha", sessionID: "sess_42", jobID: "tune_01HQZA3K8N5F2P4Q7M9B6V3WYX"});
for await (const event of stream) { console.log(event.event, event.data);}event: snapshotdata: {"jobID":"tune_01HQZA3K8N5F2P4Q7M9B6V3WYX","status":"running","iteration":3,"maxIterations":8}
event: iteration.donedata: {"iteration":3,"verifierScore":0.82,"bestSoFar":true}
event: donedata: {"jobID":"tune_01HQZA3K8N5F2P4Q7M9B6V3WYX","status":"succeeded","bestScore":0.91}