Reflex® GitHub
Nº 001 — System One Open source · Apache-2.0 v0.1.0 · October 2026

The nervous system for AI agents.

Your agent asks a frontier model hundreds of tiny questions — which tool, search or not, retry, stop? Reflex answers them on your machine in 0.02 ms, and only wakes the big model when there is something worth thinking about.

Read the manifesto
I. The Manifesto
Stop using a hundreds-of-billions-of-parameters reasoning model to make a three-option decision.

Every agent you have ever shipped spends most of its life making reflexes. Re-run the tests. Open the file in the stack trace. Back off after a 429. Stop when everything is green. Each of those tiny choices is routed through a frontier model — seconds of latency, thousands of tokens, real dollars — to produce an answer a spinal cord could have given.

Reflex is the spinal cord. A local runtime that sits inside your agent loop, scores the candidate actions in microseconds, returns a calibrated confidence, and acts only when it is sure and the action is safe. Everything else — the ambiguous, the novel, the dangerous — goes straight to System 2. And every time the big model decides, Reflex quietly learns how.

0.021msdecision, p50, laptop CPU
0runtime dependencies
0bytes leave your machine
∞destructive actions it will never auto-run
II. Two minds

Fast enough to be instinct.
Humble enough to ask.

System 1 · Reflex

Instinct

Rules, an exact-decision cache, learned trajectory patterns and a tiny online model. Answers in microseconds, on your CPU, with calibrated confidence.

Latency
0.02 ms
Cost
$0
Where
Your machine
System 2 · Frontier model

Deliberation

Claude, GPT, Gemini — summoned only for the steps that need real reasoning, with Reflex’s top hints attached. Its choices become Reflex’s next lesson.

Latency
1 – 5 s
Cost
Real money
Where
Someone’s datacenter

While your frontier model thinks once,

100,000

reflexes could have fired.†

† 2 s typical frontier step ÷ 0.02 ms Reflex p50 (measured by reflex doctor on a laptop CPU).

searching
connecting
weaving
composing
breathing
shaping
III. The decision ladder

Every decision climbs.
Most never reach the top.

Reflex tries the cheapest rung first and stops at the first one that is confident enough. The expensive rungs only run when the cheap ones can’t decide.

  1. 0

    Kill switch & mode

    REFLEX_DISABLE=1 and shadow mode win over everything.

    < 0.1 ms
  2. 1

    Rules

    Force, deny, allow-only, require-escalation. Budgets and loop detection. Deterministic, always first.

    < 0.5 ms
  3. 2

    Exact decision cache

    This precise state was decided before — at least three times.

    < 0.5 ms
  4. 3

    Trajectory patterns

    “After the tests fail with an ImportError, read the imported file.”

    < 1 ms
  5. 4

    The head

    An online model over hashed state × action features. It even learns which file to open.

    ~0.02 ms
  6. 5

    Full model optional

    Laya scores every candidate in one non-autoregressive pass. Bring a GPU.

    ~33 ms GPU
  7. ✦

    Escalate

    Your frontier model — or a human — with the top hints attached. Then Reflex learns from the answer.

    seconds
IV. How it learns

Watch. Learn. Act.

01

Shadow

Reflex rides along and never acts. Your frontier model decides as always; every choice becomes a label.

mode: "shadow"
02

Train

Fit calibration on one held-out slice, report on another, promote only if precision clears a 95% confidence bound.

$ npx reflex train --promote
✔ promoted v1
03

Auto

Routine steps run locally. One in fifty confident calls is still audited by System 2, so drift never hides.

mode: "auto"  // 89 of 120 handled locally
V. One call

Wrap one step.
Keep your agent.

No framework to adopt, no loop to rewrite. Declare the candidate actions with a risk class, ask Reflex, and either act or escalate. Destructive actions are never auto-executed — not even at 99.9% confidence.

Getting started guide
agent.ts
import { createReflex, action } from "@reflex-ai/core";

const reflex = createReflex({ workload: "my-agent", mode: "shadow" });

const d = await reflex.decide({
  point: "next_action", state, taskId,
  actions: [
    action.tool("read_file",  { risk: "safe" }),
    action.tool("run_tests",  { risk: "costly" }),
    action.tool("deploy",     { risk: "destructive" }), // never auto
    action.frontier(),                              // "this needs thought"
  ],
});

if (d.type === "auto") run(d.action);                // 0.02 ms, $0
else reflex.observeChoice(d.id, await askFrontier(d.hints));
VI. Everywhere your agents live

Seven ways in.
Pick yours.

The runtime

Zero dependencies. Node ≥ 22. In-process, so decisions cost microseconds. Start in shadow mode — it never acts until you promote it.

npm · @reflex-ai/core
$ npm install @reflex-ai/core
VII. Paranoid by design

It would rather ask
than be wrong.

VIII. The numbers
0.021ms

median decision latency of the local rungs, measured on a laptop CPU.

−64%

dollars per successful task on the coding suite, at 0.0 pp change in success rate.*

100%

precision of Reflex’s own auto-decisions on that suite, across eight seeds.*

51

tests, plus 26 release checks that install the real packages into an empty project.

* ReflexBench simulations with a simulated frontier model — they validate the mechanics, not your bill. Real-agent suites are next. Methodology →

Free. Local. Apache-2.0.

Give your agent
reflexes.

Star on GitHub ✦