Split the Loop: This Open-Source Agent Architecture Kills LLM Deviations

Yesterday, BotCircuits shipped an open-source agent that rethinks how the agent loop actually works. The architecture looks simple at first. Step 2 is where it clicks.

Most agent frameworks do something that seems obvious but causes constant pain: they hand the LLM the full workflow and ask it to navigate. Thousands of tokens of instructions on every call, and eventually the model drifts, misses a branch, or racks up a bill that doesn’t match the work done.

BotCircuits flips the model.

The Twist: The LLM Never Sees the Full Plan

Their Workflow-Native Agent Loop splits one job into two separate systems:

  • A deterministic state machine handles all routing and conditional logic with zero LLM calls. It runs exactly as designed, every time.
  • A targeted LLM executor activates only at specific steps, with just the current action in context, then hands control back.

The model never has to interpret a multi-step plan. It gets one task, executes it, done. The state machine holds the rails. The agent literally cannot go off-track because routing is not the LLM’s job anymore.

How to Try It 🛠️

  1. Clone botcircuits-ai/botcircuits-agent from GitHub
  2. Define your workflow as a state machine (this is the zero-LLM part)
  3. Attach LLM execution nodes at the steps that need actual reasoning
  4. Connect your tools, skills, or MCP servers to those nodes
  5. Run it and compare token counts against your current setup

Pro Tip 💡

This architecture pays off most on workflows with lots of conditional branches: approve/reject flows, multi-step data pipelines, support routing logic. The more branchy your logic, the more the state machine carries the load and the less you pay per run.

If you’re building agents at any scale, this is worth a weekend test. The repo is open, the concept is solid, and smaller context windows per LLM call means real cost savings at volume.

🚀 Grab the repo and see how your token counts change.

New AI Agent Architecture to fix LLM deviations and token costs
by u/Deep_Committee_3603 in PromptEngineering

Scroll to Top