Skip to main content
Pre-release

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

AWP: Core Agent, AWP-conformant against 0.1-draft.9

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.

Implemented:

  • lockstep and streaming sessions, with world.tick advances that wait for every per-tick channel;
  • multi-bind sessions (embodiments);
  • inline and ws stream bindings, and the binary frame codec (every spec vector);
  • the action lifecycle, checked against the spec's transition table, and idempotent resubmission;
  • heartbeats, clock synchronization, receiver reports, and resumption with replay and acknowledgement;
  • canonical schema validation in receiver and sender forms;
  • task, approval and standing approvals, transfer, reset, snapshots, and command channels.

Not implemented: stream bindings other than inline and ws (webrtc, webtransport, shm, grpc).

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:

from awp import jsonrpc

events = conn.receive(jsonrpc.decode(text))  # typed events: ActionUpdated, FrameReceived, ...
for out in conn.outgoing():  # messages to send, in order
    transport.send(jsonrpc.encode(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 ProtocolViolation event.

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

AGENTS.md covers moving to a new draft revision and releasing.

License

Apache-2.0. See LICENSE.

Metadata

Release files for awp-python 0.1.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awp-python 0.1.0a5
File Size Uploaded Provenance
awp_python-0.1.0a5.tar.gz 136.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awp-python 0.1.0a5
File Interpreter ABI Platform
awp_python-0.1.0a5-py3-none-any.whl Python 3 none any Details

Total release size: 200.6 kB

Release files / awp_python-0.1.0a5.tar.gz

Download URL awp_python-0.1.0a5.tar.gz
Size 136.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ede813efd17aeceffd557d39db57a5abae73ab9ffa9104e48b9a2f03ae435c3d
BLAKE2b-256 checksum
How to use checksums
3d3e6bf310fc5bd066c9d5c696da77374e43d30da10e2b348eab2f0429236a8b
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 26, 2026.

Transparency log

Release files / awp_python-0.1.0a5-py3-none-any.whl

Download URL awp_python-0.1.0a5-py3-none-any.whl
Size 64.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
034436f93cbb5abfa65e6454f5db39e64d0eea8fcdb99dac4b3da0913beb4b08
BLAKE2b-256 checksum
How to use checksums
501c304a0a48ab684837300b904d8f56a616370fb158fee064530ba6217a27bb
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 26, 2026.

Transparency log

Security for awp-python 0.1.0a5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for awp_python-0.1.0a5.tar.gz

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 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page