Reef AI Agent

by Human-Agent-Society• 7.8k•• Scanned•Claim this listing•Request removal
Deployment & DevOpsagent infrastructureai agentscontinual learninginferencellm

Infrastructure for continually self‑improving agents

Reef is an open-source ai agent by Human-Agent-Society, written mainly in Python, with 7,783 GitHub stars and the Apache-2.0 license. Its code was last updated Nov 1, 2026. The latest PyPI release is reef-infra 0.1.3, published Oct 14, 2026, with 638 downloads last week.

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/reef-logo-dark.svg"> <img src="docs/assets/reef-logo-light.svg" alt="Reef" width="220"> </picture> <h3>Infrastructure for continually self‑improving agents</h3>

CI PyPI package: reef-infra Python License

<a href="https://trendshift.io/repositories/204783?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-204783" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/204783/daily?language=Python" alt="Human-Agent-Society%2Freef | Trendshift" width="250" height="55"/></a>

English | 中文

<div align="left">

Reef is the first open-source infrastructure for continual self-improving agents. It connects agent inference, feedback, learning, and versioned delivery. Use it to train model weights with Slime and SGLang, or improve an agent's harness, including its prompts, rules, and skills.

</div>

🚀 Get started | 🗺️ Roadmap | 🗓️ Office Hours | 📣 Launch post | 💬 Join Discord | 📱 Join WeChat Group

</div>

📰 News

  • 2026-11: We are refactoring Reef to a control plane + workers architecture. Some recipes and examples can fail on main until the refactor is complete. If a recipe fails, please open an issue.
  • 2026-11: A scenario can split its traffic across its served artifacts #1227, also through Semantic Router #859. The new python harness adapter evolves a Python program #1242.
  • 2026-10: Tinker runs as a training component #901. Episodes and agents can run in Modal Sandboxes #942. The artifact repository can live on Hugging Face #1003. New recipe: OPD #683.
  • 2026-09: reef-infra v0.1.0 is on PyPI. New recipes: GEPA, SDFT, SDPO and Meta-Harness. Reef serves the OpenAI Responses API at /v1/responses #528.
  • 2026-08: Reef is open source. Read the launch post.

🎯 When to use Reef

Use Reef when you want your agent to keep improving simply by learning from how you interact with your agent.

Your goalLearning pathWhat you need
Keep getting stronger model designed for youModel weight trainingA trainable model, a supported GPU stack, and feedback your recipe can use
Get your harness to self-improveHarness optimizationA model endpoint, representative tasks, and an evaluator; no local training GPUs
Scientific discoveriesTest-time trainingAn execution environment, a correctness checker, and a measurable objective

🧩 How Reef fits your stack

AbilityInference engine (vLLM, SGLang, …)RL training framework (Slime, veRL, AReaL, …)Reef
Serves live traffic✅❌✅
Trains weights❌✅✅
Version management❌❌✅
Stays live through updates❌❌✅
Evolves beyond weights (skills, harness)❌❌✅

🔄 How it works

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/loop-animation-dark.svg"> <img src="docs/assets/loop-animation-light.svg" alt="Reef serves requests, records feedback, produces updates, and commits accepted updates to a version history." width="76%"> </picture> </div>

Reef processes each learning cycle in four steps. The table also shows which modules implement each step.

StepWhat happensWhere it lives
1 · ServeServe agent requests and record interactions.service/ — agent requests and interaction records<br>inference/ — inference and artifact updates
2 · ObserveMatch feedback to recorded interactions.storage/records.py — stored interactions and feedback<br>record2sample/ — feedback matching, eligibility, and samples
3 · GrowProduce an update from eligible records.recipe/ — recipe integration<br>train/ — the training pipeline, job data, and training jobs
4 · CommitApply the configured selection policy and publish accepted updates.evaluation/ — candidate evaluation<br>artifact/ — version history and snapshot components

📦 Installation

💡 Note

