Reef (human-agent-society/reef, Apache-2.0, 7.3k★, three releases in 30 days: v0.0.2 Sep 2, v0.1.0 Sep 23, v0.1.1 Sep 25) calls itself “the first open-source infrastructure for continually self-improving agents.” That phrase is doing a lot of work. Most agent stacks today — vLLM, SGLang, LangGraph, the dozen open-source harnesses that landed this month — can serve an agent. A few of them (slime, veRL, AReaL) can train one. Reef is the project that tries to do both at the same time, on the same machine, with the same x-reef-agent-record-id receipt tying a served response to the report that grades it.
The pitch is that every interaction between an agent and its user is already the supervision signal you need. Reef’s job is to capture it without making the agent author write any extra code beyond a report() call.
What “self-improving” actually means in Reef’s vocabulary
Reef’s README draws a sharp line between two learning surfaces, and the difference matters:
- Model-weight training — keep getting stronger weights. Needs a trainable model, supported GPU stack, and feedback your recipe can use. Reef ships with
slimeandSGLangunderneath. - Harness evolution — refine the agent’s prompts, rules, skills. Needs only a model endpoint, representative tasks, an evaluator. No local training GPUs. Reef’s built-in
reefinerecipe runs againstollama+gemma4:26bon the same laptop.
Both surfaces feed through the same artifact system: every accepted change publishes as a new version in a Git-LFS-backed artifact store, the served harness points at a current version, and clients download versions via the same /reef/scenarios + /reef/harness/install?adapter=pi endpoints.
This split is the project’s defining bet. Tooling like TTT-Discover and GEPA optimizes only weights. Tools like SkillClaw and Reefine optimize only the harness. Reef is the substrate that lets both run inside one process, against the same traffic, with the same version history.
The four-step loop
The core mechanism is short enough to read straight off the README’s table, and the file paths it points at are the same ones that show up in the recipes.
1 · Serve. reef/service accepts agent requests and records each interaction; reef/runtime owns inference and artifact updates. The serving layer is OpenAI- and Anthropic-compatible: /v1/chat/completions and /v1/messages take the provider’s own request body.
2 · Observe. reef/storage/records.py keeps the stored interactions; reef/train/processors matches incoming reports back to receipts. Eligibility — can this report train anything? — lives here too.
3 · Grow. reef/recipe integrates the recipe; reef/train builds batches and runs update jobs.
4 · Commit. reef/train/evaluation evaluates candidates, reef/artifact writes the version history, reef/surface delivers the new version to the served runtime.
The receipts are the load-bearing piece. Every served response carries an x-reef-agent-record-id header whose value is the handle a later report uses to identify the interaction. A report can carry a numeric score, textual or structured feedback, and a list of receipts it evaluates. Recipes that need more than a scalar — OpenClaw-RL’s persona-judged accept/reject, SkillClaw’s per-skill classification — read the richer fields. Recipes that need only correctness — SAO’s binary \boxed{} grader — ignore the rest.
A minimal end-to-end looks like this, copied almost verbatim from the SAO example:
response = reef.post("/v1/chat/completions", json={
"model": MODEL_PATH,
"messages": [{"role": "user", "content": "Return exactly: reef is ready"}],
})
receipt = response.headers["x-reef-agent-record-id"]
answer = response.json()["choices"][0]["message"]["content"]
matched = answer.strip() == "reef is ready"
reef.post("/reef/report", json={
"score": float(matched),
"feedback": "matched" if matched else "wrong answer",
"references": [receipt],
}).raise_for_status()
The dispatcher’s job is to collect batch_size reports into one training step. Set batch_size: 1 (the SAO smoke config) and every report is one optimizer step. Set it to 128 and you wait for 128 graded rollouts before the next Slime step.
What “stays live through updates” looks like in practice
The README’s feature-comparison table leans on this line: Reef stays live through updates, neither inference engines nor RL frameworks do. This is the operational claim worth verifying.
In the SAO stack (recipes/sao/examples/imo_answerbench/serve-30b-multi.yaml), the served model is Qwen3-30B-A3B-Thinking-2507, training is data-parallel across nodes, and the rollout engines are separate SGLang workers. The flow inside HarborAgent.run runs one OpenAI-compatible request through Reef, gets back tokens + the rollout log-probs from the engine, scores the answer, reports the score against the receipt, and the next request is served by the updated weights — without restarting the Reef process. Slime runs policy_loss with SAO’s per-token DIS primitive; Megatron performs the optimizer step; the weights sync to SGLang.
The “stays live” property is what makes the SAO method possible at all. Single-Rollout Asynchronous Optimization’s whole pitch is “no comparison group, no barrier.” A scored rollout joins the next optimizer step without waiting for siblings. If Reef had to bounce the served runtime between every update, the async property would collapse into the synchronous batch loop that GRPO and PPO inherit.
Three measured results to anchor the post
The recipes directory ships with eleven recipes; three of them have completed measurements that are concrete enough to cite verbatim.
SkillClaw on GLM-5.3-Flash (WildClawBench, 2026-08-29 results). Reef served GLM-5.3-Flash locally on 4 GPUs via SGLang (no provider API). Six nights of evolution applied 13 skill improvements and 8 creations. The skill pool grew from 9 to 17, with same-day create and next-day improve loops. In the Productivity category the method run’s final day beats the control mean by +12.05 points (2.29 sd). On the subset of tasks scored on every day in both runs, the margin grows to +15.72 (2.50 sd). The control run replays the same rounds but reports nothing, so nothing batches, no night runs, and the pool never changes. The gain criterion is fixed before any data is read and carried verbatim from the sealed campaign (PR #175, commit 0519eefb) — a category’s gain counts as real only when the method run’s final day beats the control mean by more than two control standard deviations (one-sided, calibrated to a 5.6 percent false-positive rate per category).
Meta-Harness on Terminal-Bench 2 (60-task pinned subset). The seed is vanilla Terminus 2, represented as a no-op Agent(Terminus2) module. The proposer rewrites that module, retains every valid candidate, and selects only strict improvements over the best recorded mean score. Models: target gpt-5.6-luna, proposer gpt-5.6-sol, both via the Responses API at xhigh reasoning effort. The baseline is 20/60 in Reef’s arm, 24/60 in the upstream arm. The best selected score is 23/60 (Reef) vs 24/60 (upstream). Reef selects iteration 1; upstream retains its baseline. Replaying the same completed score histories through Reef’s selector and upstream’s update_frontier produced identical choices on all eight candidate decisions — a useful sanity check on the selection rule given the same observations. Remeasuring the selected harnesses with two fresh repeats on the same tasks gave 22/60 (36.67%) for Reef’s iteration 1 and 21/60 (35.00%) for upstream’s baseline. The honest reading: Reef closed roughly half the gap to upstream on this suite, with strict-improvement selection (no tie-breaking) and the same model endpoint.
OpenClaw-RL on a simulated GSM8K stream (Hermes agent). A simulated student brings GSM8K homework to a real Hermes agent one session after another; the metric is how many sessions the agent needs before its answers match the student’s taste. The student wants solutions that don’t look AI-written (natural prose, no bold, no lists) but still show every step. It never states the preference, so the agent has to learn it from the reactions. The judge service plays the student — student_server.py runs the persona from personas.py, reacts to each reply, records the session. A follow-up that moves on counts as acceptance; a complaint counts as rejection; the policy updates while it keeps serving. No report call is required: the recipe’s processor rebuilds sessions from the traffic Reef already records, judges every completed turn through an independently deployed PRM, and turns accepted hindsight hints into a training signal. The example’s header shim supplies x-reef-tag-session for the unmodified Hermes agent.
That last point is worth dwelling on. OpenClaw-RL demonstrates that Reef can train without the agent author writing any feedback code at all. The agent runs its ordinary traffic; the recipe extracts the signal. SkillClaw does the same thing for harness evolution — the night step reads the day’s recorded sessions, classifies them by referenced skill, and proposes one composite mutation per skill group.
Reefine: harness evolution without GPUs
The reefine recipe is the one a senior engineer is most likely to run first, because it doesn’t need a GPU stack. From a Reef checkout with the Python environment activated:
reef serve --recipe reefine \
--inference.upstream-url http://127.0.0.1:11434 \
--inference.upstream-model gemma4:26b
That binds Reef to a local Ollama instance. In another terminal, install a harness and ask for a change:
curl -fsS -d '{"name": "my-harness"}' http://127.0.0.1:8901/reef/scenarios
curl -fsS -H "x-reef-scenario: my-harness" \
'http://127.0.0.1:8901/reef/harness/install?adapter=pi' | bash
reef-pi evolve "when I ask you to fix a bug, reproduce it with a failing test first"
The script installs into ~/reef-harness/<scenario>; the served model writes the change as a skill, a rules entry, an agent command, or a pi extension. Where the host can isolate it — Linux with bwrap and pasta as a non-root user — it works as a coding agent that runs the changed harness before handing the change back. The next session’s update notice offers the install; a step that settles while you are between turns offers its install right away. /versions opens a step’s page, /versions <version> install rolls one back.
The README has a paragraph worth quoting in full about install roots and trust boundaries:
Keep any install root outside the project the agent works in: a session can write files in its project, so with the install root there it could change what the next session runs. The same holds for the Python environment the install bakes into
reef-piand the Reef checkout it imports: code there runs as you whenreef-pistarts. For codex and dsh, keep them out of/tmpand$TMPDIRtoo: their sandboxes let a command write there as well.
This is the operational caveat the open-source-self-improvement narrative tends to skip. A “self-improving agent” only earns the name if the improvement boundary is auditable. Reef’s choice to publish every harness change as a versioned artifact with a propose/evaluate/CandidateSelector triple, and to keep the install root outside the project the agent works in, is the design that makes the loop safe to run unattended.
The reef-hermes handshake
The latest commit on main (Sep 30, the morning of this post) merges PR #637: “fix(harness): reef-hermes sessions load release commands, keep their state, identity and resume command, and turn off tirith, the skill review and the curator.” The commit message is itself a small confession — tirith, the skill review, and the curator are turned off inside reef-hermes sessions. Reef’s interaction model assumes that feedback flows back to the served runtime, and three of the gates that normally sit between a model and a self-edit would otherwise block the loop.
For anyone shipping agent harnesses against OpenAI- or Anthropic-compatible APIs today, the interesting takeaway isn’t the SAO result or the SkillClaw result in isolation. It’s that the same stack can run weight training against Qwen3-30B-A3B-Thinking-2507 on a 8-GPU node and harness evolution against gemma4:26b on a laptop, and both publish into the same version history. The receipts make the round-trip auditable. The versioned artifacts make the changes revertible. The recipe plug-in surface — propose, evaluate, CandidateSelector — is small enough to reimplement for a new training method in a single Python file.
The open question is whether the receipt-and-report pattern is the right abstraction. A scalar score plus a feedback payload plus a list of references is enough for SAO, Reefine, and OpenClaw-RL. SkillClaw needs more — it needs to classify sessions by referenced skill, which means its recipe reads the session digests directly. TTT-Discover, the test-time-training recipe, needs yet another shape — it wants the agent to score its own attempts at a hard problem across many restarts. The pattern holds, but the surface area each recipe touches is wider than the README’s first table makes it look.
What this leaves unanswered is whether continual self-improvement is a useful framing when the recipes on offer still require a verifier. SAO needs the \boxed{} grader; SkillClaw needs WildClawBench’s containerized tasks; OpenClaw-RL needs a PRM and a persona simulator. Reef is honest about this — every recipe in the catalog names its evaluation stack in the README — but it does mean “self-improving” is conditional on a domain where someone has already done the work of writing a checker. Reef is the substrate; the recipe authors are doing the substantive scientific work.
Comments
Powered by GitHub Discussions via Giscus. Sign in with GitHub to leave a comment.