Moonshot AI and kvcache-ai Open Source AgentENV for Agentic RL

Key Takeaways

  • Enables high-performance agentic reinforcement learning by solving the trade-off between container speed and virtual machine security.
  • Provides a drop-in, E2B-compatible infrastructure that allows teams to scale agent environments without rewriting existing code.
  • Introduces efficient snapshotting and forking capabilities, allowing developers to branch complex agent states in under 100 milliseconds.

Moonshot AI’s Kimi team and kvcache-ai have officially open-sourced AgentENV, a distributed platform designed to scale agentic reinforcement learning (RL) environments. The project, which is released under an MIT license, serves as the infrastructure powering the training of Kimi K3, Moonshot’s 2.8-trillion-parameter Mixture-of-Experts model. By utilizing Firecracker microVMs, the system provides a high-performance alternative to traditional containers for agentic workflows.

Bridging the Gap in Agentic RL Infrastructure

Agentic RL requires models to interact with real computer environments, necessitating isolated filesystems, network stacks, and live processes for every rollout. Existing solutions often force a difficult trade-off: containers offer fast startup times but share the host kernel, compromising security, while full virtual machines provide robust isolation but suffer from slow boot times and high memory overhead.
AgentENV addresses this by leveraging Firecracker microVMs, optimizing them to make idle, restart, and branching operations efficient enough for large-scale training. Each sandbox operates with its own Linux kernel and network namespace, managed by an orchestrator that handles the sandbox lifecycle through an Axum HTTP API.

Snapshotting and Forking Capabilities

The core functionality of AgentENV relies on its ability to snapshot memory and filesystem changes incrementally. This design allows for rapid environment management, with the system reporting boot or resume times of under 50 milliseconds and pause times of under 100 milliseconds. Even under heavy disk modification, incremental snapshot capture completes in under 100 milliseconds.
A standout feature for RL training is the platform's fork capability. A running sandbox can clone itself into up to 16 independent child sandboxes on the same node. Because each child inherits the source filesystem, memory, and configuration, teams can perform expensive setup tasks once—such as installing dependencies or cloning repositories—and then branch into parallel rollouts from that established state.

Deployment and Compatibility

To facilitate adoption, AgentENV exposes an E2B-compatible HTTP API. This allows developers currently using E2B to transition to the self-hosted AgentENV runtime without modifying their existing Python or TypeScript SDK code. The project also provides a native aenv CLI for specialized workflows.
The system is designed for Linux environments, requiring kernel 6.8+ and access to /dev/kvm. Deployment options are flexible, supporting an install script for systemd, Docker images, Docker Compose for multi-node simulation, and Kubernetes manifests. For storage, the system supports posix_fs and oss backends, with an optional peer-to-peer transport mechanism based on iroh available for artifact distribution. By utilizing overlaybd for on-demand image loading, the platform ensures that nodes do not need to pre-warm every image, allowing the addressable image set to exceed local disk capacity.

Comments (0)

No comments yet

Be the first to share your thoughts!