AI Agents are powerful but more expensive and potentially less reliable (they introduce uncertainty in your workflow) than Lindy actions and conditions.
When possible, we recommend using actions and conditions conditions instead of AI Agents.
AI Agents are comprised of five parts:
1. Prompt:
The Prompt is used to instruct the AI Agent on what task to perform and how to execute it. Think of the Prompt as a guide for the AI Agent to follow in order to perform the task within your workflow. 2. Model:
The language model used by the AI Agent. 3. Ask for Confirmation:
Lets you bring a human in the loop and confirm actions before Lindy executes them. 4. Skills:
Actions that the AI agent can perform at any point to execute the task. For example, if you want the AI Agent to first search the web for a recent news article, and then send you a Slack DM, you will give it two actions: Search the Internet and Send a Slack Message. 5. Exit Condition:
Exit Conditions tell the agent when to continue to the following steps in the workflow. An AI Agent will keep “looping” and not move to the next action until an Exit Condition is fulfilled. Examples of Exit Conditions include: some textOnce you’ve found time with the emailer Once you’ve agreed on a price with the user Once you’ve completed the web searches How To Use AI Agents To use an AI Agent, you must add it as a step in your workflow.
In this example, we are going to create a Lindy that wakes up when an email is received, proceeds to the AI agent step to perform research on the emailer, and then creates a HubSpot contact once it completes the research.
Note: you can add an AI Agent to an existing Lindy, but in this example, we are going to create a Lindy from scratch.
Click New Lindy below Home in the top left of your workspace to begin building your Lindy.
Click "Start from scratch" to create a new Lindy.
Click “Select Trigger”, then click Gmail , then add the Email Received trigger.
Connect the Gmail account you want Lindy to monitor.
Add An AI Agent Click “Enter AI agent” to add the AI Agent step.
Add An Agent Prompt Add a Prompt to the AI Agent, instructing it to perform research on the emailer.
Example prompt:
Use what you know about the emailer to find their company name, company founding date, company headcount and LinkedIn Profile.
Add Skills Give the AI Agent the skills it needs to perform research.
Click the plus button beside skills.
Add both of the browser actions. One will search for specific webpages and one will extract the web content from the page. By adding both of these actions, we give Lindy the ability to perform thorough research.
Add An Exit Condition Add an exit condition to instruct Lindy when to leave the AI Agent step.
Add the exit condition prompt:
you completed the research on the emailer
Click “Add Step” under the AI Agent exit condition and select “Perform an action”.
Search for Create Hubspot Contact and select the Hubspot Create Content action.
Now we are going to setup the Hubspot Create Contact action using the content found from the AI Agent’s research.
First, switch the “Contact Email” field to “Prompt AI” mode and add the prompt:
the emailers email address
Add a prompt to each Hubspot contact property field that you want to be updated, instructing Lindy to complete it using the information found from the web search.
Test Your AI Agent Test by sending yourself an email.
Then, click the “Test” button in the Flow Editor and select your test email.
Watch Lindy take the information from the email received and perform research!
Notice how Lindy met the exit condition, therefore moved onto the next step, and created a new Hubspot Contact, using information found from the AI Agent’s research.
Using Multiple Exit Conditions: You can use more than one exit condition to tell Lindy when to leave the AI Agent step and move on to the next steps.
In the example below, we’ll add another exit condition in case the AI Agent fails to find all of the requested information about the contact. In this case, Lindy will exit the AI Agent step and send the user a Slack message.
Click “Add Step” beside the original exit condition.
Click “Perform an action” and select the “Slack Send Direct Message” action.
Define the second exit condition by clicking “Define a condition”
Add the condition prompt:
attempted to perform all requested research on the emailer but failed to find all the information requested
Configure the Slack Direct Message action by switching the “User” field to “Set Manually” mode and inserting your email address or Slack ID.
Add a prompt to the “Message” field instructing Lindy to send you an alert.
Example prompt:
Alert me that you could not find enough information to update my CRM, and include context from the email received.
Because we still want Lindy to create a Hubspot Contact, drag the grey arrow after the “After message sent” pill to the Hubspot Create Contact step.
The step will be highlighted blue, indicating you have connected the Slack Send Direct Message step to the Hubspot Create Contact step.
Your done! You created a powerful Lindy that uses an AI Agent to perform research and gather information on your emailers.
AI Agent's Concluded AI Agents are powerful but require thoughtful configuration! When used correctly with a clear prompt, relevant skills, and proper exit conditions, they can handle complex tasks and decision-making within your workflow.
Remember that while AI Agents introduce more complexity than standard actions, they're best suited for situations where you need adaptive, intelligent responses to uncertain inputs.