# Agents

An Agent action in Lleverage allows you to create AI-powered automation that can perform multiple steps and make decisions to complete complex tasks. Agents use the actions you provide to work through problems autonomously until the specified objective is achieved.

### Key Features

* **Decision-making capabilities** to determine the best approach to a task
* **Action selection** from tools you provide
* **Iterative processing** that continues until instructions are fulfilled
* **Dynamic variable integration** for workflow context

### How to Add an Agent Action

1. Open the Add Action menu using one of three methods:
   * Click the "Add Action" button in the top left corner
   * Click on a connection circle on an existing action card
   * Click and drag from one action to create a connection
2. Select "AI" from the categories or find "Agent" in the options
3. Click on "Agent" to add it to your canvas

> 💡 The Agent action appears similar to the Prompt action in the workflow canvas.

### How to Configure the Agent Action Card

1. Locate the Agent card on your canvas which includes:
   * Header with the action name
   * Variable chip in the top left corner for referencing outputs
   * Control buttons for expanding/collapsing and running the agent
   * Connection points for inputs and outputs
2. Configure the basic settings:
   * **Model selection**: Choose from Balanced (default), Fastest, or Smartest options
   * **Instructions**: Add your agent's objective in the instructions box
3. Provide clear instructions for what the agent needs to accomplish

> ⚠️ Be specific with instructions as this determines how the agent will operate.

<figure><img src="https://3370306531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgSglJDQZxDZdn20CUcl%2Fuploads%2FqsZCGAvnJFui66ai8nlc%2FAgent%20Action.png?alt=media&#x26;token=cb5c3a23-fe81-404e-8524-3f3fdda217fa" alt="" width="366"><figcaption></figcaption></figure>

### How to Add Actions to Your Agent

1. Below the instructions section, locate the "Actions" area
2. Click "Add Action" to open the action picker
3. Select actions from the list that your agent will be able to use
4. The agent will automatically have access to these capabilities during execution

> 💡 The agent will attempt to automatically configure actions when possible, using context from your instructions.

<figure><img src="https://3370306531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlgSglJDQZxDZdn20CUcl%2Fuploads%2FULmKA7nsEI2OQxS2pd87%2FAgent%20actions.png?alt=media&#x26;token=3efdfd0b-c773-462f-8e38-de434c191603" alt="" width="375"><figcaption><p>Action Section of an Agent</p></figcaption></figure>

### How the Agent Action Works

1. The agent analyzes your instructions to understand the objective
2. It selects appropriate actions from those you've provided
3. It executes actions in sequence, making decisions based on results
4. The process continues until the agent determines the instructions have been fulfilled
5. The final output is passed to the next action in your workflow

> ⚠️ If action configurations have been previously specified in your workflow, the agent will follow those rules rather than creating its own configuration.

### Writing Effective Agent Instructions

1. Be clear about the specific goal the agent needs to achieve
2. Specify any constraints or requirements for the solution
3. Reference any variables the agent should use with proper syntax
4. Focus on the "what" (goal) rather than the "how" (specific steps)

> 💡 For best results, provide context that helps the agent understand the problem scope.

### Testing Your Agent Action

1. Click the "Run" button on the Agent card to test it with current workflow variables
2. Review the final output to ensure it meets your requirements
3. Adjust instructions or available actions if necessary to improve results

> ⚠️ Agents may take longer to execute than standard prompts because they perform multiple steps to complete a task.
