Iterative Problem Solver
The IterativeProblemSolver
is a simple agentic loop that repeatedly attempts to solve a user's request using available tools until it either succeeds, fails, or reaches a maximum number of iterations.
How It Works
flowchart TD
A[User Request] --> B[Initialize Agent]
B --> C[Set up Chat Session]
C --> D[Start Loop]
D --> E[Execute Step]
E --> F{Status?}
F -- Continue --> G{Has Remaining<br>Iterations?}
F -- Fail --> H
G -- Yes --> D
G -- No --> H[Generate Summary<br>Task Failed]
F -- Complete --> I[Generate Summary<br>Task Complete]
H --> J[Return Result]
I --> J
At each step, the agent attempts to make progress on the user's request using the available tools. It continues until one of three conditions is met: 1. It successfully completes the task (responds with "DONE") 2. It fails to complete the task (responds with "FAIL") 3. It reaches the maximum number of allowed iterations