Back to Blog

Scaling Agent Compute Through Multi-Step Reasoning

Reflections on how multiple loops of context gathering let agents refine their output while controlling cost.

Posted by

scaling agent compute image

Reasoning Over Multiple Steps

When I realized that chaining multiple steps of reasoning together could unlock more advanced outcomes, it changed how I thought about compute usage. Instead of a single-pass approach, I started letting the agent run through multiple loops—each one gathering new information, refining context, and deciding on the next tool to call. This multi-step pattern didn't just give better results; it let me dial in exactly how much "thinking time" to invest.

By capping the number of loops, I could keep costs in check, while still allowing for deeper logic. If a problem was simple, I'd limit iterations to keep it quick. If it was complex, I'd give the agent more room to explore. On top of that, I can easily switch out the LLM model to use; whilst it is tempting to hit o1 for everything, you take a financial and performance hit. Gemini Flash 2, or it's equivalent cousins from the other mega corps is a fraction of the cost and yet still very capable for well defined tasks. This fine-grained control became invaluable, since I could balance performance against the budget for each task.

An added benefit was the clarity: with each step explicitly logged or stored, debugging felt more like watching a conversation unfold than sifting through an opaque black box. In the end, I found that scaling compute gradually, tied to clear intermediate steps, gave me a more intelligent system without blowing up my runtime costs. It's a natural way to refine solutions: each extra turn in the loop can mean one more shot at getting things right.

Credit to IndyDevDan for laying out clear groundwork for this approach; see his Github here.

Many of these reflections are built upon the contributions of IndyDevDan; a source of true signal (and sanity) in a world of hype, FUD and noise. One of the first movers in this space, he has been building with agents for years and has a wealth of knowledge to share. Rather than jumping on every new tool or framework, Dan is focused on the fundamentals of building effective agents and distilling them into a set of principles that is language, toolchain and framework agnostic. If you are serious about building agents and future proofing your work, I would strongly recommend you check out his course Principled AI Coding.