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
- Getting started: build a factory of your own and run a mission through it.
- The software factory and its first station, Design.
- Concepts: factories, stations, agents in stations, gates, approvals, stores, missions and signals and methodologies.
- The methodology that ships: Elephant Goldfish.
- Observability and measuring a methodology.
- Two distributions in one workspace:
pydantic-ai-factory(the generic core) andpydantic-ai-factory-software(software stations). The core never imports a domain package. - Formatting, linting, strict typing, tests and an import-rule check, run in CI on Python 3.11 to 3.14. CI also runs the installed
factorycommand and the evaluation set offline. Alivetest marker runs the getting-started path against a real model by hand before each release. - A keep-out scan that stops credentials, personal paths and private terms from being published.
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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.