View a markdown version of this page

Step and time limits - AWS Context

Step and time limits

Iterations. maxIterations (2 to 50, default 30) caps how many steps the agent takes. A step is one call to the agent’s model, which can run several searches, traversals, or queries. On its final step the agent stops using tools and writes its answer. A lower value returns sooner and costs less; a higher value gives the agent room to work through harder questions. If the agent runs out of steps before it can write an answer, the answer lists the most relevant passages it retrieved and says it couldn’t compose an answer within the step limit. The response has no separate field that marks this; check the answer text. Raise maxIterations or split the question.

Time limits. AgenticRetrieve has a 100-second retrieval budget that you can’t change. If it runs out after the agent has gathered some context, the response has retrievedContext but no answer; treat a missing answer as a timeout. AgenticRetrieveStream has no retrieval budget of its own; the endpoint closes any stream still open after 300 seconds. Set a client read timeout of at least 120 seconds, because the stream can be quiet between events. A read timeout limits the wait between events, not the length of the call.