Reef's artifact and checkpoint functionality requires the git-lfs system package. Reef initializes Git LFS locally for its artifact repositories.

We recommend uv for managing packages, and the commands below use it.

From PyPI

uv venv && source .venv/bin/activate
uv pip install reef-infra
python3 -c "import reef; print(reef.__version__)"

From source

git lfs install
git clone https://github.com/Human-Agent-Society/reef.git
cd reef
uv venv && source .venv/bin/activate
uv pip install -e .
python3 -c "import reef; print(reef.__version__)"

Use the source checkout for development and for the training examples below.

🔧 Using Reef

Reef supports two learning surfaces: model weights and agent harnesses. The deployment's recipe determines which surface its scenarios update.

As a minimal example, start Reef as a pure inference server. This needs SGLang and GPU-enabled PyTorch in the environment:

reef serve --inference.model-path Qwen/Qwen2.5-1.5B-Instruct

Weight-training deployment

Start the deployment

The following example starts the SAO (arXiv:2607.07508) example deployment. Run it from a Reef checkout in an environment that satisfies the GPU requirements in Evolve your model.

uv pip install -e ".[slime]" && uv pip install --no-deps --group runtime

export MODEL_PATH="Qwen/Qwen2.5-1.5B-Instruct"
export REEF_TOKEN="reef-local"

reef serve -c recipes/sao/examples/imo_answerbench/serve.yaml \
  --inference.model-path "$MODEL_PATH" \
  --reef.port "8900"

curl -f http://127.0.0.1:8900/healthz          # the service is up

Send an inference request and report feedback

Send inference requests through Reef and report a score for each response. The SAO recipe uses each eligible scored rollout to run a training step.

Reef's inference endpoint is OpenAI- and Anthropic-compatible: /v1/chat/completions, /v1/responses and /v1/messages take the provider's own request body. A request includes the x-reef-scenario header. Inference requests do not create scenarios or select recipes. Create the scenario with POST /reef/scenarios; it uses the deployment's configured recipe. Then wait until GET /reef/scenarios/{scenario}/inference/status reports ready.

The response body uses the provider's OpenAI-compatible format. Reef adds the x-reef-agent-record-id response header. Its value is the receipt that a later report uses to identify this interaction. A report can contain a numeric score, textual or structured feedback, and the receipts it evaluates. This example reports both a score and a short explanation.

import os
import time

import httpx

scenario = "hello-reef"
reef = httpx.Client(
    base_url="http://127.0.0.1:8900",
    headers={"Authorization": f"Bearer {os.environ['REEF_TOKEN']}", "x-reef-scenario": scenario},
    timeout=300,
)

# Create the scenario; a repeated request returns the existing scenario
reef.post("/reef/scenarios", json={"name": scenario}).raise_for_status()

# Wait until inference is ready for the scenario
deadline = time.monotonic() + 1800
while True:
    startup = reef.get(f"/reef/scenarios/{scenario}/inference/status")
    startup.raise_for_status()
    status = startup.json()
    if status["state"] == "ready":
        break
    if status["state"] == "failed":
        raise RuntimeError(f"Inference startup failed: {status['error']}")
    if time.monotonic() > deadline:
        raise TimeoutError(f"Inference is still {status['state']} after 30 minutes; read the Reef logs")
    time.sleep(1)

# Send a provider-compatible inference request
response = reef.post(
    "/v1/chat/completions",
    json={
        "model": os.environ["MODEL_PATH"],
        "messages": [{"role": "user", "content": "Return exactly: reef is ready"}],
    },
)

response.raise_for_status()
receipt = response.headers["x-reef-agent-record-id"]
answer = response.json()["choices"][0]["message"]["content"]

# Sending report about the inference
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()

feedback carries the richer signal, plain text or a structured object, for recipes that read more than a scalar. The endpoint will validate the report schema (reef/core/reports/).

Watch it learn and grow

