How to Use AI Agents for Lead Generation: Find Prospects and Draft Personalized Emails
Learn how to use AI agents to research leads, personalize cold emails at scale, and save drafts directly to Gmail without manual effort.

The Problem with Manual Lead Generation
Cold outreach at scale is broken — not because the strategy is wrong, but because the execution is almost always either too slow or too generic.
Sales teams spend hours researching prospects, only to send emails that feel like they were written for no one in particular. Or they send personalized messages but can’t do it fast enough to build real pipeline. AI agents for lead generation solve both sides of this problem — research at scale, personalization that actually lands.
This guide walks through exactly how to use AI agents to find prospects, research them, draft personalized cold emails, and save those drafts directly to Gmail — without touching each one manually.
Why AI Agents Work Better Than Simple Automation for Lead Gen
Traditional automation tools can do repetitive tasks: copy a row from a spreadsheet, send a templated email, log a response. But lead generation requires reasoning — reading a company’s website, inferring what pain point they might have, deciding what angle to use in an email. That’s not a trigger-action workflow. That’s an agent.
An AI agent for lead generation can:
- Search for leads matching specific criteria (company size, industry, recent news, job postings)
- Visit a prospect’s website or LinkedIn profile and extract relevant details
- Synthesize what it finds into a coherent understanding of the company’s situation
- Write a personalized email that references something specific and relevant
- Save a draft to Gmail — or send it directly — without any manual step
Remy is new. The platform isn't.
Remy is the latest expression of years of platform work. Not a hastily wrapped LLM.
The difference between an automation and an agent is that an agent can handle ambiguity. If the prospect’s website doesn’t have a pricing page, the agent doesn’t break — it just infers what it can from what’s available.
What a Lead Generation AI Agent Actually Does
Before building anything, it helps to understand what these agents look like in practice.
The Core Workflow
A lead generation agent typically runs through four steps:
- Intake — Receive a list of leads (names, companies, LinkedIn URLs, or domains) from a spreadsheet, CRM, or manual input.
- Research — For each lead, gather context: what the company does, recent news or announcements, the prospect’s role and tenure, any relevant signals (job postings, funding rounds, product launches).
- Drafting — Use the research to write a personalized email that makes a specific, relevant point — not a generic “I thought you might be interested in…”
- Delivery — Save the draft to Gmail, push it to a CRM, or send it directly, depending on how much human review you want in the loop.
This loop can run on a schedule, be triggered by a webhook, or be kicked off manually. The agent handles every step in between.
What Good Personalization Actually Looks Like
The bar for “personalization” is higher than most people think. Putting someone’s first name in the subject line isn’t personalization — it’s a mail merge.
Real personalization means the email references something specific: a recent product launch, a funding announcement, a job posting that signals a pain point, something the person wrote or said publicly. When a prospect reads it, they should feel like someone actually looked them up — because the agent did.
Good personalized emails tend to share a few traits:
- One specific reference to something real about the company or person
- A clear connection between that detail and why you’re reaching out
- A short, low-friction ask
- No jargon, no buzzwords, no lengthy pitch
AI agents can write to this standard consistently — once you’ve tuned the prompt correctly.
Step 1: Define Your Ideal Lead Profile
The agent is only as good as the criteria you give it. Before building anything, get specific about who you’re targeting.
Questions to Answer Before You Build
- What industry or industries are you targeting?
- What company size (employees, revenue, funding stage)?
- What role should the prospect hold?
- Are there any signals that indicate a good time to reach out (new hire, recent funding, new product, job posting for a relevant role)?
- What problem does your product or service solve for them?
- What’s your ask — a demo, a reply, a call?
Write these down. You’ll use them to write the agent’s research and drafting prompts.
The more specific your criteria, the better the agent’s output. “B2B SaaS companies with 50–200 employees that recently posted a Head of Sales role” produces far better results than “technology companies.”
Step 2: Build the Research Layer
The research layer is where the agent gathers information about each prospect. This is what separates a good cold email from a great one.
What to Research
For each lead, the agent should collect:
Company-level:
- What the company does (in plain terms)
- Recent news, announcements, or funding
- Current job postings (especially leadership or growth roles)
- Any obvious pain points suggested by their product category or size
Other agents ship a demo. Remy ships an app.
Real backend. Real database. Real auth. Real plumbing. Remy has it all.
Individual-level:
- The prospect’s current role and how long they’ve been there
- Any recent activity — posts, talks, articles, interviews
- Career background that’s relevant to your pitch
How the Agent Gathers This
In practice, the agent uses a combination of:
- Web search — to find recent news, funding announcements, press releases
- Website scraping — to read the company’s homepage, about page, and product pages
- LinkedIn data — to understand the prospect’s role and background (either via API or an enrichment tool)
- CRM data — to pull any context that already exists about the account
The agent synthesizes everything it finds into a structured summary — company snapshot, role context, recent signals — that then gets passed to the drafting step.
Step 3: Write the Personalized Email Prompt
The drafting step is where the real work happens. You’re not writing an email — you’re writing a prompt that teaches an AI agent how to write emails the way you would.
Anatomy of a Good Email Drafting Prompt
A strong prompt for cold email drafting should include:
Instructions about structure:
- Subject line guidelines (length, format, personalization)
- Email length (shorter is almost always better — 80–120 words for the body)
- What to include in each paragraph
Instructions about tone:
- How formal or casual to be
- What to avoid (no jargon, no vague value claims, no long intros)
- What the email should feel like to the reader
The specific inputs the agent should use:
- What company detail to reference
- What signal to connect it to
- What your product/service does
- What the ask is
Examples (few-shot prompting):
- Include 2–3 examples of good emails you’ve already written
- Include at least one “bad” example with a note about why it doesn’t work
The more examples you include, the more the agent learns your voice and standards. Don’t skip this step.
Example Email Drafting Prompt (simplified)
You are writing a cold outreach email on behalf of [Company].
Use the following information about the prospect:
- Company: {company_name}
- Prospect name: {first_name}, {title}
- Company description: {company_summary}
- Recent signal: {recent_signal}
Write a short, conversational cold email that:
1. Opens with a specific reference to {recent_signal}
2. Makes a clear, one-sentence connection to how we help companies like theirs
3. Ends with a low-friction ask (e.g., "Worth a quick chat?")
4. Is 80–120 words total
5. Sounds like a real person wrote it, not a template
Do not include generic phrases like "I hope this finds you well" or "I wanted to reach out."
Iterate on this prompt until the emails consistently sound the way you want them to.
Step 4: Save Drafts to Gmail
Once the agent has drafted the email, the next step is getting it into your inbox so you can review, tweak, and send — or skip the review entirely if you trust the output.
Using Gmail’s Draft API
Most AI agent platforms — including MindStudio — have native Gmail integrations that can create drafts programmatically. The agent sends the following to Gmail:
- To: prospect’s email address
- Subject: the generated subject line
- Body: the generated email body
- Optional: a tag or label so you can find all agent-drafted emails quickly
Built like a system. Not vibe-coded.
Remy manages the project — every layer architected, not stitched together at the last second.
The draft shows up in your Gmail Drafts folder exactly as if you’d typed it. You can open it, make any edits, and send — or you can set the agent to send automatically if you want to remove the human review step.
Human Review vs. Full Automation
Most teams start with human review in the loop. The agent drafts, you approve. As you get confident in the output quality, you can move toward automated sending for lower-stakes outreach.
A good middle ground: the agent drafts and saves to Gmail, but flags any email that falls below a confidence threshold (or where it couldn’t find a strong personalization signal) for manual review. Everything else goes to a “ready to send” queue.
Step 5: Handle Edge Cases and Quality Control
No agent gets every email right. Building in quality control saves you from sending bad emails at scale.
Common Edge Cases to Plan For
- No personalization signal found — The agent should default to a more general template (still relevant, just less specific) rather than making something up.
- Incorrect company information — If research pulls outdated data, the email might reference something no longer true. Consider adding a verification step or flagging low-confidence research.
- Wrong contact — If the lead list has wrong titles or roles, the email angle might not fit. Build in a step to validate the prospect’s current role before drafting.
- Unsubscribes or bounces — The agent should check against a suppression list before drafting or sending.
Building a Feedback Loop
The best lead generation agents improve over time. Set up a simple way to log which emails got replies and which didn’t. Feed winning emails back into your prompt as examples. Over a few weeks, the output quality climbs steadily.
How to Build This in MindStudio
MindStudio is one of the most straightforward ways to build a lead generation AI agent without writing any code. The platform’s visual workflow builder lets you connect research steps, AI drafting, and Gmail in a single automated flow.
Here’s how the workflow looks in practice:
Setting Up the Research Step
MindStudio has built-in web search and browsing capabilities, so the agent can search for company news, visit websites, and pull relevant information without external API setup. You drop in a “Search Google” block, pass the company name and relevant search queries, and the agent returns structured results.
From there, a “Browse URL” block lets the agent read the company’s website and extract key details. All of this runs automatically for every lead in your list.
Configuring the Drafting Step
The drafting step uses one of MindStudio’s 200+ available models — GPT-4o, Claude, and others are available out of the box without separate API keys. You write your prompt once (following the structure above), wire in the research outputs as variables, and the model generates a personalized draft for each prospect.
Connecting to Gmail
MindStudio’s Gmail integration lets the agent save drafts directly. You configure it once — connect your Gmail account, map the subject and body fields — and every email the agent writes lands in your Drafts folder automatically.
Remy doesn't write the code. It manages the agents who do.
Remy runs the project. The specialists do the work. You work with the PM, not the implementers.
The full workflow — from lead list input to Gmail draft — typically takes 15–30 minutes to build for the first time. After that, it runs on its own.
Running the Agent
You can trigger the workflow manually (upload a CSV of leads, hit run), on a schedule (process new leads every morning at 7am), or via webhook (a new lead enters your CRM, the agent kicks off automatically). MindStudio supports all three without additional configuration.
You can try MindStudio free at mindstudio.ai — no API keys or setup required.
If you’re curious how AI agents handle more complex multi-step workflows, this overview of agentic automation covers how chained agent actions work in practice.
Integrating with Your CRM
For most sales teams, the workflow doesn’t stop at Gmail. Leads need to be tracked, email activity needs to be logged, and sequences need to be managed.
Connecting to HubSpot or Salesforce
MindStudio — and most robust AI agent platforms — offer direct integrations with major CRMs. When the agent creates a Gmail draft, it can simultaneously:
- Log the contact in HubSpot with relevant notes from the research
- Create a task for follow-up
- Tag the lead with a campaign or sequence name
- Update the deal stage if the account already exists
This keeps your CRM accurate without any manual data entry.
Logging Email Activity
Some teams prefer to keep all email tracking inside their CRM’s native email tool (HubSpot Sales, Salesforce Inbox, Outreach, etc.) rather than Gmail. In that case, the agent can push the draft to the CRM’s email composer instead of Gmail Drafts — the logic is the same, just a different destination.
What to Measure
Building the agent is only half the work. The other half is measuring whether it’s actually producing pipeline.
Metrics That Matter
Reply rate — The primary signal for email quality. If reply rates are below 5–10% for cold outreach, the personalization or targeting needs work. Industry benchmarks from various studies suggest 3–7% is typical for generic cold email; well-personalized emails often reach 15–25%.
Positive reply rate — Not all replies are good. Separate “interested” from “remove me.” A high reply rate with mostly negatives means the targeting is off.
Time saved — Track how long each email used to take to research and write manually, vs. agent-assisted output. Most teams report saving 2–4 hours per 50 leads.
Emails reviewed vs. sent unedited — As the agent improves, you should see more emails sent with little or no editing. Track this as a proxy for output quality.
Frequently Asked Questions
Can AI agents actually write emails that don’t sound like AI wrote them?
Yes — with the right prompt. The key is specificity. Agents that write generic emails sound generic. Agents that are given specific research, a clear voice, and concrete examples to learn from produce emails that read like a smart human wrote them. Few-shot examples in your prompt make a significant difference. Also: shorter emails tend to sound more human. Long AI-generated pitches are easy to spot.
How do I get a list of leads to feed into the agent?
One coffee. One working app.
You bring the idea. Remy manages the project.
Several ways. You can export contacts from your CRM, use a tool like Apollo, Clay, or LinkedIn Sales Navigator to build a targeted list, or have the agent itself search for leads based on criteria you define. The most common starting point is a CSV with company name, prospect name, role, and either a LinkedIn URL or company domain — the agent handles the research from there.
Is it legal to use AI to send cold emails?
Cold email is legal in most jurisdictions when you follow applicable rules. In the US, CAN-SPAM applies — you need a physical address in the footer, an opt-out mechanism, and accurate header information. In the EU and UK, GDPR and PECR apply stricter requirements for B2C outreach; B2B outreach has more flexibility. The AI part doesn’t change the legal framework — the same rules apply whether a human or an agent wrote the email. Always include unsubscribe functionality and maintain a suppression list.
How do I make sure the agent doesn’t send emails to the wrong person or with wrong information?
Build in a human review step, at least initially. Save to Gmail Drafts first, review a sample, and only move to automated sending once you’re confident in the output. You can also add a validation step inside the agent that checks whether research confidence is high enough before proceeding to draft — if the agent can’t find a clear personalization signal, it flags the lead for manual review instead.
How many emails can an AI agent process at once?
It depends on your setup and rate limits. In MindStudio, agents can process batches of leads sequentially or in parallel. For most teams, processing 50–200 leads at a time is practical. If you’re targeting thousands of leads daily, you’ll want to set up the agent to run in chunks across multiple scheduled runs, and make sure your email sending domain is properly warmed up to avoid deliverability issues.
Do I need to know how to code to build one of these agents?
No. Platforms like MindStudio are built specifically so non-technical users can create agents through a visual interface. You define the steps, write the prompts, and connect the integrations — no code required. If you want to add custom logic (like a complex lead-scoring formula), you can write a short JavaScript or Python function inside the builder, but it’s not necessary for a standard lead generation workflow.
Key Takeaways
- AI agents for lead generation handle research, drafting, and delivery — tasks that used to require hours of manual work per batch.
- Good personalization requires real research. The agent needs to find a specific, relevant signal — not just fill in a name template.
- The email prompt is the most important thing to get right. Include structure instructions, tone guidance, and concrete examples.
- Building in a human review step (Gmail Drafts) before full automation is a smart way to start.
- Quality improves over time — log which emails got replies and feed winners back into your prompt.
- MindStudio lets you build this entire workflow visually, with Gmail and CRM integrations included, and free to start.
If you want to see what an AI-powered sales workflow looks like end to end, explore how MindStudio’s automation workflows handle multi-step processes across tools — and give the free plan a try to build your first agent.





