Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
An inbound lead qualification and research agent template built with Next.js, AI SDK, Workflow DevKit, and the Vercel Slack Adapter.
Lead Agent is an open-source reference architecture from Vercel Labs for an inbound lead qualification and research agent, built on Next.js 16, the Vercel AI SDK, Workflow DevKit, and the Vercel Slack Adapter. It turns a contact-sales form submission into a durable background workflow that researches the lead, scores them, drafts a personalized email, and routes the email for human approval in Slack before sending.
Lead Agent is a template application that captures a lead in a contact sales form and immediately returns a success response, then runs a qualification workflow in the background. It uses Workflow DevKit for durable tasks, the AI SDK Agent class with Exa.ai web search for deep research, generateObject to categorize leads into classes such as QUALIFIED, FOLLOW_UP, and SUPPORT, and generateText to write the response email. The entire pipeline is hosted on Vercel's AI Cloud, and the repository is maintained under vercel-labs with an MIT license.
workflows/inbound/steps.ts.generateObject with OpenAI models to classify leads and provide reasoning; the qualification category schema is editable in lib/types.ts.queryKnowledgeBase placeholder and Exa.ai search to gather information about the lead.@vercel/slack-bolt to handle Slack events in a serverless environment, with a manifest.json for app configuration.lib/services.ts, add qualification categories via schema changes, and create new workflows for other outreach flows.Lead Agent is aimed at development teams building sales automation and lead-handling systems. Sales engineers can fork the repo and adapt the qualification categories, prompts, and research tools to their business. Technical founders can deploy the one-click Vercel button with the required environment variables to stand up a lead-qualification pipeline in minutes. Organizations with a Slack workspace can plug in their own bot token and signing secret to get human review for outbound emails.
qualificationCategorySchema to add or change lead categories (for example, adding tiered enterprise vs. SMB buckets) and see reasoning on each decision.queryKnowledgeBase placeholder so the research agent can search company documentation or historical lead data alongside Exa.ai web search.lib/services.ts to change how deeply the agent researches or how strictly it qualifies.The flow is documented in the architecture diagram: a user submits the form, the /api/submit endpoint starts a workflow with Workflow DevKit, then the research agent gathers context, the qualification step categorizes the lead, the email step drafts a message, the Slack integration asks for approval, and on approval the email is sent. Slack events, including approve/reject clicks, are received by the /api/slack webhook. If Slack environment variables are not set, the application still runs with the Slack bot disabled.
Yes, the repository is open source under the MIT license. You can clone it and deploy it to your own Vercel account, paying only for the underlying AI and Slack services you configure.
The one-click Vercel deployment asks for AI_GATEWAY_API_KEY, SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, SLACK_CHANNEL_ID, and EXA_API_KEY. Without the Slack variables the app runs but Slack approvals are disabled.
It requires Node.js 20+ and uses pnpm (or npm). It uses Next.js 16, the Vercel AI SDK with AI Gateway, Workflow DevKit for durable execution, and Exa.ai for web search.
No, the generate-email step is deliberately gated by human approval in Slack. An operator sees the proposed email with Approve/Reject buttons; the sending step only proceeds when an approval event is received.
