Skip to content

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

ServiceRPCKindPurpose
RalphOrchestratorServiceExecuteLoopServer streamingRun 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_PRECONDITION if agent_id names 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 see UNKNOWN), in these cases:
    • user_command trips 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_FAILED message 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:

  1. LOOP_STATUS_WORKING: the model is producing a thought. current_thought is set.
  2. LOOP_STATUS_EXECUTING: the agent chose a tool. action_attempted is set.
  3. LOOP_STATUS_OBSERVING: the tool answered. observation_result carries its output.

The stream ends with exactly one terminal message:

StatusMeaning
LOOP_STATUS_DONEThe 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_REACHEDThe loop used max_iterations turns without finishing.
LOOP_STATUS_FAILEDThe 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:

ToolAccess tierRoles allowed
read_fileReadReader, Writer, Org admin, Service account
run_sqlWriteWriter, Org admin
delegate_to_claimsInvokeWriter, 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_sql runs against the connection named by parameters["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_file is limited to the agent’s permitted location. Results are truncated at 2 KB.
  • delegate_to_claims hands a sub-task to the claims agent.

An unknown tool name returns a “not registered” observation.

Request: ExecuteLoopRequest

FieldTypeDescription
thread_idstringExecution thread id. Set it to make the run resumable and to follow it in ActivityService. Empty generates a one-off run id.
agent_idstringThe agent to run. See Agents.
user_commandstringThe user’s instruction. It is checked for prompt injection and against the agent’s guardrail rules before the loop starts.
context_payloadstringContext for the command, such as extracted data. It is placed in the opening message after the prefix Context: .
context_imagesrepeated ImagePartImages that belong to context_payload, positioned by byte offset into it. The server shifts each offset to account for the Context: prefix.
max_iterationsint32Ceiling on model turns. 0 or negative means 5.
parametersmap<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.

FieldTypeDescription
statusLoopStatusState of the loop at this step.
current_thoughtstringThe agent’s reasoning, or on failure a sentence saying what stopped the run.
action_attemptedstringThe tool the agent chose, if any.
observation_resultstringThe tool’s output, or its refusal.
final_result_jsonstringThe final answer as JSON. Set only when status is LOOP_STATUS_DONE.
iterationint32The turn this message belongs to, from 1.
judgementsrunink.ui.judgement.v1.JudgementSetOn 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_idGuardrail rule set
twins, route_twinTwinsService
claimsClaimsService
fulfilmentFulfilmentService
hypothesisHypothesisService
ai_posturePostureService
rules_reconRulesService
predictive_maintenancePredictiveMaintenanceService
reverse_logisticsReverseLogisticsService
complianceComplianceService
financeFinanceService
telemetryTelemetryService
documentationDocumentationService
voiceVoiceService
visionVisionService
copCopService
self_healingSelfHealingService

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.

FieldTypeDescription
databytesThe raw image. Not base64.
mime_typestringIANA media type, for example image/jpeg or image/png. Empty means image/jpeg.
text_offsetuint32Byte 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

ValueMeaning
LOOP_STATUS_UNSPECIFIEDNot set.
LOOP_STATUS_WORKINGGenerating a thought.
LOOP_STATUS_EXECUTINGRunning a tool or action.
LOOP_STATUS_OBSERVINGEvaluating a tool’s observation.
LOOP_STATUS_DONEFinal result generated.
LOOP_STATUS_FAILEDUnrecoverable loop error.
LOOP_STATUS_MAX_REACHEDStopped at max_iterations.