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.11, 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.11

In both time models, the demo agent built on the client is Core Agent: AWP-conformant against 0.1-draft.11. 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.11

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.0a7

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.0a7
File Size Uploaded Provenance
awp_python-0.1.0a7.tar.gz 138.6 kB With provenance Details

Built distribution (wheel)

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

Total release size: 204.8 kB

Release files / awp_python-0.1.0a7.tar.gz

Download URL awp_python-0.1.0a7.tar.gz
Size 138.6 kB
Tags Source
SHA-256 checksum
How to use checksums
562482563e73c5c76d102d6facad195465637490df94c8874b020ebeb202c4bd
BLAKE2b-256 checksum
How to use checksums
6ea284f1df0189410688fa4559199e5ab5f21c2aa9075fa5ca2b54dba9e21f2f
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 Oct 18, 2026.

Transparency log

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

Download URL awp_python-0.1.0a7-py3-none-any.whl
Size 66.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0eda6f1aac7d33641e1dafca83b1079e89da7904f91cc6042d8226ce8df27b2
BLAKE2b-256 checksum
How to use checksums
ce9126010aba14e70076d3e911b1bef94ba7e8ba57f56be19a50b787a7936239
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 Oct 18, 2026.

Transparency log

Security for awp-python 0.1.0a7

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.0a7.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 Oct 18, 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