# AEnvironment **Repository Path**: limoncc/AEnvironment ## Basic Information - **Project Name**: AEnvironment - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-09-07 - **Last Updated**: 2026-09-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

AEnvironment

| Documentation | WeChat Group QR Code WeChat (ๅพฎไฟก) Group |

Everything as Environment โ€” A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

License PyPI Python

--- ## ๐Ÿ“ฐ News - **Deploy Skill** (Feb 2026) - ๐ŸŽ‰ New **Claude Code Skill** for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. [Get Started](#deploy-skill) - **v0.1.4** (Jan 2026) - AEnv CLI now supports **instance** and **service** management! Deploy and manage your agents and applications with simple commands. See [CLI Guide](./docs/guide/cli.md) for details. --- ## About AEnvironment AEnvironment is a unified environment platform for the **Agentic RL** era, built on the core philosophy of **"Everything as Environment"**. By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup. Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment. ### Core Philosophy: Everything as Environment AEnvironment abstracts everything as an environmentโ€”from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure. ### Key Features **๐Ÿ”ง Built-in Benchmarks, Zero-Cost Integration** - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench. **๐Ÿš€ Seamless Agentic RL Training Integration** - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows. **๐Ÿค– Agent as Environment** - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK. **โšก Rapid Development to Production** - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline. ## Use Cases ### Mini Program IDE Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The [Mini Program example](./aenv/examples/mini-program/) demonstrates: - **AEnvironment as Infrastructure**: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities - **AI Agent Integration**: Multi-turn conversations powered by OpenAI API - **MCP Tools**: File operations, code execution, and validation tools - **Live Preview**: Real-time preview of generated applications ```python # The agent uses AEnvironment tools to create web applications async with Environment("mini-program@1.0.0") as env: # Agent can use tools like read_file, write_file, execute_python_code result = await env.call_tool("write_file", { "path": "index.html", "content": "..." }) ``` ๐Ÿ“– See [Mini Program Example](./aenv/examples/mini-program/README.md) for details. ### TAU2 RL Training Train reinforcement learning agents with AReaL framework using TAU2 tasks. The [TAU2 RL example](./aenv/examples/tau2_rl/) shows: - **RL Integration**: Seamless integration with AReaL for agentic RL training - **Reward Function**: Environment exposes reward functions for RL training - **Episode Runner**: Turn-by-turn agent execution with automatic tool invocation - **Scalable Training**: Support for large-scale distributed RL training ```python # Entrypoint for AReaL training from aenv.examples.tau2_rl.agent import run_agent_return_reward # Run a single episode and return reward reward = await run_agent_return_reward({ "domain": "telecom", "task_id": "task_123" }) ``` ๐Ÿ“– See [TAU2 RL Example](./aenv/examples/tau2_rl/README.md) for details. ### Agent as Environment AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible. With Agent as Environment, you can: - **Compose Agents**: Treat agents as reusable components that can be called like tools - **Multi-Agent Orchestration**: Build complex workflows where agents interact with each other - **Hierarchical Systems**: Create nested agent structures for complex problem-solving ```python # Agent A calls Agent B as an environment async with Environment("agent-b@1.0.0") as agent_b: # List available tools from Agent B tools = await agent_b.list_tools() # Call Agent B's chat tool response = await agent_b.call_tool("chat", {"message": "Hello!"}) print(response.content) ``` This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface. ## ๐ŸŽฏ Built-in Environments AEnvironment comes with several built-in environments ready to use: | Environment | Description | Example | |-------------|-------------|---------| | **TAU2** | This environment supports RL experiments with TAU2 benchmark | [tau2](./aenv/builtin-envs/tau2/) / [tau2_rl](./aenv/examples/tau2_rl/) | | **Mini Terminal** | Lightweight terminal environment with bash command execution support | [mini-terminal](./aenv/builtin-envs/mini-terminal/) | | **TerminalBench** | Supports running Terminal Bench evaluation | [terminalbench](./aenv/builtin-envs/terminalbench/) | ๐Ÿ“– See [Built-in Environments](./aenv/builtin-envs/) for more details. ## Quick Start ๐Ÿ“– For detailed setup instructions, see the [Quick Start Guide](./docs/getting_started/quickstart.md). ### Deploy Skill The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management. #### Install Deploy Skill ```bash # Install from GitHub releases curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill claude skill install aenvironment-deploy.skill ``` #### Use Deploy Skill Once installed, you can deploy directly from Claude Code: **Deploy an existing environment:** ```python # Simply ask Claude Code: # "Deploy game-2048@1.0.6 as an instance with 1 hour TTL" # "Deploy myapp@2.0.0 as a service with storage enabled" ``` **Supported workflows:** - **Workflow A**: Build Docker image locally and deploy - **Workflow B**: Register existing Docker image and deploy - **Workflow C**: Deploy already registered environments (simplest) **Deployment types:** - **Instance**: Temporary environment with IP access (for agents, testing) - **Service**: Persistent service with domain access and optional storage (for production apps) The skill automatically handles: - โœ… CLI configuration and validation - โœ… Environment registration - โœ… Instance/service creation - โœ… Environment variable injection - โœ… Resource management (list, update, delete) - โœ… Error handling and retry ๐Ÿ“– See the [Deploy Skill Guide](./.claude/aenvironment-deploy/SKILL.md) for detailed documentation. ### Install SDK and init Environment ```bash # Install SDK pip install aenvironment # Initialize a new environment project aenv init my-env ``` ### Define Tools, Functions, and Rewards ```python from aenv import register_tool, register_function, register_reward # Register a tool @register_tool def search_code(query: str, path: str = ".") -> dict: """Search for code patterns in files.""" # Implementation return {"matches": [...]} # Register a function (for internal use within environment) @register_function def calculate_sum(a: int, b: int) -> int: """Calculate the sum of two numbers.""" return a + b # Register a reward function (for RL training) @register_reward def evaluate_task_completion(status: dict) -> float: """Evaluate task completion and return reward.""" if status.get("completed"): return 1.0 return 0.0 ``` ### Test the Environment Run your environment locally to test tools: ```bash # Start the MCP server within your project dir aenv run ``` This will start an MCP server that exposes your tools for testing and development. ### Build and push Environment ```bash # Build and push aenv build && aenv push ``` ### Use Environment ```python import asyncio from aenv import Environment async def main(): async with Environment("swe-env") as env: # List available tools tools = await env.list_tools() # Call a tool result = await env.call_tool("search_code", {"query": "def main"}) print(result.content) # Call a function (for internal use within environment) func_result = await env.call_function("calculate_sum", {"a": 10, "b": 20}) print(f"Function result: {func_result}") # Call a reward function (for RL training) reward = await env.call_reward({"status": {"completed": True}}) print(f"Reward: {reward}") asyncio.run(main()) ``` ## Performance We compared performance with other popular sandbox engines for the same simple demo: ![image](docs/images/performance.png) 1 Kubernetes is the currently supported engine in AEnvironment. 2 ASandbox is a high-performance engine planned for open-source release in the future. ## ๐Ÿ“– Resources - **[Installation](./docs/getting_started/installation.md)** - Installation and setup guide - **[Quickstart](./docs/getting_started/quickstart.md)** - Get started quickly with AEnvironment - **[SDK Guide](./docs/guide/sdk.md)** - Python SDK usage and API reference - **[CLI Guide](./docs/guide/cli.md)** - Command-line interface documentation - **[Environments Guide](./docs/guide/environments.md)** - Environment configuration and management - **[Architecture](./docs/architecture/architecture.md)** - System architecture and design ## ๐Ÿค Contributing We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued. ```bash # Fork and clone the repository git clone https://github.com/YOUR-USERNAME/AEnvironment.git cd AEnvironment # Install in development mode cd aenv pip install -e ".[dev]" # Set up pre-commit hooks for automatic formatting pip install pre-commit pre-commit install # Make changes git checkout -b feat/your-feature git add . # `git commit` will automatically format your file git commit -m "Add your feature" git push ``` Please check our **[Contributing Guide](./CONTRIBUTING.md)** for detailed information. ### ๐Ÿ’ฌ Community & Support - **GitHub Discussions** - Ask questions, share ideas, and connect with the community - **WeChat Group** - Join our WeChat community ([ๅพฎไฟก็พค](./docs/images/wechat_qrcode.png)) ## License Apache License 2.0 - see [LICENSE](./LICENSE) for details.