Once the recipe has enough feedback, Reef submits a training job to the training component. When a checkpoint that the job saved passes evaluation, the inference runtime loads it as the new snapshot. Later inference requests use the current version without restarting Reef.

Harness-evolving deployment

Evolve a coding agent's skills and rules from scored feedback, using a model API instead of GPUs.

A harness deployment serves reef.recipe.harness:HarnessEvolutionRecipe. The recipe keeps the agent harness as a tree of text files. At each step, a method edits a copy of that tree from the step's traces, the evaluation runs the real agent on tasks with the candidate, and a candidate that wins publishes as a snapshot that any client can pull. The harness evolution tutorial runs the smallest full loop on pi. It needs an OpenAI-compatible endpoint, and Node.js and npm for pi. From your Reef checkout and activated Python environment:

cd tutorials/evolve-your-harness
./run.sh

configs/serve.yaml names the endpoint (inference.upstream-url, no /v1 suffix) and the model (inference.upstream-model). Edit them to point at your own provider, and set REEF_UPSTREAM_API_KEY if the endpoint needs a key. run.sh starts Reef on 127.0.0.1:8900, sends the tasks through it, reports each score, and pulls the published tree. Each run writes work/replay.html with the snapshot chain and the files each step changed.

GET /reef/harness serves the published tree, rendered for the deployment's adapter. The files carry no endpoint, key, or model: a client writes them where the agent reads them and binds the agent's model to this Reef (see Use a published tree). Write the tree outside the project the agent works in: a session can write files in its project, so a tree there could change what the next session runs. Evolve agent prompts, rules, and skills explains the loop and its configuration.

📚 Recipes and examples

Pick a recipe by the task type of your workload and by what it should evolve, model weights or the agent harness. Weight recipes need the GPU training stack, while harness recipes need only a model endpoint. Each recipe below links to its guide and each measured benchmark links to its results page, and the recipe catalog adds the code and example for every recipe. SFT ships with reef-infra and trains on demonstrations or imported examples for every task type. The other implementations live in this repository's recipes/ cookbook, selected by dotted class reference and not shipped in the Reef wheel.

Task typeTask shapeEvolves the modelEvolves the harnessStandard benchmarks
Open-ended discoveryRepeated attempts at one hard problem with a measurable objective and no known answerTTT-Discover, Guidance-TTTNone yetMeasured: TriMul, circle packing, Erdős minimum overlap.
Offline tasks with a known answerIndependent tasks from a fixed set, each with a reference answerSAO, SDFT, SDPO, OPDGEPA, Meta-HarnessMeasured: IMOAnswerBench, AIME 2024, AIME 2025, SciKnowEval, ToolAlpaca, Terminal-Bench.
Online learning from usageSessions with a user, where the interaction itself is the signalOpenClaw-RLACE, ReasoningBankMeasured: GSM8K with a simulated student user.

recipes/basic/ is the record-only starting stack and stays outside the catalog. For a small walkthrough of feedback, candidate edits, and publication, start with the coding harness tutorial. Each result page documents its task, evaluation setup, measurements, and limitations.

📐 Architecture

<div align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/architecture-dark.svg"> <img src="docs/assets/architecture-light.svg" alt="Reef architecture: harness requests flow through a scenario to inference. Receipt-linked feedback feeds records and recipe training; artifact evaluation selects updates for versioned publication. Rejected candidates leave the current snapshot serving." width="1200"> </picture> </div>

📖 Learn more

The documentation is organized in the following order:

  • Quickstart: install Reef, connect a client, and inspect the version history
  • HTTP API: use the HTTP API and report feedback
  • Write a recipe: configure how Reef processes data and produces updates
  • Evolve your harness: evolve a harness instead of model weights
  • Evolve your model: configure and operate a training deployment
  • Recipes: the catalog of cookbook recipes by task type, with code, docs, example, and results for each
  • The core loop: The core loop of Reef
  • Glossary: Explanation of the terminologies used

🤝 Community & Contributing

Working on continual self-improving agent?

