Skip to main content

Pygent 0.2

Pygent is a PyTorch-like framework for composing stateless LLM agents from reusable Module graphs. Version 0.2 provides a single Execution owner for direct and managed calls, an asyncio Runtime, observable model/tool events, OpenAI-compatible adapters, portable tools and MCP adapters, ReAct, SQLite recovery, and HTTP/SSE workers.

First principles

Pygent 0.2 第一原则 is the repository's highest authority. Module-specific first principles, SDK contracts, tests, examples, and code derive from it.

Quickstart

from pygent import AIMessage, Context, Module, UserMessage


class Echo(Module[UserMessage, AIMessage]):
    async def forward(self, message, context):
        output = AIMessage(content=message.content.upper())
        return output, context + message + output


message, context = await Echo().invoke(UserMessage(content="hello"), Context())

Direct invoke(), stream(), and start() need no Runtime. Bind the same graph to LocalRuntime when the application needs bounded concurrency, cancellation, deadlines, remote placement, durable history, or advanced Execution control. Both modes execute the same forward() graph and return (message, context); see the 0.2 Execution contract.

Documentation

Development

uv sync --all-extras
uv run pytest -q
uv run ruff check src tests examples benchmarks
uv run mypy src benchmarks
uv build
python -m examples.service.main
uv run --extra performance python -m benchmarks run synthetic-smoke

Python 3.11+ is required. Apache-2.0; see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygent_ai-0.2.19.tar.gz (593.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygent_ai-0.2.19-cp311-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

pygent_ai-0.2.19-cp311-abi3-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

pygent_ai-0.2.19-cp311-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file pygent_ai-0.2.19.tar.gz.

File metadata

  • Download URL: pygent_ai-0.2.19.tar.gz
  • Upload date:
  • Size: 593.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pygent_ai-0.2.19.tar.gz
Algorithm Hash digest
SHA256 429b851679b2fe4983e7abb7d14cb680afd8d9a0e5f43ca1b465e61e9c22d8ef
MD5 85be9583c1d8ac54ad5a7b1f51247eec
BLAKE2b-256 8e49e697b09025467b4deac65baf0aeca5652a25edf173a5e6cb170330fb9f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19.tar.gz:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygent_ai-0.2.19-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pygent_ai-0.2.19-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pygent_ai-0.2.19-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3dc178cbd61e4eb47585b021fdc13c7828315cb45dd71ba0ec8552cb5a60cde4
MD5 ca61fde476bae9fbed551ab91812957c
BLAKE2b-256 07d6a16b5b690024e23ed823ede6879cc6d85d9410e1b5ea5cd0a791864ae409

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19-cp311-abi3-win_amd64.whl:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ea49e8f6a5465ba3fd8caef912af58e84a3aa3701d9df7e479e6a3890c50ef88
MD5 9fcd37b8442726ba3d873848076a1aff
BLAKE2b-256 5970800cd2df1b9e8d4a632acea3f0c2cd1b769f1759d11883f8d38e01359d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c957c0da6799efb537a957c4de6e9ad424a85e267381beb04b3faa1be4a2d72a
MD5 d747cd6125f6621b1db4064221fae24b
BLAKE2b-256 eb5570c29c1e81bf56b92c114c57ee58d930baa4ccc0b14d49df7730c8ffdbe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygent_ai-0.2.19-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.19-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 08d34afc1a6c2caa1bb8b45262e4db0c27aad930252821a3cdc08308515277f5
MD5 9aa7ef4a8f5792e2d4bed3a85e193b01
BLAKE2b-256 c089d66d4105ab6c08154be7760fed0db09e0b37b147be71618059e7ce456146

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygent_ai-0.2.19-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.19-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 09f2fe4cca94029cbfcb315026b1a61dd9e1d6fbe2f5921bf09c74fc457b57ea
MD5 dfbbf65b74e2643c93d5c95a96961b0f
BLAKE2b-256 96e6e1e6bea22ea327f4e631d2d42200c342383912b56dba908f0a1cdb2c69b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.19-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on pygent-ai/pygent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.7

6 files

0.3.6

6 files

0.3.5

6 files

0.3.4

6 files

0.3.3

6 files

0.3.2

6 files

0.3.1

6 files

0.3.0

6 files

0.2.21

6 files

0.2.20

6 files

This release

0.2.19 This release

6 files

0.2.18

6 files

0.2.17

6 files

0.2.16

6 files

0.2.15

6 files

0.2.14

6 files

0.2.13

6 files

0.2.12

6 files

0.2.11

6 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

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