Bridging Agent Runtime and RL: Inside the Claw‑R1 Training Framework
Claw‑R1, a new reinforcement‑learning framework from the USTC Cognitive Intelligence Lab, integrates the OpenClaw Agent Runtime with RL training to enable agents to learn directly in real environments, addressing the gap between simulated tasks and true tool‑calling, multi‑step reasoning, and stable long‑task execution.
Project Background
Large‑model technology is moving from simple question answering toward task execution, giving rise to Agentic AI where models act as agents that call tools, interact with environments, and perform multi‑step reasoning.
Training such agents in real environments raises a key question: how should we train them?
Evolution of Large‑Model RL Paradigms
The field has progressed through three stages:
RLHF (Human Preference Learning) : generate text aligned with human preferences.
RLVR (Task‑Verifiable RL) : complete tasks with verifiable rewards.
Runtime RL (Environment‑Interactive RL) : act in real environments and learn from actual feedback.
The overall trend is that AI’s reward sources are moving closer to the real world.
RLVR’s Critical Gap
Although RLVR supports multi‑turn interaction, most existing frameworks rely on research‑oriented simulated environments such as coding benchmarks, reasoning tasks, or synthetic sandboxes. These are task‑specific training grounds, not true Agent runtimes, so models never experience real tool‑calling or continuous operation.
Consequently, a genuine runtime environment is needed for training.
OpenClaw: A New Agent Runtime
OpenClaw is an open‑source personal AI Agent operating system (MIT‑licensed, written in TypeScript) that follows a local‑first principle. It has attracted over 236 000 GitHub stars within eight weeks, making it one of the fastest‑growing open‑source projects.
Its hub‑and‑spoke architecture connects 15+ messaging platforms through a unified gateway to a central Pi Agent Runtime. Key innovations include a Lane Queue mechanism that serializes execution to eliminate concurrency races, and a three‑layer hybrid memory system for stable context management.
OpenClaw thus provides the first truly production‑ready Agent platform that can run autonomously in real messaging environments.
How to Train Models for OpenClaw
Traditional RLVR frameworks lack a real runtime, complex tool systems, and complete task environments, creating a clear gap between training and deployment. Models trained in simplified settings often suffer from tool‑calling chaos, weak planning, and instability on long tasks when deployed in real Agent systems.
The solution is a training framework that can perform reinforcement learning directly on the Agent runtime.
Claw‑R1: Connecting Agent Runtime and RL
Claw‑R1 aims to bridge this gap by combining an Agent Runtime with an RL training engine.
The system consists of three parts:
Agent Runtime : OpenClaw provides the real execution environment where agents invoke tools, interact with users, and perform multi‑step tasks.
Middleware : A gateway server and data pool collect interaction trajectories from the runtime, serving as the training data source.
RL Training Engine : Consumes the collected trajectories to update the model via reinforcement learning, forming a closed‑loop training process.
Framework Features
Middleware Layer (Gateway Server + DataPool) offers OpenAI‑compatible interfaces and supports three operation modes: white‑box offline, black‑box offline, and black‑box online service.
Asynchronous Rollout and Training : The Rollout Engine generates data while the Training Engine pulls batches from the DataPool, allowing both to run without blocking each other.
Agent‑Training Decoupling : Agents run on a Mac Mini, while training occurs on high‑performance servers; no pre‑built datasets are required, enabling simultaneous service and training.
Zero‑Code Integration : Simply point the base_url used by OpenClaw to the Claw‑R1 gateway; no changes to the agent logic are needed, and the framework automatically captures interactions for training.
Why Claw‑R1 Matters
Claw‑R1 provides the essential infrastructure for reinforcement‑learning training in the Agent Runtime era, solving the long‑standing problem of how to train agents that can operate reliably in real environments.
Combined with OpenClaw’s robust runtime, Claw‑R1 forms the core of the next‑generation Agentic AI architecture: a closed‑loop system of reasoning, tool use, environment interaction, and learning.
Summary
Agentic AI is evolving toward a “reasoning + tool + environment + learning” loop. Real‑world feedback becomes the reward signal, enabling models to act stably in complex tasks. Claw‑R1 supplies the training backbone, OpenClaw provides the execution platform, and together they lay the foundation for future Agentic AI systems.
Open Source
Project repository: https://github.com/AgentR1/Claw-R1
Contributors: Wang Daoyu, Ouyang Jie, Yu Shuo, Cheng Mingyue, Liu Qi
Institution: USTC Cognitive Intelligence National Key Laboratory
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
