New AI Agent Architecture to fix LLM deviations and token costs

Reddit r/AI_Agents Tools

Summary

BotCircuits Agent is an open-source framework that introduces a Workflow-native Agent Loop architecture, splitting deterministic state-machine navigation from targeted LLM execution to reduce deviations and token costs.

If you’ve use AI agents, you know the struggle: you drop massive, complex workflow instructions into a system prompt, and the LLM eventually gets confused, deviates from the plan, or racks up a massive token bill. We just published our new open-source repo,**BotCircuits Agent**, that solves this by fundamentally changing how the agent loop works. We’ve implemented a **Workflow-native Agent Loop** Architecture that splits the workload: * **Deterministic State-Machine Runner:** Handles all workflow navigation and conditional routing with **zero LLM usage**. It runs the logic exactly as designed. * **Targeted LLM Execution:** The workflow runner pauses at specific steps and hands control over to the LLM agent *strictly* to execute a single action using connected Tools, Skills, or MCPs. * **The Loop:** Once the tool action is complete, control is instantly handed back to the deterministic runner to navigate to the next step. **Why this matters:** The LLM is only ever aware of the *current* executing action. Because it no longer has to digest and interpret lengthy, multi-step instruction prompts, you get two massive benefits: 1. **Significant reduction in deviations ( predictability ):** The agent can't go off-track because the state machine controls the rails. 2. **Significant reduction in token usage ( less costs ):** Smaller context windows per step equal cheaper runs. Would love to hear your feedback or answer any questions! Link to the GitHub repo is in the comments.
Original Article

Similar Articles

Not All Tokens Are Equal: Inflation-Aware Routing for Agentic LLM Systems

arXiv cs.CL

This paper introduces InflationAgent, a routing system for agentic LLMs that measures token inflation, predicts task difficulty using CoT Branching Entropy, and optimizes model selection to maximize accuracy per cost, achieving higher accuracy with fewer tokens on benchmarks like GSM8K.

Would you use a circuit breaker for AI agents?

Reddit r/LocalLLaMA

The author discusses the problem of AI agents getting stuck in tool loops and proposes building 'Moven AI', an open-source SDK that acts as a circuit breaker to abort runaway agents before they incur excessive costs.