Skip to content
DocsStar33Playground

How Reactive Agents fits together

ExplanationLast updated 2026-12-04 · 99b8f5257Quickstart

Reactive Agents is an open-source TypeScript framework for building agents, built on a controllable, observable harness that runs reliably on local models and frontier APIs. This page is the one place its terms are defined. Other pages link here the first time they use a term; the glossary lists every term in one line.

How Reactive Agents fits togetherNested boxes. The builder builds an agent; the agent runs a task as a run. The run contains the runtime, the runtime contains the harness, the harness contains the strategy, the strategy contains passes, and a pass is the kernel loop repeating iterations until the exit gate. Observability spans all of it.BuilderAgentTaskbuildsrunsas a runRunone execution of a task, ending in one outcomeRuntimetakes the run through its 12 lifecycle phasesHarnesseverything that governs the model's work in a runStrategyhow many passes, in what shapePassone execution of the kernel loopiterationiterationexit gateKernel: the one reasoning loopIteration: one model turnNext passone per plan step under plan-execute-reflectContextassembly, compaction, tool surfaceGuards and gatesguards, approval gate, exit gateReactive Intelligencewatches signals and intervenesVerificationwith judgment and groundingObservability spans all of itevents, traces, receipts, rax diagnoseHow Reactive Agents fits togetherNested boxes. The builder builds an agent; the agent runs a task as a run. The run contains the runtime, the runtime contains the harness, the harness contains the strategy, the strategy contains passes, and a pass is the kernel loop repeating iterations until the exit gate. Observability spans all of it.BuilderAgentTaskbuildsrunsas a runRunone execution of a task, one outcomeRuntimethe run's 12 lifecycle phasesHarnessgoverns the model's work in a runStrategyhow many passes, in what shapePassone execution of the kernel loopiterationiterationexit gateKernel: the one reasoning loopIteration: one model turnNext passone per plan step underplan-execute-reflectContextassembly, compaction, tool surfaceGuards and gatesguards, approval gate, exit gateReactive Intelligencewatches signals and intervenesVerificationwith judgment and groundingObservability spans all of itevents, traces, receipts, rax diagnose
What contains what. The builder makes an agent; a run of a task is taken through its lifecycle by the runtime, which hosts the harness. Inside the harness a strategy runs one or more passes of the kernel loop.
Text version

From the outside in:

  • Builder: builds an agent.
  • Agent: runs a task as a run.
  • Run: one execution of a task, ending in one outcome. It contains:
    • Runtime: takes the run through its 12 lifecycle phases and hosts the harness.
      • Harness: everything that governs the model's work in a run. It contains:
        • Strategy: decides how many passes run and in what shape.
          • Pass: one execution of the kernel loop. The plan-execute-reflect strategy runs one pass per plan step.
            • Kernel: the one reasoning loop. It repeats iterations.
            • Iteration: one model turn.
            • Exit gate: ends the pass.
        • Context: assembly, compaction, tool surface.
        • Guards and gates: guards, approval gate, exit gate.
        • Reactive Intelligence: watches signals and intervenes.
        • Verification: with judgment and grounding.
  • Observability spans all of it: events, traces, receipts, rax diagnose.

A chat works the same way: a session is a sequence of turns, and a turn may contain a run. Cortex (the local studio) and rax (the CLI) sit outside this picture.

Read it from the outside in. You configure an agent with the builder. The agent runs a task as a run. The runtime takes each run through its lifecycle, and inside that lifecycle the harness governs what the model does: which strategy, how the kernel loops, what context and tools the model sees, which checks can stop it, and when the run is done.

