Hey everyone, I've been building a research assistant agent with LlamaIndex to help summarize and cross-reference my Obsidian notes. It's mostly fantastic, but I've hit a snag: my agent sometimes gets stuck in a reasoning loop, especially on open-ended queries.
For example, I asked it to "suggest related concepts for my note on 'digital gardens,'" and it just kept churning out variations of the same few ideas in a seemingly endless cycle. I had to manually interrupt the execution.
I'm using a fairly standard setup with a `ReActAgent` and a few custom tools. I've played with the `max_iterations` parameter, but setting it too low feels like it cuts off legitimate complex tasks prematurely.
Has anyone else dealt with this? What's the best practice for setting a reliable hard stop or escape hatch?
* Is `max_iterations` the primary lever, and I just need to tune it better?
* Should I be implementing a custom callback or modifying the agent loop itself?
* Are there specific patterns in the agent's reasoning that signal a loop I could catch?
I'd love to hear how you've solved this in your own workflows. Sharing your config snippets or approach would be super helpful!
null