Please enable JavaScript.
Coggle requires JavaScript to display documents.
AutoGPT Agent Flow - Coggle Diagram
AutoGPT Agent Flow
Main agent execution path
Receive task
User provides goal / objective
Capture context, constraints and expected deliverable
Check whether required inputs or files are missing
If essential input is missing → ask user, then resume task intake
Initialize agent run
Load agent profile: model, system instructions and configured tools
Create run state and iteration / time / cost limits
Load conversation history and previous task state
Build working context
Retrieve relevant memory and knowledge
Combine goal + constraints + history + memory
Keep current plan, completed tasks and observations available
LLM reasoning cycle begins
Send working context to the LLM
LLM interprets the current objective and state
LLM decides the next best step
LLM produces a structured next action
Choose next step
Is more information needed?
Yes → ask the user or use a read / search tool
Receive answer or observation
Add it to working context
Return to LLM reasoning
Does the agent need a plan?
Yes → decompose goal into tasks
Identify dependencies and expected outcomes
Select the next unfinished task
Continue to action selection
Is the goal already complete?
Yes → leave the execution loop and verify final result
No → continue with the next task
Generate tool command
Select the tool that can perform the chosen action
Prepare structured arguments for that tool
If no tool is needed → produce a reasoning / response step
Validate command before execution
Check tool exists and arguments match its schema
Check permissions, policy and safety constraints
Check iteration, time and cost limits
Validation result
Invalid arguments → repair command and return to LLM
Not allowed → stop, ask user or choose a permitted alternative
Valid → continue
Human approval gate
Is this action configured to require approval?
No → proceed to execution
Yes → pause agent and show action details to user
Approved → proceed to execution
Denied → cancel action and ask LLM for another safe step
Execute tool command
Call browser, search, code, file, API or other tool
Run untrusted code in an isolated sandbox
Capture tool response, status and execution metadata
Observe tool result
Convert tool response into an observation
Capture useful output, errors and evidence
Append observation to the agent's working context / run history
Evaluate the step
Did the tool execute successfully?
Did the result answer the current subtask?
Is the result sufficient and trustworthy?
If the step failed
Transient error → retry within configured limits
Bad arguments → repair arguments and retry
Tool unavailable → select another tool
Wrong plan / approach → return to planning
Repeated or unrecoverable failure → stop safely and report blocker
If the step succeeded
Mark current subtask complete
Update plan and execution state
Store useful memory when appropriate
Loop control
Check remaining tasks and task dependencies
Check whether success criteria are satisfied
Check whether run limits have been reached
Continue?
More work remains → return to LLM reasoning with updated context
Goal complete → proceed to final verification
Blocked / limit reached → prepare partial-result report
Final verification
Compare final result with the original goal
Check correctness, completeness, evidence and requested format
If criteria fail → create a revised plan and re-enter the agent loop
If criteria pass → prepare final response
Deliver and close run
Present result and generated artifacts to user
Explain limitations, uncertainty or incomplete work
Persist final run state and useful memories
Close the run
Cross-cutting services used throughout the flow
LLM / reasoning engine
Interprets goal and current observations
Chooses next action
Produces plan or tool command
Re-enters reasoning after every observation
Tool layer
Tool registry and descriptions
Argument schemas and command parser
Browser / search / code / files / APIs
Tool results become observations
Memory & state
Read relevant memory before reasoning
Working memory holds current run context
Run state stores plan, task status and history
Write reusable memory after meaningful results
Safety & human oversight
Guardrails apply before and during actions
Permissions are checked before tool calls
Human approval pauses execution when required
Denied actions return to reasoning for an alternative
Evaluation
Step-level evaluation after each tool result
Failure classification selects retry / repair / alternative / re-plan
Goal-level evaluation during final verification
Observability & run controller
Trace LLM calls, tool calls, decisions and observations
Record errors, latency and resource usage
Pause, resume, cancel and enforce run limits