These eight terms are the ones most often mixed up. Each line is a short definition; the sections below give the full one.

  • Lifecycle phase is one of the 12 steps the runtime takes every run through: bootstrap, guardrail, cost-route, strategy-select, think, act, observe, verify, memory-flush, cost-track, audit, complete. Hooks attach to these. Only these are phases. See lifecycle phase.
  • Kernel capability is one of the ten things an iteration is built from: sense, comprehend, attend, recall, reason, decide, act, verify, reflect, learn. The kernel’s act and verify are capabilities, not the lifecycle phases with the same names. See kernel capability.
  • Kernel step is the contract for one iteration: state in, state out. See kernel step.
  • Guard is a check inside the kernel that blocks or redirects one action on one iteration. See guard.
  • Gate is a decision point that holds a run until a condition is met. There are two public gates: the approval gate (a person approves a risky action) and the exit gate (decides that a pass is done). See gate.
  • Guardrails are user-facing safety checks on inputs and outputs (prompt injection, PII, toxicity), set with .withGuardrails(). They are not kernel guards. See guardrails.
  • Run > pass > iteration. A run has one or more passes. A pass is one execution of the kernel loop. An iteration is one model call. Limits such as maxIterations count iterations across all passes. See run, pass and iteration.
  • Chat turn is one user message and the agent’s reply in a chat session. A turn may contain a run. See session and turn.

