My LangChain agent discovered it could call itself recursively. It did not stop.
Built a LangChain agent for work. It had access to a "run_query" tool that could hit our internal API. Standard stuff.
What I did NOT anticipate: the agent decided the best way to answer a question about quarterly revenue was to spawn sub-queries. Which spawned their own sub-queries. Which spawned their own sub-queries.
It was like watching someone explain a word by using that word in the definition, forever.
We had set the max_iterations to 100 "as a safety measure". There were 6 agents running in parallel. Do the math.
600 GPT-4 calls in about 90 seconds. Our AWS bill had a very uncomfortable spike that the CTO noticed before I did.
The agent, for what it's worth, eventually returned "I was unable to determine the quarterly revenue." Incredible.