If Reef looks useful to you, please give it a ⭐ — it helps the community to discover and contribute to the project.

📚 Citation

If you use Reef in your research, please cite:

@misc{reef2026,
  title  = {Reef: Infrastructure for Continually Self-Improving Agents},
  author = {{Reef Contributors}},
  year   = {2026},
  url    = {https://github.com/Human-Agent-Society/reef}
}

Citation metadata is also available in CITATION.cff.

👥 The Team

Reef brings together people exploring how agents can learn from experience and improve over time. The people below help turn that idea into working infrastructure.

This list is non-exhaustive, with team members listed alphabetically by last name:

Wenhao Chai, Shuangrui Ding, Shiyi Zoe Du, Hao He, Haoze He, Chonghe Jiang, Nan Jiang, Xuan Jiang, Xiaochen Li, Paul Liang, Bo Liu, Boyuan Long, Qiuyang Mang, Zhenting Qi, Ao Qu, Mingruo Qu, Yihong Tang, Zhaokai Wang, Xuezhi Yan, Hanfei Yu, Haofei Yu, Simon Yu, Han Zheng, Kaichen Zhou, Zijian Zhou, Jiacheng Zhu, Dingyi Zhuang, Xinkai Zou.

⭐ Star History

<a href="https://star-history.com/#Human-Agent-Society/reef&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=Human-Agent-Society/reef&type=date&legend=top-left&sealed_token=z8QelisjJA7wNSk0E_tcfZ8YzFIYY9czZQTvqRy51kdbOVVAvadCE0iKIhrM6qPqkxdDrdRUQOLxKLlazXbTU8-l5Oxj-pYCcAF-d2erPCw3RjKZ5dJXBFd2bgPhBu65TZVZxZReP9lznlTpnGvAynSWUsO1CjapS8nXUqALToFUAHraMIapsjhfWECk&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=Human-Agent-Society/reef&type=date&legend=top-left&sealed_token=z8QelisjJA7wNSk0E_tcfZ8YzFIYY9czZQTvqRy51kdbOVVAvadCE0iKIhrM6qPqkxdDrdRUQOLxKLlazXbTU8-l5Oxj-pYCcAF-d2erPCw3RjKZ5dJXBFd2bgPhBu65TZVZxZReP9lznlTpnGvAynSWUsO1CjapS8nXUqALToFUAHraMIapsjhfWECk" /> <img alt="Reef Star History Chart" src="https://api.star-history.com/chart?repos=Human-Agent-Society/reef&type=date&legend=top-left&sealed_token=z8QelisjJA7wNSk0E_tcfZ8YzFIYY9czZQTvqRy51kdbOVVAvadCE0iKIhrM6qPqkxdDrdRUQOLxKLlazXbTU8-l5Oxj-pYCcAF-d2erPCw3RjKZ5dJXBFd2bgPhBu65TZVZxZReP9lznlTpnGvAynSWUsO1CjapS8nXUqALToFUAHraMIapsjhfWECk" /> </picture> </a>

🙏 Acknowledgements

We are particularly grateful to these projects which power important parts of Reef:

  • SGLang — high-performance inference
  • slime — model weight training

Reef alternatives

View more →

Similar ai agents in Deployment & DevOps, ranked by GitHub stars. Compare licence, recent activity and scan status before you choose.

NameStarsLicenceLast updatedScan
Reef (this page)
Human-Agent-Society
7.8kApache-2.0Nov 1, 2026Scanned, no flagged issues
Langflow
langflow-ai
156kMITNov 1, 2026Scanned, no flagged issues
Novu
novuhq
40kNone foundNov 1, 2026Not scanned yet
QwenPaw
agentscope-ai
37kApache-2.0Oct 30, 2026Scanned, no flagged issues
Kestra
kestra-io
30kApache-2.0Oct 30, 2026Scanned, no flagged issues
Chroma
chroma-core
30kApache-2.0Oct 30, 2026Scanned, no flagged issues