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

Uploaded CPython 3.11+Windows x86-64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

pygent_ai-0.2.21-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.21.tar.gz.

File metadata

  • Download URL: pygent_ai-0.2.21.tar.gz
  • Upload date:
  • Size: 619.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.21.tar.gz
Algorithm Hash digest
SHA256 95bb8b9b9d3fc5ca5bf436ad35b7e006bf88e7301f946e76bb5cb12816517cc5
MD5 42ef10b527a4645e957ca5465c0110cc
BLAKE2b-256 a13d99849e18eec5d3da2293ad7fe9850b6e1d70343e8d4c5f7570a34ee30947

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pygent_ai-0.2.21-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.21-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3d54ec28951b3befb9d478983b2b315c4bcd02f28db80bfeeec2c8a0551bfa59
MD5 53b265b6ef62a32b95abce494cb2ecb9
BLAKE2b-256 b4280ee55949b4a437523008ae5ce3bd5ca0a504431dccde3e1c710fa98bb6f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.2.21-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b20e9b5950140583c691421214b40ed9e93d3dae60512a7ba69e20e955e9e5a
MD5 434d1233c541335eb7997d010ec74a6d
BLAKE2b-256 d8e00a1d365f3f27e010861fc19b7b584a2ee5703ed94d9e8ad85c3fd8ead1b0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.2.21-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4db3bc71f550c15d2ecd43f7e30e51e8e2ec519d39ffced821367295e5647198
MD5 18f5d6f683ec85a1b023bfcba13c8648
BLAKE2b-256 f2f0fd5d1cdfd3d615f50b3563f38ba2b6fdb52e40f1a10644e1e855cbe36c1d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.2.21-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ce90478091227ce86d6595a6fb4bf74daa7185731f52b32e6e65051e5e76620
MD5 2699a00e5c9359298fe3cfa38e757181
BLAKE2b-256 ac92ebff06f7885a98147c4f6214002a4419510a9a70c806a30cf520944de76d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pygent_ai-0.2.21-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 260a6639effe0648f4be95e183ceb2efa1060b505bf222b51ab173a953bc6aa1
MD5 32d538b576263e5f3114fc44b7532a26
BLAKE2b-256 cc404e7d2f3038c3af9fcef2faffa3664a5d1a3deb8b6b44d143ccca84d7a463

See more details on using hashes here.

Provenance

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

This release

0.2.21 This release

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