Quickstart

Build your first AI email assistant in under 5 minutes

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:

  • Monitors your Gmail for incoming emails
  • Filters emails intelligently using conditions to identify business inquiries
  • Searches your knowledge base (your website) for relevant information
  • Automatically responds with helpful, accurate information
  • 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 UnicornSurf 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!

Follow the steps below to build your first AI agent.

Step 1: Create a New Agent & Add a Trigger

Click the "New Agent" button below Home in the top left of your workspace to begin building your AI agent.

Create a new agent

Click "Start from scratch" to create a new AI agent.

Create New Agent

Setting up the Email Trigger

Now let's add the trigger. Triggers wake up your AI agent when something happens, like getting a new email.

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 underPerform an action andSearch knowledge base.

Configure Your Condition

UnicornSurf will only proceed to the next step if the condition is met. Each condition begins withGo down this path if...Set your condition prompt to:

Condition Prompt
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.

Step 3: Add Knowledge Base & Actions

The Knowledge Base

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."

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:

AI Prompt
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.

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 4: 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

Test Mode Active
Email received and processed
Condition evaluated: Business inquiry detected
Knowledge base searched
Response generated and sent

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.

Agent Dashboard

Monitor your agent's performance and activity

24
Emails Processed
18
Responses Sent
75%
Success Rate

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.

Email Assistant

Advanced email automation with triage and smart responses

Meeting Scheduler

Automate meeting coordination and calendar management

Customer Support

Build a complete support ticket system