The open-source TypeScript framework for building agents (reactive-agents, @reactive-agents/*). Its core is the harness. The harness is part of the framework, not the product’s name.

The typed, chainable configuration API that produces an agent: ReactiveAgents.create() returns a ReactiveAgentBuilder, and .withTools(), .withPersona() and the other .with*() methods configure it. See the Builder API reference.

A built, runnable instance (ReactiveAgent). It runs tasks and chats.

The layer that executes agents (@reactive-agents/runtime, ExecutionEngine, ChatEngine): services, layers and the run lifecycle. The runtime hosts the harness; it is not the harness.

What the agent is asked to do.

One execution of a task, from start to its terminal outcome (runId, RunHandle). A run has exactly one outcome: success, partial, failed or aborted.

A chat session (ChatEngine) is a sequence of turns. A turn is one user message and the agent’s reply; a turn may contain a run. See Chat and sessions.

One execution of the kernel loop inside a run. A ReAct run has one pass; plan-execute runs one pass per plan step.

One model turn inside a pass: the model thinks, then the harness acts on the result. Limits such as maxIterations count iterations summed across all passes of a run.

The recorded observation of what happened in an iteration (ReasoningStep: thought, action, observation). A step in a plan is a plan step, which is a different thing.

One of the 12 ordered phases the runtime takes a run through (LifecyclePhase): bootstrap, guardrail, cost-route, strategy-select, think, act, observe, verify, memory-flush, cost-track, audit, complete. Lifecycle hooks attach to these phases. The details are in Agent lifecycle.

The think, act, observe and verify lifecycle phases are the hook points around the kernel’s iterations. The kernel’s act and verify capabilities are the code that runs inside them. When both appear on one page, “the act phase” means the lifecycle hook point and “the act capability” means the kernel code.

Everything that governs the model’s work inside a run: the strategy, the kernel, context, the tool surface, guards and gates, Reactive Intelligence and verification. You configure it with .withHarness() and the domain methods (.withReasoning(), .withTools(), .withVerification(), …). The harness is not the whole framework, and it does not include the provider clients, which ship standalone. See the harness control surface.

The pipeline (HarnessPipeline) that lets you observe and adjust harness behavior at named points, called tags. Harness hooks are a way into the harness, not the harness itself. See the harness tag reference.

The one reasoning loop every looping strategy runs on (reactKernel, KernelState). It repeats iterations until the exit gate ends the pass. There is one kernel; strategies configure it. See Composable kernel.

The contract for one iteration: state in, state out (ThoughtKernel). A custom kernel implements this contract. A kernel step is assembled from kernel step functions.

The function type for one pluggable piece of a kernel step. makeKernel() takes a list of them; the default list is think, then act.

One of the ten things an iteration is built from: sense, comprehend, attend, recall, reason, decide, act, verify, reflect, learn (kernel/capabilities/* in the source). Kernel capabilities are not lifecycle phases.

The policy over the kernel: how many passes and in what shape (ReasoningStrategy, StrategyRegistry). The built-in strategies are reactive (ReAct), plan-execute-reflect, reflexion, tree-of-thought, adaptive (routes among the others), blueprint, code-action and direct (a single model call with no kernel loop). The looping strategies do not each have their own loop; they configure the same kernel. See Reasoning strategies.

Per-model-tier defaults for context and tools (ContextProfile): local, mid, large, frontier. See Context engineering.

Building the prompt for one iteration from the run’s state. It decides what history, references and open requirements the model sees.

Shrinking older history when the context window fills, leaving digests in its place.

The tools offered to the model on one iteration.

How the permitted tools are presented to the model: .withTools({ disclosure }) takes "auto", "all" or "discover". The default depends on the model tier: "auto" on local and mid models, "discover" on large and frontier models. Disclosure never changes which tools may run. See Scoping and policy.

The part of the harness that sizes the tool surface to schemaBudget, the token budget for tool schemas on one iteration.

Built-in tools do work (file-read, web-search, …). Meta tools steer the run itself (final-answer, todo, recall, …). See Built-in tools.

A check inside the kernel that can block or redirect an action on one iteration, such as a duplicate tool call, a loop or a tool policy violation.

A decision point that can stop a run from progressing until a condition holds. There are two public gates: the approval gate and the exit gate.

Waits for a person to approve a risky action before it runs. See Human-in-the-loop approval.

The single place that decides a pass is done and with what outcome. It reads open work, evidence and verification. When it refuses an answer, the run continues on what is still outstanding; the ExitGateDecision event records why (see Streaming).

Open work is any of: a contract item; an open todo row; a requested change no tool has made yet; an owed action call that failed and never succeeded later; an owed call that an answer turn made and the harness refused. A call is owed when the turn asks for a change, or when it repeats a declared write the run already made. While work is open, the exit gate keeps the tools and names the open items to the model. Todo rows and changes inferred from prose only advise: they never deny the model’s own answer. A write counts as making a requested change only when it is the write for the thing asked for: a write of the same verb group on a different object does not close the request. Another write tool replaces a failed one only when it makes the same kind of change; tools with no recognizable verb group are never substitutes. A refused or failed owed call blocks success: the run ends partial (the draft plus an Unfinished: list) or failed, naming the call. Opt-in only (the adaptive harness, .withAdaptiveHarness()): when the owed tool failed twice with different arguments and the answer says plainly the action was not done, the gate stops demanding it. Without the adaptive harness, two failed attempts with different arguments still block. When an answer turn is spent on a call that was not owed (a read, for example), the gate asks once more for a plain-text reply.

Safety checks on inputs and outputs: prompt injection, PII, toxicity (GuardrailService, .withGuardrails()). Guardrails are not kernel guards. See Guardrails.

The resolved, read-only settings a run carries (RunEnvelope): rails such as the run posture, required tools and focused tools.

The run’s stance toward finishing (RunPosture). For example, under plan posture the plan’s rows are the deliverable.

The harness layer that watches signals during a run, such as entropy and progress, and intervenes: it can stop early, redirect the model or switch strategy (@reactive-agents/reactive-intelligence). Its decision-maker is the RI controller. Reactive Intelligence is on by default and experimental: its configuration and behavior may change between minor releases. See Reactive Intelligence.

Checks the final output before the exit gate accepts it. See Verification.

Pluggable judges (rule, LLM, local model) that verification and evals call (JudgmentService). See Judgment layer.

Whether a claimed result or action is backed by tool evidence from this run.

The typed stream every layer publishes (EventBus, AgentEvent). See Observability.

The recorded event log of one run, as JSONL. Traces are replayable; see Snapshot and replay.

A signed summary of what a run did and why it ended (TrustReceipt). See AgentResult and debrief.

The command that explains a recorded run: rax diagnose cause <run>. See the rax diagnose reference.

The local studio app for building, chatting with and inspecting agents. See Cortex Studio.

The command-line tool. See Rax CLI Overview.

Install

Bun (recommended)bun add reactive-agents
Node 22.5+npm install reactive-agents

Get notified on new releases

Release notes, about once a month.