I've built a number of agentic systems using a popular pattern: a single monolithic agent that handles both orchestrating the task and solving it. You tell the agent how to solve the task through its harness — its skills and tools.
This approach has several fundamental disadvantages:
- It's hard to scale. Past a point, adding more high-quality instructions stops helping — the agent can't hold them all in focus and quietly drops some.
- A heavy harness forces a heavy model to run it — you can't fall back to lighter or local models.
- Orchestration by reasoning is unpredictable from run to run.
- The execution trace depends on the current context, so it's hard to analyze why the model decided to do what it did.
But the session log of a task that was once solved correctly is a good basis for building a more deterministic system. So I built two things:
- An FSM-based runtime for orchestrating agent pipelines.
- A compiler that turns logs of successful sessions into predictable, interpretable pipelines that run inside that runtime.
It surprised me that designing agent pipelines reduces so cleanly to compilation in the Futamura-projection sense. A lot of classical compiler theory carries straight over, giving you real guarantees for both the runtime and the compiler.
The runtime and compiler are open source under Apache 2.0. I'd be happy to get feedback.
bes-dev•1h ago
I've built a number of agentic systems using a popular pattern: a single monolithic agent that handles both orchestrating the task and solving it. You tell the agent how to solve the task through its harness — its skills and tools.
This approach has several fundamental disadvantages:
- It's hard to scale. Past a point, adding more high-quality instructions stops helping — the agent can't hold them all in focus and quietly drops some.
- A heavy harness forces a heavy model to run it — you can't fall back to lighter or local models.
- Orchestration by reasoning is unpredictable from run to run.
- The execution trace depends on the current context, so it's hard to analyze why the model decided to do what it did.
But the session log of a task that was once solved correctly is a good basis for building a more deterministic system. So I built two things:
- An FSM-based runtime for orchestrating agent pipelines.
- A compiler that turns logs of successful sessions into predictable, interpretable pipelines that run inside that runtime.
It surprised me that designing agent pipelines reduces so cleanly to compilation in the Futamura-projection sense. A lot of classical compiler theory carries straight over, giving you real guarantees for both the runtime and the compiler.
The runtime and compiler are open source under Apache 2.0. I'd be happy to get feedback.