Cuga

Estimated reading: 5 minutes

The CUGA (ConfigUrable Generalist Agent) component, an advanced AI agent designed to execute complex tasks by leveraging external tools, structured output generation, and optional browser automation.

You can use CUGA as a direct drop-in replacement for the standard Agent component in your workflows. Just like the core Agent, CUGA can connect to various utilities through its Tools port and can even function as a tool itself within larger orchestrations. 

Key Features and Limitations

CUGA brings several advanced capabilities to your automation pipelines:

a. Browser automation: Seamlessly scrape the web using Playwright by setting the browser_enabled parameter to true.
b. Custom instructions: Guide the agent’s behavior by attaching Markdown files with specific directives to the Instructions input.

For more information, see the CUGA project repository

Implementing CUGA in Your Flow

You can easily test CUGA by modifying a basic agent chat flow that features Chat Input, CUGA, Chat Output, and various tool inputs. Follow these steps to set it up:

1. Create a new flow using the Simple Agent template and replace the default Agent component with the CUGA component.
2. Connect an MCP Tools component and a Calculator component to CUGA’s Tools port. Link the MCP Tools component to an MCP server, such as one containing organizational sales data.
3. Add a Read File component and connect it to CUGA’s Instructions port. Alternatively, you can click Edit text on the CUGA component to type your instructions directly.
4. Create a Markdown file named instructions.md on your local machine.

Format the document clearly with ## Plan and ## Answer headers so the agent parses your directives correctly, as shown below:

## Plan
- Break down complex queries into subtasks
- Prioritize information gathering before execution
- Consider dependencies between actions
- Validate intermediate results before proceeding

## Answer
- Provide concise summaries with key findings
- Include relevant data points and metrics
- Cite sources when using MCP tool results
- Use clear structure and formatting for readability

5. In the Read File component, click Add File and upload your instructions.md document.
6. Open the Playground and prompt the agent with a question that requires your MCP server data, such as “Which accounts are available?”.

The agent will detail its tool calls and return a formatted, concise summary based strictly on your defined policy, rather than dumping the entire raw dataset.

Parameters

Agent Configuration Parameters
Field Name Description Value / Default
Model Provider The provider of the language model that the agent will use to generate responses. OpenAI
Max Tokens The maximum number of tokens to generate. Set to 0 for unlimited tokens. (Empty)
Model Kwargs Additional keyword arguments to pass to the model. (Empty)
JSON Mode If True, it will output JSON regardless of passing a schema. False (Toggle off)
Model Name To see the model names, first choose a provider. Then, enter your API key and click the refresh button next to the model name. gpt-4o-mini
OpenAI API Base The base URL of the OpenAI API. Defaults to https://api.openai.com/v1. You can change this to use other APIs like JinaChat, LocalAI and Prem. (Empty)
OpenAI API Key The OpenAI API Key to use for the OpenAI model. (Empty)
Temperature (No description provided in UI) 0.10
Seed The seed controls the reproducibility of the job. 1
Max Retries The maximum number of retries to make when generating. 5
Timeout The timeout for requests to OpenAI completion API. 700
Instructions Custom instructions for the agent to adhere to during its operation. Example: ## Plan <planning instructions> ## Answer <final answer instructions> (Empty)
Number of Chat History Messages Number of chat history messages to retrieve. 100
Tools These are the tools that the agent can use to help with tasks. (Empty)
Input The input provided by the user for the agent to process. (Empty)
Handle Parse Errors Should the Agent fix errors when reading user input for better processing? True (Toggle on)
Verbose (No description provided in UI) True (Toggle on)
Max Iterations The maximum number of attempts the agent can make to complete its task before it stops. 15
Agent Description [Deprecated] The description of the agent. Used only in Tool Mode. This feature is deprecated and will be removed in future versions. A helpful assistant with access to the following tools:
Current Date If true, will add a tool to the agent that returns the current date. True (Toggle on)
Enable CugaLite Faster reasoning for simple tasks. Enable CugaLite for simple API tasks. True (Toggle on)
CugaLite Tool Threshold Route to CugaLite if app has fewer than this many tools. 25
Decomposition Strategy Strategy for task decomposition: 'flexible' allows multiple subtasks per app, 'exact' enforces one subtask per app. flexible
Enable Browser Toggle to enable a built-in browser tool for web scraping and searching. False (Toggle off)
Web applications Cuga will automatically start this web application when Enable Browser is true. Currently supports one web application. (Empty)
Share this Doc

Cuga

Or copy link

CONTENTS