- Published on
Release of Recursive Agent
- Authors
- Name
- Jun Yu Tan
- @jyt4n
- Name
- Marcel Tan
- @Marcel7an
Introduction
- Problem of Single-Threaded Reasoning
- Decomposing Uncertainty Into Subtasks
- Investigating Subtasks in Parallel
- Outcome
We've recently released the Recursive Agent, a significant enhancement to Tusk, our AI coding agent. Tusk now generates even higher-quality pull requests for complex, mature codebases.
One key breakthrough has been improving the way our agents handle reasoning by combining uncertainty elicitation, task decomposition, and parallelized subtask execution—all built on top of the ReAct agent loop.
Problem of Single-Threaded Reasoning
Traditional ReAct agents tend to hit a bottleneck in long-running coding tasks. They operate in a "single line of thought", making decisions on the next tool to use in a linear sequence. As such, they often get stuck in a rabbit hole of overthinking, especially when faced with incomplete or uncertain information.
Our brains don’t necessarily follow a single line of thought to get to an answer, especially when solving coding tasks. More often than not, we start off with a few hunches and verify them against the codebase. This updates our beliefs, generates further ideas (e.g., are there existing utils I can already use? What tests should I update?) and we repeat the process until we’re certain of a set of changes are necessary and sufficient to solve the issue.
LLM agents need this scaffolding more than ever due to their proclivity to be overly cautious or over-index on specific findings in linear reasoning.
Decomposing Uncertainty Into Subtasks
So how do we map the complex nature of what our brains do when solving coding tasks?
Our solution was a new approach that breaks down tasks into "validated assumptions" and "risky unknowns”. Each unknown is treated as a separate unit of uncertainty that could potentially derail the agent’s reasoning and is investigated by a dedicated recursive ReAct agent.
These sub-agents work with just enough context to tackle specific challenges—whether that’s generating code, addressing review feedback, or running our internal automated feedback loop—without being overwhelmed by unrelated information.
Investigating Subtasks in Parallel
To ensure each sub-agent is operating with maximum accuracy, we’ve equipped them with new LLM-powered codebase investigation tools. We keep these tools well-abstracted to surface only the most relevant files, code definitions, and usage patterns, allowing the agent to focus on high-signal information for better decisioning. Each sub-agent explores the codebase concurrently, reporting their results back to the main agent before the main agent decides on the next step.
Outcome
With these advancements, our AI coding agent is now smarter, more modular, uncertainty-aware, and less prone to overthinking.
If you're a fellow AI agent tinkerer with similar ideas or just curious about how AI can boost your product squad’s development lifecycle, feel free to reach out to Marcel, Sohil, or me — happy to share more about our learnings.