Skip to main content

Pydantic AI Factory

AI factories that prove their work. Built on Pydantic AI.

Checks Python 3.11 to 3.14 Licence: MIT Docs

An agent saying it finished is not the same as the work being right. Pydantic AI Factory is a Python library that separates the two. A factory takes a mission, moves the work through stations, and lets plain-code gates judge the recorded evidence before a person approves the result. Your agents stay ordinary Pydantic AI agents.

flowchart LR
    M[Mission] --> S1[Station<br/>agents do the work]
    S1 --> G1{Gate<br/>code reads the evidence}
    G1 -- passed --> A([A person approves])
    G1 -- failed --> S1

The first factory, for software, has one working station today: Design.

Try it

git clone https://github.com/hnrly/pydantic-ai-factory
cd pydantic-ai-factory
uv sync
uv run factory run "A to-do list web page where I can add tasks and tick them off." --offline

That drafts a design for a to-do list web page, has fresh reviewers check it, and asks you to approve it. It needs no model key. In Python it is four lines:

from pydantic_ai_factory import MemoryStore
from pydantic_ai_factory_software import SoftwareFactory

software = SoftwareFactory("anthropic:claude-opus-5-5")
run = software.run_sync("A to-do list web page where I can add tasks and tick them off.", store=MemoryStore())

Getting started builds a factory of your own; the software factory explains what this command did.

Status: alpha, v0.1. The public API may change before 1.0. The changelog lists every change you can see.

Why a factory

Did the station run? Did its output pass a gate that reads real evidence? A factory keeps those two questions apart, and keeps the records that answer them. That is what this library adds on top of Pydantic AI's agents and capabilities.

Idea What it means here
Mission What the factory commits to, with measurable success criteria. A string becomes one.
Factory A named, ordered list of stations, with bounded rework.
Station One bounded job with typed input and output. It names the agents it runs, if any.
Gate Plain code that judges recorded evidence. A model never decides a gate.
Artifact An unchangeable, content-addressed record of what a station handed on.
Methodology A Pydantic AI capability with a name, a version, the evidence it records and a gate that judges it.

"Capability" always means Pydantic AI's own AbstractCapability. The library adds no second meaning.

What is here today

The roadmap says what comes next.

Develop

You need uv and Python 3.11 or later.

uv sync
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run lint-imports
uv run pytest
uv run python scripts/keep_out_scan.py
npm --prefix site ci && npm --prefix site run build   # the docs site; needs Node 22

See Contributing for how changes are shaped and reviewed.

Licence

MIT. Built in public by hnrly. This project is independent and is not affiliated with Pydantic.

Metadata

Release files for pydantic-ai-factory 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-ai-factory 0.1.0
File Size Uploaded Provenance Actions
pydantic_ai_factory-0.1.0.tar.gz 54.7 kB With provenance Details for pydantic_ai_factory-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-ai-factory 0.1.0
File Interpreter ABI Platform Actions
pydantic_ai_factory-0.1.0-py3-none-any.whl Python 3 none any Details for pydantic_ai_factory-0.1.0-py3-none-any.whl

Total release size: 116.1 kB

Release files / pydantic_ai_factory-0.1.0.tar.gz

Download URL pydantic_ai_factory-0.1.0.tar.gz
Size 54.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9dc38e22dc1ef80a47c311c5d071fa6ce8bb51ef4b90c0ec0d95db1196d65f92
BLAKE2b-256 checksum
How to use checksums
12c5f93c6448367cb4558916c6631fe8a9ab7d6f181e760e0a74ab69817ed63f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Release files / pydantic_ai_factory-0.1.0-py3-none-any.whl

Download URL pydantic_ai_factory-0.1.0-py3-none-any.whl
Size 61.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1532d7b938a7f79f4a246ea929bbcafab1e154a694264f4dfa3b3b0cf58a9d27
BLAKE2b-256 checksum
How to use checksums
d39a920dd4721c610569a3a75c7c4d91281d184e042e365bad9fd3e98997626d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 17, 2026.

Transparency log

Security for pydantic-ai-factory 0.1.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pydantic_ai_factory-0.1.0.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 Nov 17, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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