Skip to main content

Wire types

beam_types defines the JSON that crosses process boundaries: API to worker, worker to stream, and client to API. Fields marked optional are left out of the JSON when empty, and empty metadata objects are omitted. The repository's tests/wire_compat fixtures lock these shapes.

InvokeRequest​

API → worker, and the body of the invoke_agent task.

{
"agent_name": "kb-assistant",
"content": [{"type": "text", "text": "what is riverbeam?"}],
"session_id": "5f8915eb-31eb-4f8a-9517-e2c15ce7bc41",
"metadata": {"source": "web"},
"request_id": "16d12ddc-651a-431d-997c-a756d5793ebf",
"stream": true
}
FieldTypeRequiredMeaning
agent_namestringyesRegistered agent to run
contentContentPart[]yesThe user turn
session_idUUIDyesConversation id; a new id starts a session
model_overridestringModel name to use instead of routing
metadataobjectFree-form; see the keys below
interaction_idUUIDRequired to resume; generated otherwise
request_idUUIDRequired for streaming; names the stream channel
streamboolPublish frames (default false)
actionsActionResponseEnvelope[]Makes this a resume turn
auth_contextInvokeAuthContextWho is calling

Metadata keys Riverbeam reads:

KeyRead byEffect
memory_scopesPipeline[{"name", "id"}] layers to load into the context
capabilitiesCapabilityStrategyCapabilities the model must have
confirmRigAgentRunnertrue skips approval for confirm_required tools
sandbox_root, protected_refsSandbox tools with no bound treeWorking directory and protected refs

memory_scopes, confirm, sandbox_root and protected_refs change what a run can read or do. Strip them from client requests and set them in your API when you need them.

The API commands take InvokePayload (no request_id, interaction_id or actions; they are filled in) and ResumePayload (adds the required interaction_id and actions).

InvokeAuthContext​

FieldMeaning
user_idSubject for authorization, usage and audit
profile_idStored on the session
org_idOrganization; also accepted as organization_id
mcp_tokenNot used by Riverbeam; agents can read it from input.auth_context

ContentPart​

{"type": "text", "text": "hello"}
FieldMeaning
typetext, image_url, image_base64, audio, file, video, media_ref, reasoning
textText for text and reasoning
urlFor image_url and similar
dataInline (base64) data
mime_typeDecides the modality of file and media_ref parts
media_idUUID of stored media
metadataFree-form

Each part has a modality: text, image, audio or video. text and reasoning are text; file and media_ref follow their mime_type prefix (image/, audio/, video/), defaulting to text.

AgentResult​

Worker → API. The result of invoke, and the result of the final stream frame.

{
"content": [{"type": "text", "text": "Echo: what is riverbeam?"}],
"agent_name": "kb-assistant",
"model_used": "gpt-4o-mini",
"session_id": "5f8915eb-31eb-4f8a-9517-e2c15ce7bc41",
"request_id": "16d12ddc-651a-431d-997c-a756d5793ebf",
"interaction_id": "40744652-2720-4b10-86ee-7333c1be8165",
"token_usage": {"prompt_tokens": 4, "completion_tokens": 4, "total_tokens": 8},
"latency_ms": 0.0,
"interrupted": false
}
FieldMeaning
contentThe reply, as content parts
agent_name, model_usedWho answered, with which model
session_id, request_id, interaction_idCorrelation ids
token_usageprompt_tokens, completion_tokens, total_tokens
tool_callsToolCallRecord[]: tool_name, args, tool_call_id, result, latency_ms
metadataFree-form
latency_msAgent latency
interruptedtrue when the agent is waiting for approval
action_requiredThe approvals it is waiting for; see Human approval

StreamChunk​

Worker → stream subscribers.

{
"type": "done",
"result": {
"content": [{"type": "text", "text": "Echo: what is riverbeam?"}],
"agent_name": "kb-assistant",
"interrupted": false
},
"agent_name": "kb-assistant",
"session_id": "5f8915eb-31eb-4f8a-9517-e2c15ce7bc41",
"run_id": "c36c753f-b90d-4834-9112-e12a343f6a0d"
}
FieldMeaning
typechunk, done, error, placeholder, thinking, tool
dataAn AgentMessage for chunk, thinking, placeholder and tool frames
resultThe AgentResult, on done
errorThe message, on error
agent_name, agent_id, session_id, interaction_id, run_id, step_id, message_idCorrelation ids
id, timestampOptional frame id and time

AgentMessage has a role (system, human, ai, tool), a type (message, tool_result, action, action_result, step), content, an id, a timestamp, the correlation ids, tool fields (tool_call_id, tool_name, tool_args, tool_result, tool_calls), is_delta, and a phase (final or thinking).

ActionResponseEnvelope​

Client → API, inside actions when resuming.

{
"action_id": "9c1b2d3e-4f50-4a61-8273-849506172839",
"kind": "confirmation",
"request_id": "2b7c4d5e-6f70-4a81-9293-a4b5c6d7e8f9",
"status": "submitted",
"payload": {"approved": true},
"responder_id": "u1",
"responded_at": "2026-06-09T09:46:01.566411Z"
}
FieldRequiredMeaning
action_idyesThe pending action's UUID, from action_required
kindyesThe action kind, such as confirmation
request_idyesId of this response
statussubmitted (default), cancelled, expired, invalid
payloadThe response; RigAgentRunner reads tool and args from it
errorsValidation messages
responder_idWho answered
responded_atDefaults to now
lc_action_idAn external action id, passed through

ModelConfig​

Used by the router and the model list file.

FieldDefaultMeaning
namerequiredUnique model name
providerrequiredopenai, anthropic, custom, ollama, groq, nvidia
modalities[text]Input modalities
capabilities[]Free-form capability names
cost_per_1k_tokens0.0Used to prefer cheaper models
max_tokens4096Context budget for memory trimming
api_keynoneAvoid; load keys from the environment
provider_config, extranullFree-form JSON