How Reactive Agents fits together
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.
The picture
Section titled “The picture”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-reflectstrategy runs one pass per plan step.- Kernel: the one reasoning loop. It repeats iterations.
- Iteration: one model turn.
- Exit gate: ends the pass.
- Pass: one execution of the kernel loop. The
- Context: assembly, compaction, tool surface.
- Guards and gates: guards, approval gate, exit gate.
- Reactive Intelligence: watches signals and intervenes.
- Verification: with judgment and grounding.
- Strategy: decides how many passes run and in what shape.
- Harness: everything that governs the model's work in a run. It contains:
- Runtime: takes the run through its 12 lifecycle phases and hosts the harness.
- 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.
Terms that sound alike
Section titled “Terms that sound alike”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
actandverifyare 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
maxIterationscount 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.
Product and building
Section titled “Product and building”Reactive Agents
Section titled “Reactive Agents”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.
Builder
Section titled “Builder”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.
Runtime
Section titled “Runtime”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.
Units of work
Section titled “Units of work”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.
Session and turn
Section titled “Session and turn”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.
Iteration
Section titled “Iteration”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.
Runtime lifecycle
Section titled “Runtime lifecycle”Lifecycle phase
Section titled “Lifecycle phase”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.
The harness layer
Section titled “The harness layer”Harness
Section titled “Harness”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.
Harness hooks
Section titled “Harness hooks”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 kernel layer
Section titled “The kernel layer”Kernel
Section titled “Kernel”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.
Kernel step
Section titled “Kernel step”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.
Kernel step function
Section titled “Kernel step function”The function type for one pluggable piece of a kernel step. makeKernel() takes a list of them; the default list is think, then act.
Kernel capability
Section titled “Kernel capability”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 strategy layer
Section titled “The strategy layer”Strategy
Section titled “Strategy”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.
Context and tools
Section titled “Context and tools”Context profile
Section titled “Context profile”Per-model-tier defaults for context and tools (ContextProfile): local, mid, large, frontier. See Context engineering.
Context assembly
Section titled “Context assembly”Building the prompt for one iteration from the run’s state. It decides what history, references and open requirements the model sees.
Compaction
Section titled “Compaction”Shrinking older history when the context window fills, leaving digests in its place.
Tool surface
Section titled “Tool surface”The tools offered to the model on one iteration.
Tool disclosure
Section titled “Tool disclosure”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.
Tool schema allocator
Section titled “Tool schema allocator”The part of the harness that sizes the tool surface to schemaBudget, the token budget for tool schemas on one iteration.
Built-in tools and meta tools
Section titled “Built-in tools and meta tools”Built-in tools do work (file-read, web-search, …). Meta tools steer the run itself (final-answer, todo, recall, …). See Built-in tools.
Guards and gates
Section titled “Guards and gates”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.
Approval gate
Section titled “Approval gate”Waits for a person to approve a risky action before it runs. See Human-in-the-loop approval.
Exit gate
Section titled “Exit gate”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.
Guardrails
Section titled “Guardrails”Safety checks on inputs and outputs: prompt injection, PII, toxicity (GuardrailService, .withGuardrails()). Guardrails are not kernel guards. See Guardrails.
Run envelope
Section titled “Run envelope”The resolved, read-only settings a run carries (RunEnvelope): rails such as the run posture, required tools and focused tools.
Run posture
Section titled “Run posture”The run’s stance toward finishing (RunPosture). For example, under plan posture the plan’s rows are the deliverable.
Signals and intervention
Section titled “Signals and intervention”Reactive Intelligence
Section titled “Reactive Intelligence”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.
Quality
Section titled “Quality”Verification
Section titled “Verification”Checks the final output before the exit gate accepts it. See Verification.
Judgment
Section titled “Judgment”Pluggable judges (rule, LLM, local model) that verification and evals call (JudgmentService). See Judgment layer.
Grounding
Section titled “Grounding”Whether a claimed result or action is backed by tool evidence from this run.
Observability
Section titled “Observability”Events
Section titled “Events”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.
Receipt
Section titled “Receipt”A signed summary of what a run did and why it ended (TrustReceipt). See AgentResult and debrief.
rax diagnose
Section titled “rax diagnose”The command that explains a recorded run: rax diagnose cause <run>. See the rax diagnose reference.
Cortex
Section titled “Cortex”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-agentsNode 22.5+npm install reactive-agentsGet notified on new releases
Release notes, about once a month.