## CUGA's Nodes
---

### **ChatAgent | Chat**

This agent manages follow-up questions and handles conversations that trigger pre-existing, familiar flows.


### **TaskAnalyzerAgent | Task Analyzer**

This agent performs the initial analysis of a user's request to determine its complexity. It decides whether a simple, direct answer is sufficient or if the query requires a more complex, multi-step plan. This agent also identifies related applications based on the user's intent.


### **TaskDecompositionAgent | Task Decomposition**

This agent breaks down large, complex tasks into smaller, more manageable sub-tasks. This is crucial for logically solving multi-step problems, as each sub-task can then be planned and executed independently.


### **PlanControllerAgent | Plan Controller**

This agent acts as the central orchestrator of the plan. It reviews the overall plan, tracks the status of sub-tasks, and decides the next steps, ensuring the entire process stays on track from decomposition to the final answer.


### Browser Sub-Agent


#### **BrowserPlannerAgent | Browser Planner**

This agent plans the next steps in natural language, based on its understanding of the DOM page and accompanying images. It then passes tasks to either the **ActionAgent** or **QaAgent**, or decides to conclude the task.


#### **ActionAgent | Action Agent**

This agent is designed to perform specific subtasks directly on the current web page, such as clicking on an element.


#### **QaAgent | Question Answering Agent**

This agent is called upon to answer questions related to the current webpage.


## Human-in-the-Loop Nodes


### **SuggestHumanActions | Human Action Suggester**

This node is used when human intervention or input would be beneficial. It's necessary for collaborative workflows, allowing the AI to ask for help, clarification, or a decision from the user.


### **WaitForResponse | Response Waiter**

This node pauses the entire workflow until it receives a response, typically from a human user. It works in conjunction with **SuggestHumanActions** to enable true human-in-the-loop processing.


## API Sub-Agent


### **APIPlannerAgent | API Planner**

This agent specializes in creating sub-tasks that involve API calls. At each turn, it either calls the **ShortlisterAgent** or **APICodePlannerAgent**, or decides to finish the task and return to the **PlanControllerAgent**. Within this node, there is also a reflection component that runs upon returning from the **CodeAgent**, summarizing the task, checking edge cases, and suggesting strategic recommendations.


### **APICodePlannerAgent | API Code Planner**

This agent, given the shortlisted schema and sub-task decided by the **APIPlannerAgent**, generates a pseudo-natural language plan to guide the coding agent. It can also report missing APIs to the **APIPlannerAgent** as feedback.


### **CodeAgent | Code Agent**

This agent is responsible for writing and executing code to solve a problem. It is called after the **APICodePlannerAgent**. The generated code is executed in a sandbox to ensure safety, and the result is stored in a variable and fed back to the **APIPlannerAgent** concisely within its context.


### **ShortlisterAgent | Tool Shortlister**

This agent filters and ranks a list of available tools or APIs to find the most relevant ones for a given sub-task generated by the **APIPlannerAgent**.

---

### **FinalAnswerAgent | Final Answer**

This agent is responsible for gathering the results from all completed tasks and synthesizing them into a final, coherent response for the user. It represents the last step in the cognitive process before presenting the solution.

### **ReuseAgent | Reuse Agent**

This agent is used in "save & reuse" mode, where CUGA suggests that the user save the current autonomous flow into deterministic Python code for safer and more predictable execution. It runs after the **FinalAnswerAgent** in conjunction with human-in-the-loop actions.
