Time to complete: 5 minutes
Difficulty: Beginner
What you’ll build: An AI email assistant that automatically responds to inquiries

Building Your First Agent

In this guide, you’ll learn how to build your first AI email assistant. This will take less than five minutes, and after you’re done, you’ll have an email responder (because no one loves to answer emails themselves). You’ll create an AI agent that:
  1. Monitors your Gmail for incoming emails
  2. Filters emails intelligently using conditions to identify business inquiries
  3. Searches your knowledge base (your website) for relevant information
  4. Automatically responds with helpful, accurate information
  5. Keeps you in the loop by BCC’ing you on all responses

Overview

Here’s exactly what we’ll do:
1

Create agent & add trigger

Create a new Lindy agent and add a Gmail trigger to monitor incoming emails
2

Add condition

Add a condition to filter for business inquiries
3

Add knowledge base & actions

Add your website as a knowledge base and configure Gmail actions for automated replies
4

Test & monitor

Test your agent with a real email and monitor its performance
Let’s get started!

Step 1: Create a New Lindy & Add a Trigger

Click the “New Lindy” button below Home in the top left of your workspace to begin building your AI agent.
Create a new Lindy
Click “Start from scratch” to create a new AI agent.
Start from scratch option
Now let’s add the trigger. Triggers wake up your AI agent when something happens, like getting a new email. Learn more about triggers.
Use filters to make your triggers more specific and reduce costs. Learn about cost optimization.

Setting up the Email Trigger

Steps:
  1. Click “Select Trigger”
  2. Click Gmail
  3. Add the Email Received trigger
  4. Connect the Gmail account you want your AI agent to monitor

Step 2: Add a Condition

What are conditions? Conditions let you define different paths in your automation based on specific criteria. They help your AI agent make smart decisions about which emails to respond to.
Now that your AI agent wakes up with every email, let’s set a condition to define which emails deserve a response. Click the Condition step under Perform an action and Search knowledge base.
Add condition step

Configure Your Condition

Lindy will only proceed to the next step if the condition is met. Each condition begins with Go down this path if... Set your condition prompt to:
the emailer is asking a question about my service, product, or company
With this prompt, your AI agent will only continue if it receives relevant business inquiries.
Condition prompt configuration

Step 4: Add a Knowledge Base & Actions

The Knowledge Base is a repository of data from which your AI agent retrieves information. AI agents search through knowledge bases semantically, finding results whose meaning is similar, even if the exact text doesn’t match.For example, searching for “refunds” will also find entries related to “returns.”
Now we’ll give your AI agent knowledge about your business so it knows how to respond accurately.
  1. Click “Add step” and select “Search knowledge base”
  2. Click “Website”
  3. Enter your company website URL and click “Crawl”
Your agent will now have access to all your website content to answer questions accurately.

Add an Action

Actions are tasks your AI agent performs, such as replying to emails, updating a HubSpot CRM, or creating a Notion page.
Your AI agent now receives emails and searches your website for relevant information. The final step is configuring how it responds. Click “Add step” (the blue plus sign beneath the Knowledge Base) and select “Perform an action.”
Add action step
Click the Gmail action in the ´Linked Actions´ section to ensure your AI agent responds in the same email thread. Select “Gmail Send Reply” to configure your response action.

Configure Your Response

Now customize how your AI agent crafts responses using your knowledge base.
  1. Ensure the Body field is set to “Prompt AI”
  2. Add this prompt to instruct your AI agent:
You are a competent email responder that will use context from a knowledge base 

to succinctly respond to emailers' questions about my service, product, or company. 

ONLY respond with exact information extracted from the knowledge base and keep 

emails friendly and informative. Never more than 3 sentences.
The “Reply To” field defaults to “All,” ensuring your AI agent responds to the sender and anyone else included in the email thread.
Gmail reply configuration
Pro tip: BCC yourself on responses to monitor your AI agent’s performance.Set the BCC field to “Set Manually” and enter your email address. This gives you visibility into all responses without cluttering the recipient’s inbox.

Step 6: Test Your Agent

Time to see your AI agent in action!
  1. Click the Save button to save your workflow
  2. Send yourself a test email from a different address (personal email works great) with a question about your business
  3. Click “Test Mode” and select your test email
Test mode interface
  1. Watch as your AI agent processes the email and generates a response
Test results showing condition path
Remember: Improve your agent over time by reviewing its responses regularly and adjust the prompt to better match your communication style.

Bonus Step: Name and Monitor Your Agent

Give your AI agent a memorable name that reflects its purpose. Once enabled, click “Tasks” to view your AI agent’s activity history and monitor its performance.

Congratulations!

You’ve successfully built your first AI agent! Here’s what you accomplished:
  • ✅ Created an AI agent from scratch
  • ✅ Connected it to your Gmail account
  • ✅ Set up intelligent email filtering with conditions
  • ✅ Added a knowledge base for accurate responses
  • ✅ Configured automated email responses
  • ✅ Tested it with real data

Take It Further

Your email assistant is just the beginning. AI agents can triage emails, pre-draft responses, alert you on Slack, create reminders, send follow-ups, and much more.