For several years, most of my time went into one question: how do you get LLM agents to do real, multi-step work while staying auditable, with every state change typed, bounded and attributable? I built several frameworks to find out. Some ideas held up well. Others turned out to be more machinery than the problem needed. This page is the short version.
In production: legal document pipelines
Client work where the stakes were concrete. LLM agent pipelines on strict Pydantic schemas processed 1,300+ legal documents, with deterministic validation, bounded retries, explicit ACCEPT/REJECT steps and auditable outputs. Manual review effort dropped by about 70%. The title OCR work continues this line.
The experiments
state + event → state + effects machines.What held up
- Typed boundaries everywhere. Schema-validated I/O caught more real failures than any amount of prompt work.
- Pure transitions, isolated effects. State machines whose transition functions do no I/O are easy to test and replay, whatever sits inside them.
- Bounded everything. Finite retries and explicit terminal states. No loop the model can extend by itself.
- Adversarial review earns its cost on code and claims that can be checked, less so on open-ended prose.
What didn't
The later frameworks, Forge especially, grew more orchestration than the tasks justified. When a system has schedulers, deliberation machines, integrators and multiple provider tiers, the framework becomes the thing you debug. Drift, meaning behaviour slowly diverging from the original intent, was never solved by adding structure around the model. That is a large part of why I turned to world models: I wanted to understand planning against a learned model of consequences, not just orchestrating calls.
The agent line continues in AgentSwarm, which builds on the typed state and deterministic control developed here.