Skip to main content

Pygent 0.2

Pygent is a PyTorch-like framework for composing LLM agents with no hidden per-call state 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, RecurrentModule, UserMessage


class Echo(RecurrentModule):
    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 a Module to LocalRuntime when its call contract is supported and the application needs bounded concurrency, cancellation, deadlines, remote placement, durable history, or advanced Execution control. This standard recurrent example returns (message, context); ordinary Module inputs and results are user-defined. See the 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.20.tar.gz (596.4 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.20-cp311-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

pygent_ai-0.2.20-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.20-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.20-cp311-abi3-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

pygent_ai-0.2.20-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.20.tar.gz.

File metadata

  • Download URL: pygent_ai-0.2.20.tar.gz
  • Upload date:
  • Size: 596.4 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.20.tar.gz
Algorithm Hash digest
SHA256 2c39b10513c0b84e0d2030eea97b0af206c51ab780d49b4e374d76f0b74b4df5
MD5 52284e79463345466d945dbbfc4bd08c
BLAKE2b-256 6492fb9d46b0bdcaec1cd26030ee659dc72764bd1f49f292ee6503b1d87946b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20.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.20-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pygent_ai-0.2.20-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.20-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2bb41d6bee793ce040cca553faa29e799b61d61271f97fe2d095838e97ab230b
MD5 9d2f243a6543c7248fd44e3aa3d262a3
BLAKE2b-256 53135d013efbf9f7432a9a4fec05a910777f8abab2b122b474a21f68fed489e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20-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.20-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.20-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b57b887af4c82db64128c4096a619a5c50510ff01a4aa4454350ed469dbd6221
MD5 538d1fdf2cd8e1fa0566597e9a1abad7
BLAKE2b-256 2ba9911177acfeb22dfd123eee01ca4e30497c6ea340acaf2f30986b00776163

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20-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.20-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.20-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 54ee9f70f1b51290010cfb7f7a7f891c5cadbc24ddc1915234a57432a30eec1a
MD5 64ab12322571aa0d3e89ea59b2b3891b
BLAKE2b-256 11c13a59dfd71019bf6aff5c1d9a8ece02d3daffc7a04a4d64592c898a80ce01

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20-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.20-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.20-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29635b028fc1cdee5b2ea0fe501be39c6b3ef02eae480a09ee82e14fe23aa36c
MD5 e6ec3e5a8fd1d860026b37515902c821
BLAKE2b-256 7d7f5cf48749805ba89bd0277fc43eaefa81a906184ed88facc5ee6dfd3c7bb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20-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.20-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pygent_ai-0.2.20-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 450bc90bbe34e3c17e283429a9c01cfd533a6e2e190a2bcd909c3f62bc5fd77a
MD5 0e84f3b9b94e62171c23acd9b3a806a7
BLAKE2b-256 dac363276c9a12dea52af0208085928a49b77a1994a9baf60c93587cbb8ec9dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygent_ai-0.2.20-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

This release

0.2.20 This release

6 files

0.2.19

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