The software factory
The software factory is a ready-made factory for building software, made from the same parts as the one on Getting started. It lives in its own package, pydantic-ai-factory-software. Today it has one station, Design. Build, Quality and Release follow.
pip install "pydantic-ai-factory-software[anthropic]"from pydantic_ai_factory import MemoryStorefrom pydantic_ai_factory_software import SoftwareFactory
software = SoftwareFactory("anthropic:claude-opus-5-5")store = MemoryStore()
run = software.run_sync("A to-do list web page where I can add tasks and tick them off.", store=store)print(run.waiting.output.title)#> To-do list
done = software.resume_sync(run, run.approve(by="ada"), store=store)print(done.outcome)#> passedBefore the run waited for you, a designer drafted the design and fresh reviewers read it under the Elephant Goldfish method. The designer revised it until a round of review was clean. Only then were you asked.
The stations
Section titled “The stations”| Station | Does | Status |
|---|---|---|
| Design | Drafts a design, has it reviewed, and waits for a person to approve it. | Ready |
| Build | Builds the approved design in an isolated workspace. | Coming soon |
| Quality | Checks the build and sends it back when it fails. | Coming soon |
| Release | Delivers the change as pull requests for a person to merge. | Coming soon |
Options
Section titled “Options”| Option | Default | Means |
|---|---|---|
model |
required | The model that drafts the design. |
rounds |
2 | Rounds of review before what is left goes to a person. |
repairs |
2 | How many times a design that still has open questions is sent back to the designer before a person decides. |
goldfish |
DESIGN_GOLDFISH |
The reviewers. |
review_model |
model |
The model the reviewers use. |
accept |
none | A function that reads signals and returns a mission, as for any factory. |
To change more than these allow, build the factory yourself from the same parts: a designer agent with the ElephantGoldfish capability, in a station with approval=True.
SoftwareFactory is a Factory, so everything on the factories page works on it, such as software.agents() and software.intake_sync(...).
From the terminal
Section titled “From the terminal”The package installs a factory command that runs the same factory and asks for your decision.
factory run "A to-do list web page where I can add tasks and tick them off."# To-do list
A to-do list web page where I can add tasks and tick them off....
design: reviewed in 2 rounds by 3 goldfish; the last round was clean.Waiting for approval of Design@37619731dd69.Approve, ask for changes, or reject? [a/c/r]It prints the design in full first, so you decide on what you have read. Answer a, and the same design is written to designs/to-do-list.md. factory show <run id> prints it again for a run that is waiting. Add --offline to try it with a scripted model and no key. Add --no-input to save the waiting run instead of asking, then decide later with factory resume <run id> --approve.
| Option | Means |
|---|---|
--brief FILE |
Read the mission from a file instead. |
--model NAME |
The model to use. The default is FACTORY_MODEL, or anthropic:claude-opus-5-5. |
--approve, --changes NOTE, --reject NOTE |
Decide without being asked. |
--answer TEXT |
Answer the designer’s question without being asked. |
--store FOLDER |
Where runs are kept. The default is .factory. |
--out FOLDER |
Where approved designs are written. The default is designs. |
factory show <run id> prints what happened in a run. The command exits with 0 when the run passed, 1 when it ended without passing, 2 when the command was wrong, and 3 when the run is waiting for you.