Quick Start
What is A2E?
A2E (Agent-to-Environment) is a protocol and Python runtime for building stateful, interactive environments that LLM agents can interact with. It standardizes how agents use tools, access memory, run processes, observe environments, and learn from feedback — enabling a shift from static prompting to dynamic interaction.
Think of it as "POSIX for AI agents" — a unified interface between intelligent agents and the environments they operate in.
Install
bash
pip install a2eMinimal Server
Create a config.yaml:
yaml
host_id: "my-a2e-host"
server:
host: "0.0.0.0"
port: 8765
auth_token: "dev-secret"
transport:
type: http
audit:
enabled: true
path: "/tmp/a2e-audit.jsonl"
plugins:
- name: mytools
type: tools
cls: cookbook.servers.tools.registry_tool_plugin.RegistryToolPlugin
metadata:
enabled: true
modules:
- cookbook.servers.tools.read_file_tool
- cookbook.servers.tools.glob_tool
- name: mymemory
type: memory
cls: cookbook.servers.memory.inmemory.InMemoryPlugin
metadata:
enabled: true
working_limit: 50
episodic_limit: 50
semantic_limit: 50Start the server:
python
from a2e.schema import A2EHostConfig
from a2e.core.server.server import A2EServer
config = A2EHostConfig.from_yaml("config.yaml")
server = A2EServer(config)
app = server.start() # Returns FastAPI app for HTTP mode
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8765)Minimal Client
python
from a2e.core.client.client import A2EClient
from a2e.core.transports import HTTPTransport, HTTPTransportConfig, build_transport
from a2e.caps.tools.client import ToolAPI
from a2e.caps.memory.client import MemoryAPI
# Build transport and connect
transport = build_transport(config.transport, logger=None)
client = A2EClient(
transport=transport,
agent_id="my-agent",
auth_token="dev-secret",
agent_caps=["tools", "memory"]
)
with client:
# Use capability APIs
tools = ToolAPI(client)
memory = MemoryAPI(client)
# List and call tools
tool_list = tools.list()
result = tools.call("read_file", {"path": "/etc/hostname"})
# Store and retrieve memory
memory.remember("user_name", "Alice", tier="working")
name = memory.recall("user_name") # Returns "Alice"What Happens Behind the Scenes
- Transport starts — HTTP client connects to the server
- Handshake — Client sends
handshake/reqwithagent_caps, server responds withaccepted_caps - RPC calls — Each
tools.call()sends atool/call/req, gets backtool/call/resp(with streaming events viatool/event) - Disconnect — Context manager sends
shutdownand stops the transport