This release is a pre-release and may not be stable for production use.
awp-python
The Python agent SDK for the Agent World Protocol. ClientConnection is the agent side of AWP as a sans-IO state machine, and awp.aio.AsyncClient drives it over a WebSocket.
It targets specification revision 0.1-draft.9, pinned as the spec/ submodule. This is an alpha, so the API will change along with the draft. The reference world, awp-sim, is a separate package built on this one.
Status
In both time models, the demo agent built on the client is Core Agent: AWP-conformant against 0.1-draft.9. awp-conformance reports no failure and nothing untested, and conformance/ holds the reports and the evidence for their manual rows. CI runs the suite against the demo agent on every change.
| Implemented | Not implemented |
|---|---|
Lockstep and streaming sessions; world.tick advances that wait for every per-tick channel |
Multi-bind (embodiments) |
Inline and ws stream bindings; binary frame codec (every spec vector) |
Other stream bindings (webrtc, webtransport, shm, grpc) |
| Action lifecycle checked against the spec's transition table; idempotent resubmission | |
| Heartbeats, clock synchronization, receiver reports, resumption with replay and acknowledgement | |
| Canonical schema validation in receiver and sender forms | |
| Task, approval and standing approvals, transfer, reset, snapshots, and command channels |
Install
pip install --pre awp-python
Requires Python 3.11+.
Using the client
With asyncio:
from awp import ClientConnection
from awp.aio import AsyncClient
conn = ClientConnection({"name": "my-agent", "version": "0.1.0", "vendor": "me"}, ["proprio/json"])
async with AsyncClient(conn, "ws://127.0.0.1:8710") as client:
await client.initialize()
await client.open_session("streaming", embodiment="arm_01", subscribe=["proprio"])
await client.wait_for(lambda e: "proprio" in client.latest)
record = await client.submit(
"move_to_pose",
{"pose": {"frame": "base", "p_m": [0.3, 0.2, 0.5], "q": [0, 0, 0, 1]}},
basis=client.latest["proprio"].frame, # the observation this intent rests on
valid_for_ms=200,
)
print((await client.wait_terminal(record.action_id)).state)
await client.close_session()
Without asyncio, feed ClientConnection the decoded messages and send whatever it queues:
events = conn.receive(message) # typed events: ActionUpdated, FrameReceived, ...
for out in conn.outgoing(): # messages to send, in order
transport.send(json.dumps(out))
The connection:
- tracks the action lifecycle against the spec's transition table;
- deduplicates replayed statuses;
- keeps the clock offset from heartbeats;
- reports any violation by the world as a
ProtocolViolationevent.
The demo agent
awp-demo is a scripted agent for awp-sim's arm. It moves, cancels a move, and triggers an envelope refusal. It rides out a lost connection by resuming the session, or by opening a new one if the world no longer holds it.
pip install --pre awp-sim
awp-sim serve & # streaming world on ws://127.0.0.1:8710
awp-demo # or --url, --token ($AWP_URL, $AWP_TOKEN)
Layout
src/awp/ client protocol layer (sans-IO), asyncio adapter, frame codec, schemas, demo agent
src/awp/_spec/ schemas and lifecycle table bundled from spec/ (scripts/sync_spec.py)
tests/ unit tests, and a scripted world that serves over WebSockets
conformance/ conformance reports, the manifests they were run against, and evidence
spec/ agent-world-protocol, pinned at spec-v0.1-draft.9
Development
git clone --recurse-submodules https://github.com/Hyperduality/awp-python
cd awp-python
uv sync
uv run ruff check && uv run ruff format --check
uv run mypy
uv run pytest --cov
uv run python scripts/sync_spec.py --check
To move to a new draft revision:
- Check out its tag in
spec/. - Run
scripts/sync_spec.py. - Update
SPEC_REVISIONinsrc/awp/__init__.py. - Fix whatever the tests report.
License
Apache-2.0. See LICENSE.
Release files for awp-python 0.1.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| awp_python-0.1.0a4.tar.gz | 133.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| awp_python-0.1.0a4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 197.1 kB
Release files / awp_python-0.1.0a4.tar.gz
| Download URL | awp_python-0.1.0a4.tar.gz |
|---|---|
| Size | 133.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2871d5207ff1bc2f95d7865d11029cc5a86168a35cb2b49d3133f29cc28bd97f
|
|
BLAKE2b-256 checksum How to use checksums |
8119685591afcbbfacb0d1061737b1bb6d14754a147188dc9b6efa9123c1f794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / awp_python-0.1.0a4-py3-none-any.whl
| Download URL | awp_python-0.1.0a4-py3-none-any.whl |
|---|---|
| Size | 63.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0124c5a9803c876385cb1793ba380f853b451485a8e7fe60cca602f54e9b6bc
|
|
BLAKE2b-256 checksum How to use checksums |
b96281f45213c54ab881b809c0fb13c6548a2d35ee239ec3f1761a2d88eaa893
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log