Skip to content

Repository files navigation

GTM Lead Agent

An AI pipeline for inbound leads: research each company with Exa, score it against your ICP with Claude, log everything to a Google Sheet, and drop a personalized outreach draft in Gmail.
Built on One. Nothing is ever sent automatically.

Website  ·  Docs  ·  Dashboard


What it does

Give it a lead (or a CSV of leads) and for each one it:

  1. Researches the company with Exa: what they do, recent news, funding, launches.
  2. Scores the lead 1-10 against your ICP (you describe it in plain English in config/icp.md) using Claude, with a written rationale and talking points.
  3. Logs the row to a Google Sheet your whole team can see: score, rationale, talking points, sources.
  4. Drafts the outreach email in your Gmail drafts folder, personalized with a concrete detail from the research. It never sends; you review and hit send.

All three platform calls (Exa, Sheets, Gmail) go through One, so there is exactly one auth setup and one SDK instead of three API integrations.

$ npm start -- leads.example.csv

Processing 3 leads

── jane@ramp.com
   researched ramp.com: 5 sources
   fit 7/10: Ramp is a fintech building AI agents into their product...
   gmail draft created (r880107...)
   logged to sheet

Setup (about 5 minutes)

1. Connect your accounts through One

npm i -g @withone/cli
one init          # create an account or log in
one add exa
one add google-sheets
one add gmail

2. Configure this repo

git clone https://github.com/withoneai/gtm-lead-agent
cd gtm-lead-agent
npm install
cp .env.example .env

Fill in .env:

  • ONE_SECRET: your One API key (in ~/.one/config.json after one init, or the dashboard)
  • ANTHROPIC_API_KEY: from platform.claude.com
  • The three connection keys: run one --agent list and copy the key for exa, google-sheets, and gmail

3. Create your lead log sheet

npm run setup

This creates a spreadsheet with the right headers and prints the LEADS_SHEET_ID line to paste into .env.

4. Describe your ICP

Edit config/icp.md. It ships with an example; replace it with your product, your ideal customer, and your email voice. The scoring model reads this file verbatim, so plain English is exactly right.

Usage

# a CSV with an email column (name, company, notes optional)
npm start -- leads.csv

# a single lead
npm start -- --email jane@acme.com --name Jane --notes "asked about pricing"

# see the assessment and draft without writing anything
npm start -- --email jane@acme.com --dry-run

Behavior worth knowing:

  • Drafts are only created for leads scoring 5+. Everything is logged to the sheet either way.
  • Leads on free email providers (gmail.com etc.) with no company name skip research and cap at 4/10.
  • --dry-run prints the score and the drafted email to the terminal and writes nothing.

How it's built

Step Platform How
Research Exa @withone/sdk typed action exa.search
Scoring + drafting Claude (claude-opus-5) @anthropic-ai/sdk structured outputs (Zod schema)
Lead log Google Sheets @withone/sdk googleSheets.appendValuesSpreadsheetRange
Outreach draft Gmail @withone/sdk gmail.createUsersDraft

~400 lines of TypeScript in src/. The One SDK handles auth, request signing, and retries for every platform call; swapping Sheets for HubSpot or adding Slack notifications is a few lines because the SDK types 30+ platforms the same way.

Extending it

  • Different CRM: @withone/sdk ships typed actions for HubSpot, Airtable, Notion, and more. Replace src/sheet.ts.
  • Trigger on form submits: wire your form webhook to run npm start -- --email ....
  • Slack alerts for hot leads: after scoring, post 8+ leads to a channel via the One Slack actions.

License

MIT

About

An AI lead research and outreach pipeline: Exa research, Claude scoring, Google Sheets logging, Gmail drafts. Built on One.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages