Agent orchestrator
RalphOrchestratorService runs one of FACE’s agents as a ReAct loop (thought, action,
observation) on the sovereign model plane and streams every step to the caller. The final
answer carries the platform’s judgement on each action the agent proposed. The cockpit’s twins
view and orchestrator console use this service.
Summary
| Service | RPC | Kind | Purpose |
|---|---|---|---|
| RalphOrchestratorService | ExecuteLoop | Server streaming | Run an agent loop and stream its steps and final answer |
RalphOrchestratorService
Full name semantics.v1.RalphOrchestratorService.
ExecuteLoop
rpc ExecuteLoop(ExecuteLoopRequest) returns (stream ExecuteLoopResponse);- Kind: Server streaming. Available over native gRPC and gRPC-web.
- Auth: Bearer session. Which tools the agent may use depends on the caller’s role. See Tool gate.
- Errors:
FAILED_PRECONDITIONifagent_idnames an agent that this build does not serve through the loop. The stream also ends with an error, without a gRPC status code of its own (clients seeUNKNOWN), in these cases:user_commandtrips the prompt-injection check;- the command violates the agent’s guardrail rules;
- no template exists for
agent_id; - a resumed thread cannot be loaded;
- the model plane fails mid-run. A
LOOP_STATUS_FAILEDmessage is sent first.
The server builds the opening prompt from context_payload and user_command, then runs up to
max_iterations model turns. Each turn streams one or more messages:
LOOP_STATUS_WORKING: the model is producing a thought.current_thoughtis set.LOOP_STATUS_EXECUTING: the agent chose a tool.action_attemptedis set.LOOP_STATUS_OBSERVING: the tool answered.observation_resultcarries its output.
The stream ends with exactly one terminal message:
| Status | Meaning |
|---|---|
LOOP_STATUS_DONE | The agent produced a final answer. final_result_json holds it, and judgements holds the verdicts on its proposed actions when judgement is enabled. |
LOOP_STATUS_MAX_REACHED | The loop used max_iterations turns without finishing. |
LOOP_STATUS_FAILED | The run could not continue, for example because the model plane was unreachable. current_thought says what happened. The RPC then returns an error. |
When judgement is enabled and a proposed action is dissented, the agent may revise its answer.
A revision runs within the same max_iterations budget, and the next final answer has a higher
Judgement.round.
Resuming. When thread_id is set, the run is recorded under that id and can be resumed:
calling ExecuteLoop again with the same thread_id continues from the recorded steps. If that
thread had already reached a final answer, the stream returns a single LOOP_STATUS_DONE
message with the recorded answer, without running the model again. The thread id also
identifies the run in ActivityService.
Tool gate
The agent chooses tools, but the server checks each tool call against the caller’s role before running it:
| Tool | Access tier | Roles allowed |
|---|---|---|
read_file | Read | Reader, Writer, Org admin, Service account |
run_sql | Write | Writer, Org admin |
delegate_to_claims | Invoke | Writer, Org admin |
Service-account sessions count as Readers for tool access. A refused tool call does not fail the
RPC. The refusal comes back to the agent as the tool’s observation (an error object in
observation_result), and the loop continues. The gate authorises the tool, not its arguments.
run_sqlruns against the connection named byparameters["connection_id"]. It is marked unavailable to the agent when no connection is given. Results returned to the agent are capped at 4 KB. See SQL for the read-only rules.read_fileis limited to the agent’s permitted location. Results are truncated at 2 KB.delegate_to_claimshands a sub-task to the claims agent.
An unknown tool name returns a “not registered” observation.
Request: ExecuteLoopRequest
| Field | Type | Description |
|---|---|---|
thread_id | string | Execution thread id. Set it to make the run resumable and to follow it in ActivityService. Empty generates a one-off run id. |
agent_id | string | The agent to run. See Agents. |
user_command | string | The user’s instruction. It is checked for prompt injection and against the agent’s guardrail rules before the loop starts. |
context_payload | string | Context for the command, such as extracted data. It is placed in the opening message after the prefix Context: . |
context_images | repeated ImagePart | Images that belong to context_payload, positioned by byte offset into it. The server shifts each offset to account for the Context: prefix. |
max_iterations | int32 | Ceiling on model turns. 0 or negative means 5. |
parameters | map<string, string> | Loop parameters. connection_id selects the data connection for run_sql. |
Response: ExecuteLoopResponse
One message per step. Fields that do not apply to a step are empty.
| Field | Type | Description |
|---|---|---|
status | LoopStatus | State of the loop at this step. |
current_thought | string | The agent’s reasoning, or on failure a sentence saying what stopped the run. |
action_attempted | string | The tool the agent chose, if any. |
observation_result | string | The tool’s output, or its refusal. |
final_result_json | string | The final answer as JSON. Set only when status is LOOP_STATUS_DONE. |
iteration | int32 | The turn this message belongs to, from 1. |
judgements | runink.ui.judgement.v1.JudgementSet | On the LOOP_STATUS_DONE message only: the verdict on every action the final answer proposed, accepted and rejected. Unset when judgement is off or the answer proposed no action. |
Agents
agent_id must be one of the agents this build serves through the loop. Each one is checked
against its own guardrail rule set:
agent_id | Guardrail rule set |
|---|---|
twins, route_twin | TwinsService |
claims | ClaimsService |
fulfilment | FulfilmentService |
hypothesis | HypothesisService |
ai_posture | PostureService |
rules_recon | RulesService |
predictive_maintenance | PredictiveMaintenanceService |
reverse_logistics | ReverseLogisticsService |
compliance | ComplianceService |
finance | FinanceService |
telemetry | TelemetryService |
documentation | DocumentationService |
voice | VoiceService |
vision | VisionService |
cop | CopService |
self_healing | SelfHealingService |
To see what a rule set checks before sending a command, use
MetasearchService/ListBiasRules and
EvaluateBias with the rule-set name.
Messages
ImagePart
Defined in face.proto.
| Field | Type | Description |
|---|---|---|
data | bytes | The raw image. Not base64. |
mime_type | string | IANA media type, for example image/jpeg or image/png. Empty means image/jpeg. |
text_offset | uint32 | Byte offset into the accompanying text at which the image sits. 0 means before all the text. Several images may share an offset; they are then shown in field order. An offset past the end of the text is clamped to the end. |
Enums
LoopStatus
| Value | Meaning |
|---|---|
LOOP_STATUS_UNSPECIFIED | Not set. |
LOOP_STATUS_WORKING | Generating a thought. |
LOOP_STATUS_EXECUTING | Running a tool or action. |
LOOP_STATUS_OBSERVING | Evaluating a tool’s observation. |
LOOP_STATUS_DONE | Final result generated. |
LOOP_STATUS_FAILED | Unrecoverable loop error. |
LOOP_STATUS_MAX_REACHED | Stopped at max_iterations. |