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.3.6.tar.gz (633.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.3.6-cp311-abi3-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11+Windows x86-64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

pygent_ai-0.3.6-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.3.6.tar.gz.

File metadata

  • Download URL: pygent_ai-0.3.6.tar.gz
  • Upload date:
  • Size: 633.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.3.6.tar.gz
Algorithm Hash digest
SHA256 4289f39e51e27806685403234b676ce2fb2eff140d172a5aa6ceb07e9d341780
MD5 71d44c81ed6e177bf832e6ed6f7ba724
BLAKE2b-256 0d7a1f5a18aa3c1451e5e24327718a9213ac7f3a12893a413a3b418f38ec4fb4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygent_ai-0.3.6-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.3.6-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fee0d8013cfbd8e9634c9571b9281ef2ec106653f4c77757d37517a19f0696ed
MD5 86960a3ec3f04fe0c20a4c291fe76912
BLAKE2b-256 1ae05e93e9d1567e475f6a4c3d51c8be77d550ee577945603423f0973a94e456

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.3.6-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 85ed6a283a3a28945e9331acc91ede92b7e9d24a84925b3809d999b33bb08a89
MD5 cdb7b81e0318518966b1c19968c2e553
BLAKE2b-256 687fcf08a9fe59d999ded22d21aec4d623e5552d0b3d53ce84c145e5e14f0bb2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.3.6-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5a15a1f1dda324d22efdcb5fa48aed92dc5d0ebef5a960dfee8b77c714e047c7
MD5 0eff10fe83b46efbd73bf7c38719785b
BLAKE2b-256 88dbfacfd93d402028e466f04ae484282a0d19cfd0c84bc000afae09a6ad491e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.3.6-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fa9124fc61d3627ff2929ccfc0f4066d07e27bb1c82038961f625e8a0118882
MD5 6a121e98d90a5dd00788b56297c23e59
BLAKE2b-256 6b8cce57b04e020852d5d542e7313bc4f0338f769acd722dc4f6bea641adb05e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.3.6-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cfc4a278eac5a0972d75738707b86ac0eb84bc946b5a7a1f35e1f83c4f3c52db
MD5 b9884e82ddfe58eab7843edfac9a7110
BLAKE2b-256 00a665ab972faa9f41ad6205a44183c1a6c28b59c695f5570301de65f246f18a

See more details on using hashes here.

Provenance

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

This release

0.3.6 This release

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

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