crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
19k stars 2.62k forks source link

Max iteration limit - not returning best answer #1038

Open SamuelKocur opened 1 month ago

SamuelKocur commented 1 month ago

In documenation is written: Max Iter is the maximum number of iterations the agent can perform before being forced to give its best answer.

Why does the agent return: "Agent stopped due to iteration limit or time limit."? Shouldn't it rather try to generate answer based on the context it gathered?

Sar2580P commented 1 month ago

It is because, the agent decides whether this iteration gives a retrieved information through which sub-question can be answered or not ...

If not, instead of framing the retrieved information to final response, it moves to next iteration. This way, if it ends up seeing awful information after each retrieval iteration... Then it stops the process, apologizing for not being able to find relevant information.

Hope this helps.