Agent OrchestrationEXECUTION WORLD · THE RUNTIME LOOP

Stateless models.
Stateful, governed work.

The orchestration core is a stateful agent runtime that turns stateless LLM calls into durable, credential-aware, auditable work — chat assistants, one-shot functional agents, and state-machine workflows behind one API.

Read the docs
THE PROBLEM

An LLM can decide what to do. It can't survive doing it.

An LLM cannot hold OAuth tokens, live through a restart mid-task, retry a flaky API with backoff, or pause three days for a human approval. The orchestration core owns that execution substrate: the LLM stays stateless while the system persists state, resolves credentials at runtime, executes multi-step plans, and records every action.

Agent rooms

Every conversation is a room binding an assistant, a platform (UI, Slack, Teams, API, workflow), and an external user. A per-room process serializes in-flight requests — duplicate concurrent messages can't race.

The agentic loop

Each turn: build context → get a structured plan plus a conclusion (respond, clarify, or reevaluate) → execute → loop if warranted. Bounded iterations, progress detection, and forced response generation guarantee termination.

Loop detection

Repeated identical tool calls (hash-compared arguments), consecutive errors, or repeated error types abort the loop — runaway agents are a failure mode the runtime refuses.

Dynamic tool discovery

No pre-registered tool list. Agents find capabilities through SKB's semantic search; low-confidence matches trigger a clarifying question rather than a guess, and confirmations boost future matching.

Credential-aware execution

Two credential layers, kept apart: the login that gets an agent into your Interactor account, and the OAuth tokens that let it act inside a connected third-party app. The prompt includes connected services, capability signatures with return-type hints, and expired third-party credentials flagged for re-auth — so the model plans in one pass. At execution, tokens resolve per call, auto-refresh, and never enter conversation data.

Multi-agent delegation

A primary delegates to specialists spawned in ephemeral rooms with their own tools. Hard limits govern chain depth, concurrency, timeouts, and circularity; credential inheritance is all, scoped least-privilege, or none.

Workflow state machine

Long-running processes as directed state machines: states process, transitions route, conditions decide. Instances snapshot their definition at creation, persist at every transition, and fork parallel threads with join semantics.

Halt / resume — humans in the loop

A halting state persists everything — data, thread state, choices, encrypted credential references — and waits. Approvals survive restarts and deploys; duplicate resumes are no-ops.

Provider abstraction

One adapter layer normalizes structured output across OpenAI, Anthropic, Google, and text-parsing fallback. A model registry treats every model as a versioned row behind one inference interface — swapping providers is configuration, with latency, tokens, and cost logged per call.

Prompt & memory merge

Profiles merge account → context → user into every system prompt. Memory is four-tiered: structured state, a verbatim recent window, a compressed running summary, and pgvector episodic memory retrieved by similarity.

HOW A TURN RUNS

From message to governed execution.

ONE CONVERSATIONAL TURN

01

Serializethe message hits the room; the per-room process dedupes concurrent requests.

02

Assembleprofiles, history, persistent state, retrieved memories, the credential summary, and capability signatures build the context.

03

Planthe LLM returns a structured plan plus a conclusion, validated against schema.

04

Executesequential by default; parallel groups where dependency analysis proves independence. Credentials resolve per action.

05

Delegatespecialists spawn with scoped credentials; structured results and action logs flow back into plan variables.

06

Concluderespond, clarify, or reevaluate — bounded. Tokens stream over SSE; HMAC-signed webhooks fire with retries.

07

Rememberhistory updates, memories embed, executions feed UKB's detection and SKB's reliability scores.

API SURFACE

Assistants, rooms, workflows — one API.

POST/agentsCreate an assistant — model config, tools, prompt
POST/agents/:assistant_id/roomsCreate a conversation room
POST/agents/rooms/:room_id/messagesSend a message (async; response via SSE)
GET/agents/rooms/:room_id/streamSSE stream of status, tokens, and events
POST/agents/:assistant_id/executeOne-shot functional agent execution
GET/profiles/effective/:user_idThe merged account → context → user profile
POST/workflowsDefine a workflow (static validation: reachability, dangling transitions)
POST/workflows/:id/instancesStart an instance — idempotent via client_ref
GET/workflows/instances/:id/historyFull step-level audit history
POST/workflows/instances/:id/threads/:tid/resumeResume a halted thread with a transition key
GUARANTEES

Deterministic execution over non-deterministic models.

Structured, validated plansschema-validated output with guided retry on parse failure; bounded reevaluation; every action recorded.

Classified retriestransient errors retry with exponential backoff and jitter, honoring Retry-After; permanent and security errors never retry; per-action retry policies and declared fallbacks.

Idempotency throughoutclient_ref instance dedupe, idempotent resume, request IDs on non-idempotent HTTP steps, crash recovery that checks completion markers before re-running side-effecting steps.

Durabilitystate persists at every transition; halted workflows and crashed instances recover on restart.

Tenant isolationaccount-scoped data, per-account credential encryption, opaque external user IDs — end-user PII stays in your app.

Credential hygienevalues resolved at call time, never persisted into workflow or chat data, discarded after use, every access audited.

IN PRACTICE

Real work, with receipts.

THE DELEGATING SUPPORT AGENT

Checks an order, hands the refund to a billing specialist carrying scoped credentials only, posts to Slack and updates the ticket in a parallel group — streamed token-by-token.

THE APPROVAL THAT SURVIVED THE WEEKEND

An order workflow charges the processor, halts at awaiting_approval for large orders, survives two days and a deploy, and resumes when a manager clicks approve.

THE BATCH WORKER

A functional agent categorizes tickets with no conversation at all — structured results with confidence and token usage.

MEMORY ACROSS ROOMS

"Prefer LinkedIn over email outreach," said once, is retrieved by similarity in a different room weeks later.

THE MODEL SWAP

A task moves to a different LLM provider by editing a registry row. Same structured-output contract. Zero code change.

You set the goal. It does the work. Nothing runs without your say-so.

Thousands of isolated, crash-recoverable agent sessions per node — the OTP concurrency story, applied to agents that answer to you.