Skip to content

AI-powered lead qualification chatbot. Conversational AI that qualifies, scores, and routes leads to your CRM via webhooks.

License

Notifications You must be signed in to change notification settings

dome317/lead-intelligence-bot

Repository files navigation

lead-intelligence-bot

AI-powered lead qualification chatbot. Conversational AI that qualifies, scores, and routes leads to your CRM via webhooks.

Claude API | Make.com / n8n integration | CRM routing | Slack alerts

Next.js Claude API TypeScript License: MIT


Features

  • Conversational Lead Qualification — AI agent asks qualifying questions naturally, not as a form
  • Configurable Scoring Rules — Define your own scoring weights and thresholds in config/scoring.json
  • Webhook Integration — Forward qualified leads to Make.com, n8n, or Zapier workflows
  • CRM Routing — Automatically create contacts in HubSpot, Salesforce, or any CRM via webhooks
  • Slack/Teams Notifications — Instant alerts when a HOT lead comes in
  • Lead Scoring Dashboard — Real-time dashboard showing all leads, scores, and activity feed
  • Video Avatar Mode — Optional real-time video avatar with voice (via Anam AI)
  • Streaming Responses — Claude API streaming for instant, natural-feeling conversation

Architecture

graph LR
    A[User Chat] --> B[Claude API]
    B --> C[Scoring Engine]
    C --> D[Webhook]
    D --> E[CRM]
    D --> F[Slack Notification]
    C --> G[Dashboard]
Loading

Flow:

  1. User starts a conversation via text chat or video avatar
  2. Claude API handles the conversation using your custom system prompt
  3. After sufficient qualifying data is collected, the scoring engine extracts and scores the lead
  4. Scored lead is forwarded via webhook to your automation platform
  5. CRM contact is created and sales team is notified

Quick Start

1. Clone & Install

git clone https://github.com/your-username/lead-intelligence-bot.git
cd lead-intelligence-bot
npm install

2. Configure Environment

cp .env.example .env.local

Edit .env.local with your API keys:

ANTHROPIC_API_KEY=sk-ant-api03-your-key-here

3. Customize Questions & Scoring

Edit the configuration files in config/:

4. Run Development Server

npm run dev

Open http://localhost:3000 to see the landing page. Open http://localhost:3000/dashboard to see the lead dashboard.

5. Deploy

npx vercel

Or deploy to any platform that supports Next.js (Vercel, Railway, Netlify, etc.)


Customization

System Prompt

Edit src/lib/system-prompt.ts to customize the AI agent's personality, knowledge base, and conversation flow. The default prompt follows a 4-phase structure:

  1. Rapport — Greet and build trust
  2. Qualify — Ask qualifying questions one at a time
  3. Recommend — Summarize and recommend next step
  4. Capture — Collect name and email

Qualifying Questions

Edit config/questions.json to define what your bot asks:

{
  "questions": [
    {
      "id": "challenge",
      "question": "What's your primary business challenge?",
      "weight": 2
    }
  ]
}

Scoring Rules

Edit config/scoring.json to tune lead scoring:

{
  "thresholds": { "hot": 8, "warm": 5, "cold": 1 },
  "weights": {
    "budget_match": 3,
    "timeline_urgency": 2,
    "pain_point_clarity": 2
  }
}

Webhook Integration

See docs/webhooks.md for setup guides for Make.com, n8n, and Zapier.


Tech Stack

Technology Purpose
Next.js 16 Full-stack React framework
Claude API Conversational AI (streaming)
Upstash Redis Serverless lead storage
Anam AI Video avatar (optional)
Make.com / n8n Workflow automation
HubSpot CRM integration
Slack API Team notifications
Tailwind CSS Styling
Vercel Deployment

Project Structure

src/
├── app/
│   ├── page.tsx              # Landing page with demo
│   ├── dashboard/page.tsx    # Lead scoring dashboard
│   └── api/
│       ├── chat/route.ts     # Claude streaming chat endpoint
│       ├── extract-lead/     # Lead extraction & scoring
│       ├── leads/            # Lead retrieval endpoint
│       └── anam-session/     # Video avatar session
├── components/
│   ├── chat-widget.tsx       # Text chat interface
│   ├── demo-section.tsx      # Demo mode selector
│   └── anam-avatar.tsx       # Video avatar interface
└── lib/
    ├── system-prompt.ts      # AI agent system prompt
    └── leads-store.ts        # Lead storage (Redis/memory)

License

MIT License. See LICENSE for details.

About

AI-powered lead qualification chatbot. Conversational AI that qualifies, scores, and routes leads to your CRM via webhooks.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •