Transform your RB2B visitor data into actionable leads by automatically:
- 🎯 Scoring companies against your Ideal Customer Profile (ICP)
- 👤 Identifying buyer personas from website behavior
- 🤖 Using AI (Ollama) to analyze intent and buying stage
- 🔍 Finding alternative contacts via LinkedIn when needed
- 📧 Generating personalized outreach emails based on buying stage
- Smart Lead Scoring: AI-powered ICP fit analysis (A/B/C/D tiers)
- Persona Detection: Identifies Economic Buyers, Technical Evaluators, Researchers
- Buying Stage Intelligence: Classifies leads into Educate/Explore/Evaluate/Purchase stages
- LinkedIn Integration: Automatically finds better-fit contacts at target companies
- Email Generation: Creates stage-appropriate outreach emails
- Beautiful Dashboard: Modern React UI to review and act on leads
- Local & Private: Runs entirely on your machine using Ollama
# Clone the repository
git clone https://github.com/yourusername/automate-rb2b.git
cd automate-rb2b
# Run the setup script
chmod +x setup.sh
./setup.shThe setup script will:
- ✓ Check prerequisites
- ✓ Install all dependencies
- ✓ Pull the llama3 model
- ✓ Create database and seed demo data
- ✓ Configure environment
ollama servenpm run devThis starts both the backend (port 3001) and frontend (port 3000).
Navigate to http://localhost:3000
When you first open the app, you'll see an onboarding wizard with two options:
- Use Demo Configuration - Instantly set up with sample ICP and demo leads
- Configure Manually - Define your own ICP criteria
Go to ICP Config to set up your Ideal Customer Profile:
- Industries: Target verticals (SaaS, E-commerce, etc.)
- Company Size: Employee count range
- Regions: Geographic focus
- Target Job Titles: Decision-maker personas (VP Engineering, CTO, etc.)
- Tech Stack: Technology indicators (AWS, Kubernetes, etc.)
- Pain Points: Problems your solution solves
For Local Development: Use ngrok to expose your local server to the internet.
📖 See detailed ngrok setup guide →
Quick setup:
# Install ngrok
brew install ngrok/ngrok/ngrok
# Start ngrok tunnel
ngrok http 3001
# Copy the forwarding URL (e.g., https://abc123.ngrok-free.app)
# Configure in RB2B as: https://abc123.ngrok-free.app/api/webhook/rb2bFor Production: Deploy to a server and configure your RB2B webhook to point to:
https://your-domain.com/api/webhook/rb2b
The system will automatically:
- Receive the webhook
- Score the company against your ICP
- Analyze persona and buying stage
- Search LinkedIn for alternative contacts (if needed)
- Generate personalized outreach emails
- Display in dashboard
Click "Generate Demo Lead" in the dashboard to create test leads without real RB2B data.
The dashboard shows:
- Company name and domain
- ICP fit score (A/B/C/D tier)
- Detected persona and buying stage
- Whether persona matches your target
- Recommended next action
Click any lead to see:
- Full visitor journey (pages visited)
- Detailed scoring explanation
- Alternative contacts from LinkedIn
- Generated outreach emails (ready to copy)
When a lead doesn't match your target persona, click "Find on LinkedIn" to:
- Search for employees at that company
- Filter by your target job titles
- Score persona fit for each contact
- Generate emails for high-fit contacts
Note: LinkedIn scraping requires you to be logged into LinkedIn in the browser window that opens.
This repository includes example code that demonstrates how one might automate discovery of alternative contacts (e.g., via LinkedIn) for learning and illustration purposes only.
- Do not scrape LinkedIn or any website in violation of its Terms of Service.
- Always prefer official APIs, partner programs, or first‑party integrations where available.
- Obtain all required permissions and consent before collecting or processing personal data.
- Respect robots.txt, rate limits, and applicable laws and regulations (e.g., GDPR/CCPA).
- This project’s authors and contributors are not responsible for misuse. You are solely responsible for how you use these examples in your environment.
If you plan to use similar functionality in production, replace any scraping logic with compliant, supported integrations and follow your legal counsel’s guidance.
If you prefer to set up manually:
# Install dependencies
npm install
cd backend && npm install && cd ..
cd frontend && npm install && cd ..
# Pull Ollama model (smaller & faster)
ollama pull llama3.2:3b
# Seed demo data
npm run seed-demo
# Start the app
npm run devnpm run dev- Start both backend and frontendnpm run dev:backend- Start backend only (port 3001)npm run dev:frontend- Start frontend only (port 3000)npm run seed-demo- Seed database with demo datanpm run test-webhook- Send a test webhook to the backendnpm run setup- Run setup wizard
- Webhook Receiver: Processes RB2B data
- Lead Processor: Orchestrates scoring pipeline
- Ollama Service: AI-powered analysis
- LinkedIn Scraper: Finds alternative contacts
- SQLite Database: Stores leads and emails
- Dashboard: Lead list with filters
- ICP Config: Dynamic configuration UI
- Lead Detail: Full lead intelligence view
- Components: Reusable UI elements
- ICP fit scoring
- Persona inference
- Buying stage detection
- Personalized email generation
POST /api/webhook/rb2b- Receive RB2B webhookGET /api/leads- List all leadsGET /api/leads/:id- Get lead detailsPOST /api/leads/:id/rescore- Re-analyze a leadPOST /api/scrape-linkedin/:leadId- Find LinkedIn contactsGET /api/config/icp- Get ICP configurationPOST /api/config/icp- Save ICP configurationGET /api/health- System health check
Make sure Ollama is running:
ollama serveCheck if llama3 model is installed:
ollama list
ollama pull llama3 # if not installedReset the database:
rm backend/data/leads.db
npm run seed-demoChange ports in:
- Backend:
backend/.env(PORT=3001) - Frontend:
frontend/vite.config.js(port: 3000)
- Make sure you're logged into LinkedIn in your browser
- The browser window will persist login between sessions
- Rate limiting: Don't scrape too many companies too quickly
Edit backend/.env:
PORT=3001
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3
DATABASE_PATH=./data/leads.dbYou can use other models like mistral or llama2:
ollama pull mistralUpdate backend/.env:
OLLAMA_MODEL=mistral
- Webhook Received: RB2B sends visitor data
- ICP Scoring: Ollama analyzes company fit (0-100 score)
- Persona Detection: Classifies visitor based on pages viewed
- Stage Analysis: Determines buying stage (Educate/Explore/Evaluate/Purchase)
- Intent Filtering: Suppresses low-intent leads (career pages, etc.)
- Persona Matching: Checks if contact matches target buyer personas
- LinkedIn Search: If no match, finds better contacts at the company
- Email Generation: Creates personalized outreach for each contact
- Dashboard Display: Shows actionable leads with all context
The system uses structured prompts to get consistent JSON responses:
- ICP Scoring: Analyzes domain/company against criteria
- Persona Inference: Maps page visits to buyer types
- Stage Detection: Sequences pages to identify intent
- Email Generation: Creates stage-appropriate outreach
All prompts use format: 'json' for reliable parsing.
Contributions welcome! Areas for improvement:
- Additional data enrichment sources
- More sophisticated persona detection
- Email template variations
- CRM integrations
- Webhook security (HMAC validation)
MIT License - see LICENSE file
For issues or questions:
- GitHub Issues: Report a bug
- Email: hello@customeros.ai
Built with guidance from the CustomerOS RB2B Actionability Guide