Skip to content

VagishKumar3671/Sales-Intelligence-Multi-Agent-System

Repository files navigation

Sales Intelligence Multi-Agent System

AI-Powered Prospect Research & Personalized Outreach — Fully Local, Privacy-First

Python LangGraph Ollama Redis Neo4j FastAPI React


13 autonomous AI agents working in a coordinated pipeline to transform raw company data
into fully personalized, evidence-backed sales outreach — in under 15 minutes.

Zero hallucination. Zero API costs for LLMs. Zero data leaving your machine.

Executive Summary · Business Impact · Architecture · Agents · Orchestrator · Tech Stack · Memory Layer · Intelligence Flow · Example Output · Installation · Running the System · Documentation · Roadmap


Executive Summary

Sales Intelligence Multi-Agent System is a production-grade, multi-agent AI pipeline that automates the entire prospect research and personalized outreach workflow — from raw company inputs to a fully crafted, evidence-backed communication strategy.

What It Does

Input Company website URL, LinkedIn page, Instagram handle, founder profiles
Output Personalized cold email, LinkedIn message, multi-touch follow-up sequence, objection handling, and full communication strategy
Agents 13 specialized AI agents, organized across 5 execution phases
LLMs 4 local models via Ollama — zero API costs, complete data privacy
Memory Triple-layer persistence: SQLite (structured) + Qdrant (semantic) + Neo4j (graph relationships)

Core Value Proposition

Replace 4–6 hours of manual prospect research with a 15-minute automated pipeline that produces higher-quality, evidence-backed outreach — while keeping all data on your machine.

Privacy-First Design

Every component runs locally. LLM inference happens through Ollama on your hardware. No data is transmitted to external AI APIs. No prospect information leaves your network. Enterprise-grade privacy by architecture, not by policy.


Business Impact

The Problem

Sales teams spend 60–70% of their time on pre-outreach activities: researching prospects, analyzing competitors, identifying pain points, crafting personalized messages, and building follow-up sequences. This manual process is:

  • Slow — 4–6 hours per prospect for quality research
  • Inconsistent — output quality varies by rep skill and available time
  • Unscalable — more prospects requires more headcount, not more efficiency
  • Error-prone — generic outreach, missed signals, stale data

Manual vs. AI-Powered Workflow

┌─────────────────────────────────┐    ┌─────────────────────────────────┐
│       MANUAL WORKFLOW           │    │       AI-POWERED WORKFLOW       │
│                                 │    │                                 │
│  Website research    ~45 min    │    │  13 agents run in parallel      │
│  LinkedIn analysis   ~40 min    │    │  and sequential phases          │
│  Competitor mapping  ~60 min    │    │                                 │
│  Pain identification ~30 min    │    │  Total time: ~15 minutes        │
│  Solution mapping    ~30 min    │    │                                 │
│  Email drafting      ~45 min    │    │  Output:                        │
│  Follow-up sequence  ~30 min    │    │  ✓ Personalized email           │
│  Objection prep      ~20 min    │    │  ✓ LinkedIn message             │
│                                 │    │  ✓ Multi-touch sequence         │
│  Total: 4–6 hours               │    │  ✓ Objection handling           │
│  Quality: Variable              │    │  ✓ Full communication strategy  │
│  Scalability: Linear            │    │                                 │
│                                 │    │  Quality: Consistent            │
│                                 │    │  Scalability: Parallel          │
└─────────────────────────────────┘    └─────────────────────────────────┘

Operational Impact & ROI Metrics

Metric Before After Improvement
Research time per prospect 4–6 hours ~15 minutes 95% reduction
Outreach personalization depth Surface-level Multi-signal, evidence-backed 10x deeper
Data sources analyzed 1–2 manually 6+ automatically 6x coverage
Consistency across reps Variable Standardized AI pipeline 100% consistent
Hallucination rate N/A (human) Zero — every claim is evidence-traced Verified output
LLM API cost per prospect $0.10–$0.50 $0.00 (local Ollama) 100% eliminated

System Architecture

High-Level Architecture Diagram

flowchart TB
    subgraph INPUTS["📥 Company Inputs"]
        I1["🌐 Website URL"]
        I2["💼 LinkedIn URL"]
        I3["📸 Instagram Handle"]
        I4["👤 Founder Profiles"]
    end

    subgraph ORCHESTRATOR["🎛️ LangGraph Supervisor Orchestrator"]
        direction TB
        ORC["Phase Management · Packet Routing · Failure Handling"]
    end

    subgraph BUS["📡 Redis Pub/Sub Message Bus"]
        direction LR
        PUB["Publish"] --> SUB["Subscribe"]
    end

    subgraph PHASE1["⚡ Phase 1 — Collection (Parallel)"]
        direction LR
        A1["🌐 Agent 1\nWebsite Intel"]
        A2["💼 Agent 2\nLinkedIn Intel"]
        A3["📸 Agent 3\nInstagram Intel"]
        A4["👤 Agent 4\nFounder Intel"]
    end

    subgraph PHASE2["⚡ Phase 2 — Secondary Intelligence (Parallel)"]
        direction LR
        A5["📝 Agent 5\nBlog Intel"]
        A6["📊 Agent 6\nMarket Intel"]
    end

    subgraph PHASE3["⚡ Phase 3 — Reasoning (Parallel)"]
        direction LR
        A7["🎯 Agent 7\nOpportunity Signal"]
        A8["🔍 Agent 8\nPain Hypothesis"]
    end

    subgraph PHASE45["⚡ Phase 4–5 — Synthesis (Sequential)"]
        direction LR
        A9["👤 Agent 9\nTarget Person"]
        A10["📦 Agent 10\nInternal Product"]
        A11["🧩 Agent 11\nSolution Mapping"]
        A12["💰 Agent 12\nROI Intel"]
        A13["✉️ Agent 13\nCommunication"]
    end

    subgraph OUTPUT["📤 Output — CommunicationPacket"]
        O1["📧 Personalized Email"]
        O2["💼 LinkedIn Message"]
        O3["📅 Follow-up Sequence"]
        O4["🛡️ Objection Handling"]
        O5["📋 Communication Strategy"]
    end

    subgraph MEMORY["💾 Triple-Layer Memory"]
        direction LR
        M1["🗄️ SQLite\nStructured Profiles"]
        M2["🔮 Qdrant\nSemantic Vectors"]
        M3["🕸️ Neo4j\nRelationship Graph"]
    end

    INPUTS --> ORCHESTRATOR
    ORCHESTRATOR --> BUS
    BUS --> PHASE1
    PHASE1 -->|"Packet Merge"| PHASE2
    PHASE2 -->|"Packet Merge"| PHASE3
    PHASE3 --> PHASE45
    PHASE45 --> OUTPUT
    PHASE1 & PHASE2 & PHASE3 & PHASE45 <-->|"Read/Write"| MEMORY
Loading

End-to-End Intelligence Flow

Collection → Extraction → Deduplication → Reasoning → Scoring → Communication
     ↓            ↓              ↓             ↓           ↓           ↓
  Scrape &     Clean &       Hash +       Cross-source  Confidence   Strategy +
  gather raw   structure    semantic       inference &   gating &     email +
  data from    into typed   similarity     hypothesis    opportunity  LinkedIn +
  6+ sources   features     filtering      generation    scoring      sequence

Phase Execution Rules

Phase Agents Execution Gate
Phase 1 Agents 1–4 ⚡ Parallel All 4 must complete (or timeout) before Phase 2
Phase 2 Agents 5–6 ⚡ Parallel Both must complete before Phase 3
Phase 3 Agents 7–8 ⚡ Parallel Both must complete before Phase 4
Phase 4–5 Agents 9–13 🔗 Sequential Each feeds the next; always on, cannot be disabled

Multi-Agent Pipeline

All 13 Agents at a Glance

# Agent Phase Mode Input Output Packet Purpose
1 Website Intelligence 1 Parallel Website URL WebsitePacket Company identity, products, customers, tech stack, growth & pain signals
2 LinkedIn Intelligence 1 Parallel LinkedIn URL LinkedInPacket Hiring patterns, growth signals, content themes, audience, real-time activity
3 Instagram Intelligence 1 Parallel Instagram handle InstagramPacket Brand tone, visual identity, audience type, engagement, emotional signals
4 Founder Intelligence 1 Parallel Founder profiles FounderPacket Vision, technology preferences, decision style, beliefs (per-founder)
5 Blog Intelligence 2 Parallel Blog URL + Phase 1 BlogPacket Long-term thinking, case studies, roadmap direction, content themes
6 Market Intelligence 2 Parallel Phase 1 packets MarketPacket Competitors (tiered), market position, technology shifts, future trends
7 Opportunity Signal 3 Parallel Phase 1+2 packets OpportunityPacket Composite opportunity score across 7 signal dimensions
8 Pain Hypothesis 3 Parallel Phase 1+2 packets PainPacket Evidence-backed hypotheses about operational friction (not facts)
9 Target Person 4 Sequential All prior packets TargetPacket The real person who owns the pain — name, title, employment status
10 Internal Product 4 Sequential Our company URLs InternalProductPacket Our own products, pricing, capabilities, integrations, limitations
11 Solution Mapping 5 Sequential All packets SolutionPacket Pain → product/feature mapping, gap analysis, objection pre-generation
12 ROI Intelligence 5 Sequential Pain+Solution+Market ROIPacket Quantified business impact: cost, time, productivity, revenue, risk
13 Communication 5 Sequential ALL packets (1–12) CommunicationPacket Full communication strategy, personalized email, LinkedIn, sequence

Phase 1 — Collection Agents (Agents 1–4)

All four agents run in parallel immediately after inputs are received. Each uses a tiered collector priority system:

P1 (ALWAYS, FREE):    requests + bs4 + sitemap + xml.etree
P2 (IF NEEDED, PAID): Firecrawl (max 8 pages) + Apify (max 20 posts)
P3 (LAST RESORT):     Playwright + EasyOCR + faster-whisper

Agent 1 — Website Intelligence Extracts company identity, products, customers, growth signals, pain signals, and tech stack from the company's website. Uses sitemap parsing, HTML extraction, and optional JavaScript rendering.

Agent 2 — LinkedIn Intelligence Analyzes what the company is doing right now — hiring patterns, recent posts, growth signals, audience engagement, and expansion activities.

Agent 3 — Instagram Intelligence Understands brand tone, audience type, content themes, engagement quality, and emotional pain signals. Includes Whisper-based speech extraction from reels.

Agent 4 — Founder Intelligence Maps founder vision, technology preferences, decision style, and beliefs. Runs per-founder — multiple founders are supported, each producing their own FounderPacket.


Phase 2 — Secondary Intelligence (Agents 5–6)

Runs in parallel after Phase 1 packets are merged.

Agent 5 — Blog Intelligence Extracts long-term company thinking, customer success patterns, roadmap direction, and messaging themes from the company blog.

Agent 6 — Market Intelligence Unique architecture — LLM-driven discovery before collection. First uses LLMs to infer competitors and market position from Phase 1 data, then sends collectors to validate against real competitor websites.

flowchart LR
    CF["Context Fusion\n(Phase 1 packets)"] --> MD["Market Discovery\n(LLM-inferred)"]
    MD --> MC["Market Collection\n(validate via scraping)"]
    MC --> RL["Reasoning Layer\n(tiering + analysis)"]
    RL --> MP["MarketPacket"]
Loading

Phase 3 — Reasoning Agents (Agents 7–8)

Both agents run in parallel and are required (cannot be disabled).

Agent 7 — Opportunity Signal Intelligence Scores the sales opportunity across 7 parallel signal layers:

Signal Source
Growth LinkedIn hiring + website careers
Activity Post frequency + blog publishing
Technology Founder tech preference + market trends
Competitive Competitor launches vs. company state
Expansion New products + sales hiring
Timing Roadmap hints + market velocity
Pressure AI adoption + competitor automation

Agent 8 — Pain Hypothesis Intelligence Generates evidence-backed hypotheses — not facts — about operational friction using a multi-LLM approach:

LLM Role
qwen2.5:7b Signal organization and structuring
deepseek-r1:8b Cross-source inference and hypothesis generation
llama3.1:8b Buyer simulation ("If I were this company's VP Sales, what friction would I feel?")

Validation Rule: A hypothesis is only valid if supported by ≥2 independent signals, OR (market + growth signal), OR (founder + operations signal).


Phase 4–5 — Synthesis Agents (Agents 9–13)

Run sequentially. All five are always on — cannot be disabled.

Agent 9 — Target Person Intelligence Identifies the real human who owns the pain: name, title, current employment status. Maps pain types to role owners (e.g., "lead overload" → VP Sales).

Agent 10 — Internal Product Intelligence Analyzes our own company's products, pricing, capabilities, integrations, and limitations — ensuring outreach is truthful and accurate.

Agent 11 — Solution Mapping Intelligence Maps prospect pain → our best product/feature/use case. Includes gap analysis and pre-generated objection handling.

Agent 12 — ROI Intelligence Converts pain + solution into quantified business impact language, personalized by target designation. VP Sales gets pipeline metrics; CTO gets automation metrics.

Agent 13 — Communication Intelligence The sales execution brain — not an email generator. A 5-stage communication strategy system:

flowchart LR
    S1["1. Strategy\nPersona · Channel\nTiming · Intent"] --> S2["2. Planning\nHook · Narrative\nValue · CTA"]
    S2 --> S3["3. Personalization\nFounder · Company\nPain · Target · Market"]
    S3 --> S4["4. Execution\nEmail · LinkedIn\nFollowups · Objections"]
    S4 --> S5["5. Validation\nHallucination ✓\nSpam ✓ · Human ✓"]
Loading

Orchestrator Architecture

LangGraph Supervisor

The orchestrator uses LangGraph in supervisor mode to manage the complete lifecycle of all 13 agents:

Capability Implementation
Parallel Execution Phase 1 (4 agents), Phase 2 (2 agents), and Phase 3 (2 agents) each run in parallel
Phase Synchronization Strict gates: Phase N+1 only starts after all Phase N packets are received or timed out
Packet Routing Redis Pub/Sub channels per agent (e.g., phase1:agent1, phase2:agent5)
Failure Handling Agent failure → confidence reduction, NOT pipeline stop. Retry → Fallback → Degrade → Continue
Confidence Gating Every packet carries a confidence score; agents escalate collection priority if below threshold
Timeout Management 10-minute agent timeout; timed-out agents produce partial packets with reduced confidence

Redis Communication Flow

sequenceDiagram
    participant O as Orchestrator
    participant R as Redis Pub/Sub
    participant A1 as Agent 1
    participant A2 as Agent 2
    participant A5 as Agent 5
    participant A6 as Agent 6

    O->>R: Spawn Phase 1
    R->>A1: Start (parallel)
    R->>A2: Start (parallel)
    A1->>R: Publish WebsitePacket → phase1:agent1
    A2->>R: Publish LinkedInPacket → phase1:agent2
    R->>O: Phase 1 gate check ✓
    O->>R: Spawn Phase 2
    R->>A5: Start with Phase1Bundle (parallel)
    R->>A6: Start with Phase1Bundle (parallel)
    A5->>R: Publish BlogPacket → phase2:agent5
    A6->>R: Publish MarketPacket → phase2:agent6
    R->>O: Phase 2 gate check ✓
Loading

Confidence System

Every packet carries a confidence score calculated as:

confidence = signal_count + evidence_count + graph_links - missing_signals
Condition Action
confidence ≥ threshold Proceed normally
confidence < threshold Escalate to P2 collectors, then P3
Very low after P3 Reduce scope, produce partial packet, continue
Never Block the pipeline entirely

Failure Handling Philosophy

Every agent follows the same failure chain — no exceptions:

Attempt → Retry (1x) → Fallback (cheaper collector) → Confidence Reduction → Continue
Failure Scenario Fallback Action
Firecrawl quota exceeded Switch to BS4
JS-heavy site fails Use Playwright
Apify rate limit Direct Profile + Post collectors
OCR extraction fails Skip image, continue
Playwright timeout Fall back to Apify
LinkedIn profile private Metadata-only collection
Sitemap missing Crawl all <a> links
Blog unavailable Use LinkedIn articles
VP Sales not found Try Head of Sales → Director → Manager
Target employee inactive Move to next ranked person

Technology Stack

AI Layer

Component Technology Purpose
LLM Runtime Ollama (local) Free, private, zero API costs
Extraction Model Qwen 2.5 (7B) Fast structured JSON extraction, theme detection
Reasoning Model DeepSeek-R1 (8B) Chain-of-thought, cross-source inference
Simulation Model Llama 3.1 (8B) Buyer perspective simulation (Agent 8)
Embeddings nomic-embed-text Semantic search, deduplication, hallucination checking

Orchestration Layer

Component Technology Purpose
Agent Orchestrator LangGraph (supervisor mode) Agent lifecycle, routing, phase management
Message Bus Redis Pub/Sub Async packet routing between agents
API Server FastAPI REST endpoints, WebSocket/SSE for real-time updates

Memory Layer

Component Technology Purpose
Structured DB SQLite 13 profile tables, fast reads, agent outputs
Vector DB Qdrant (local) Semantic retrieval, cross-agent search, deduplication
Graph DB Neo4j (local) Entity relationships, evidence tracing

Collection Layer

Tool Purpose Cost Tier
requests + BeautifulSoup HTML scraping FREE (P1)
xml.etree Sitemap parsing FREE (P1)
Wappalyzer / builtwith Tech stack detection FREE (P1)
Firecrawl Structured page extraction PAID API (P2)
Apify LinkedIn/Instagram scraping PAID API (P2)
Playwright JS-rendered pages LOCAL COMPUTE (P3)
EasyOCR Image text extraction LOCAL COMPUTE (P3)
faster-whisper Reel/video speech-to-text LOCAL COMPUTE (P3)

Frontend Layer

Component Technology
Framework React / Next.js
Styling Tailwind CSS
State Management Zustand / React Context
Real-time Updates WebSocket / SSE

Memory Layer

Triple-Layer Persistence Architecture

Every agent writes to all three memory systems, creating a comprehensive, queryable intelligence store:

flowchart TB
    subgraph SQLITE["🗄️ SQLite — Structured Profiles"]
        S1["website_profile"]
        S2["linkedin_profile"]
        S3["instagram_profile"]
        S4["founder_profile"]
        S5["blog_profile"]
        S6["market_profile"]
        S7["opportunity_profile"]
        S8["operational_hypothesis_profile"]
        S9["target_profile"]
        S10["internal_product_profile"]
        S11["solution_profile"]
        S12["roi_profile"]
        S13["communication_profile"]
    end

    subgraph QDRANT["🔮 Qdrant — Semantic Vectors"]
        Q1["Pages · Posts · Docs"]
        Q2["Case Studies · Signals"]
        Q3["Competitor Data · Trends"]
        Q4["Communication Messages"]
    end

    subgraph NEO4J["🕸️ Neo4j — Relationship Graph"]
        N1["Company → SELLS → Product"]
        N2["Company → SERVES → Customer"]
        N3["Company → HIRING → Role"]
        N4["Founder → PREFERS → Technology"]
        N5["Pain → SOLVED_BY → Product"]
        N6["Product → INTEGRATES → CRM"]
        N7["Market → MOVING_TO → AI Agents"]
    end
Loading

Why Three Layers?

Layer Solves Example Query
SQLite "What did we learn about this company?" Retrieve structured profile for any agent's output
Qdrant "Find similar pain signals across companies" Semantic search across all collected content
Neo4j "What relationships exist between entities?" Trace: Pain → solved_by → Product → integrates → CRM

Hallucination Prevention

Agent 13 (Communication) validates every claim in the final output against all three memory layers. If a statement cannot be traced to evidence in the graph, vector store, or structured database — it is removed.


Intelligence Flow

The system transforms raw data into actionable sales intelligence through six distinct stages:

 ┌──────────┐   ┌────────────┐   ┌──────────┐   ┌───────────┐   ┌─────────┐   ┌───────────────┐
 │Collection│──▶│ Extraction │──▶│  Dedup   │──▶│ Reasoning │──▶│ Scoring │──▶│Communication  │
 │          │   │            │   │          │   │           │   │         │   │               │
 │ Scrape   │   │ Clean &    │   │ Hash +   │   │ Cross-    │   │ Confi-  │   │ Strategy +    │
 │ 6+ data  │   │ structure  │   │ semantic │   │ source    │   │ dence   │   │ email +       │
 │ sources  │   │ into typed │   │ similar- │   │ inference │   │ gating  │   │ LinkedIn +    │
 │          │   │ features   │   │ ity      │   │ & hypo-   │   │ & opp.  │   │ sequence +    │
 │          │   │            │   │ filter   │   │ thesis    │   │ scoring │   │ objections    │
 └──────────┘   └────────────┘   └──────────┘   └───────────┘   └─────────┘   └───────────────┘
   Agents 1–4      All agents      All agents     Agents 7–8      Agent 7        Agent 13

Packet Architecture

Every agent produces a typed packet with this base structure:

class BasePacket:
    structured: dict        # Core extracted JSON output
    vector_refs: list[str]  # Qdrant collection references
    graph_refs: list[str]   # Neo4j node references
    evidence: list          # Raw evidence items used
    screenshots: list       # Screenshot file paths
    confidence: float       # 0.0 – 1.0

Packets flow downstream and accumulate. Agent 13 has access to ALL packets from Agents 1–12 simultaneously.


Example Output

OpportunityPacket (Agent 7)

{
  "score": 0.89,
  "growth": "high",
  "technology": "high",
  "timing": "good",
  "pressure": "high",
  "confidence": 0.92
}

PainPacket (Agent 8)

{
  "hypotheses": [
    {
      "name": "qualification bottleneck risk",
      "confidence": 0.67,
      "evidence": ["SDR hiring signal", "AI market pressure", "manual workflow detected"]
    },
    {
      "name": "technology modernization need",
      "confidence": 0.72,
      "evidence": ["competitor AI adoption", "manual CRM detected", "founder automation vision"]
    }
  ]
}

CommunicationPacket (Agent 13)

{
  "strategy": {
    "persona": "sales leader",
    "channel": "email+linkedin",
    "intent": "relationship",
    "timing": "morning"
  },
  "email": [{
    "subject": "Quick thought on your SDR scaling",
    "body": "Noticed you've been hiring SDRs aggressively this quarter — three new roles opened in the last 30 days. Teams scaling that fast usually hit a qualification bottleneck before the new reps are ramped. Worth a quick conversation?",
    "CTA": "Open to a 15-minute discussion on how similar teams have handled this?"
  }],
  "linkedin": [{
    "message": "Saw your recent post on AI in sales — aligns closely with something we've been building for teams in exactly your position."
  }],
  "followups": ["day3_pain_insight", "day7_roi_followup", "day14_check_in"],
  "sequence": ["email", "linkedin", "email", "ROI followup"],
  "objections": {
    "budget": "We've seen teams offset the cost within 60 days through SDR productivity gains.",
    "timing": "Most teams start with a pilot on one segment — no full rollout needed.",
    "integration": "We integrate natively with HubSpot, which you're already using."
  },
  "confidence": 0.95
}

Impact Metrics

Metric Value
Autonomous Agents 13
Data Sources Analyzed 6+ per prospect
Time Reduction 95% (4–6 hrs → ~15 min)
Intelligence Layers 5 phases, 7 signal dimensions
Memory Systems 3 (SQLite + Qdrant + Neo4j)
Data Privacy 100% local — zero external LLM API calls
LLMs Used 4 specialized local models
Confidence Scoring Every packet, every agent
Hallucination Rate Zero — evidence-traced output
LLM Cost Per Prospect $0.00

Installation

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Docker & Docker Compose
  • 16GB+ RAM (for local LLM inference)

1. Clone the Repository

git clone https://github.com/your-username/sales-intelligence-multi-agent-system.git
cd sales-intelligence-multi-agent-system

2. Start Infrastructure Services (Docker)

cd infra
docker compose up -d

This starts:

  • Redis on port 6379 — message bus
  • Qdrant on port 6333 — vector database (dashboard)
  • Neo4j on ports 7474 (browser) / 7687 (bolt) — graph database (browser)

3. Install & Pull Ollama Models

# Install Ollama (macOS)
brew install ollama

# Pull all required models
ollama pull qwen2.5:7b
ollama pull deepseek-r1:8b
ollama pull llama3.1:8b
ollama pull nomic-embed-text

# Or use the convenience script
./scripts/pull_models.sh

4. Set Up the Backend

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env — add Firecrawl and Apify keys (optional, for P2 collectors)

# Start the API server
uvicorn backend.api.main:app --reload --port 8000

5. Set Up the Frontend

cd frontend
npm install
npm run dev

6. Verify Installation

redis-cli ping                          # → PONG
curl http://localhost:6333/healthz      # → OK
open http://localhost:7474              # → Neo4j Browser
ollama list                             # → Shows all 4 models
curl http://localhost:8000/docs         # → FastAPI Swagger UI

Running the System

Quick Start — One Command

The fastest way to launch the entire stack:

./scripts/start_all.sh

This single script handles everything: Docker infrastructure, Ollama model checks, Python dependencies, FastAPI backend, and Next.js frontend. Once complete, you'll see:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  System running:
    Frontend   → http://localhost:3000
    Backend    → http://localhost:8000
    API docs   → http://localhost:8000/docs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Press Ctrl+C to gracefully shut down all services.


Step-by-Step Manual Startup

A. Infrastructure Startup

Start all Docker services (Redis, Qdrant, Neo4j):

cd infra
docker compose up -d

Verify all containers are running:

docker compose ps

Expected output:

NAME                  STATUS
sales_intel_redis     Up      → Port 6379
sales_intel_qdrant    Up      → Port 6333, 6334
sales_intel_neo4j     Up      → Port 7474, 7687

B. Ollama Model Startup

Ensure Ollama is running, then verify all four models are available:

# Start Ollama (if not already running)
ollama serve &

# Verify models
ollama list

If any model is missing, pull it:

ollama pull qwen2.5:7b        # Extraction model
ollama pull deepseek-r1:8b    # Reasoning model
ollama pull llama3.1:8b       # Buyer simulation model
ollama pull nomic-embed-text  # Embedding model

C. Backend Startup

source venv/bin/activate
uvicorn backend.api.main:app --host 0.0.0.0 --port 8000 --reload

Available at:

  • API Basehttp://localhost:8000
  • Interactive Docshttp://localhost:8000/docs
  • OpenAPI Schemahttp://localhost:8000/openapi.json

D. Frontend Startup

In a separate terminal:

cd frontend
npm run dev

Available at → http://localhost:3000


Service Health Checks

Service Check Command Expected
Redis redis-cli ping PONG
Qdrant curl -s http://localhost:6333/healthz OK
Neo4j open http://localhost:7474 Neo4j Browser loads
Ollama ollama list Shows all 4 models
Backend curl -s http://localhost:8000/docs FastAPI Swagger UI
Frontend open http://localhost:3000 React app loads

Running the Pipeline

Via the Frontend UI

  1. Open http://localhost:3000
  2. Panel A — Enter company inputs (Website URL + LinkedIn URL required)
  3. Panel B — Add founder profiles (optional, up to 5 founders)
  4. Panel C — Toggle optional agents on/off per phase
  5. Click "Run intelligence pipeline"
  6. Watch real-time agent status updates as each phase executes
  7. View the final CommunicationPacket output

Via the REST API

curl -X POST http://localhost:8000/api/run-pipeline \
  -H "Content-Type: application/json" \
  -d '{
    "company": {
      "website_url": "https://example-company.com",
      "linkedin_url": "https://linkedin.com/company/example",
      "instagram_handle": "@example",
      "blog_url": "https://example-company.com/blog"
    },
    "founders": [
      {
        "name": "Jane Doe",
        "linkedin_url": "https://linkedin.com/in/janedoe",
        "twitter_url": "https://x.com/janedoe"
      }
    ],
    "agent_toggles": {
      "agent2_linkedin": true,
      "agent3_instagram": true,
      "agent4_founder": true,
      "agent5_blog": true
    }
  }'

Check pipeline status:

curl http://localhost:8000/api/status/{run_id}

Stopping the System

If using start_all.sh

Press Ctrl+C — the cleanup handler stops the backend, frontend, and Docker services automatically.

Manual Shutdown

cd infra
docker compose stop

# To remove containers and volumes entirely
docker compose down -v

Documentation

Full technical documentation lives in the docs/ directory:

docs/
├── README_1_SYSTEM_ARCHITECTURE.md    # Complete agent reference, packets, collectors, memory writes
├── README_2_BUILD_TASK_STRUCTURE.md   # 12-session implementation blueprint, 100+ tasks
├── architecture.png                   # System architecture diagram
├── orchestrator.png                   # Orchestrator flow diagram
└── pipeline.png                       # Agent pipeline diagram
Document Description Audience
System Architecture Full technical reference — every agent, every collector, every packet, every memory write Engineers, Architects
Build Task Structure Implementation blueprint — 12 sessions, 100+ tasks, verification checklists Developers, Project Managers

System Principles

Four principles govern every agent in the system. They must never be violated:

1. LLMs never scrape. Collectors scrape. LLMs only understand. Raw HTML is never passed to an LLM. Collectors extract text. LLMs receive only structured, cleaned feature data.

2. Every agent produces a typed Packet. No agent passes raw strings downstream. Every output is a structured Packet with defined fields, confidence scores, and evidence references.

3. Confidence scores gate progression. Every packet carries a confidence score (0.0–1.0). Low confidence triggers escalation to more expensive collectors — never a full stop.

4. Fallbacks prevent full failures. Every collector has a fallback. Every agent has a reduced-scope path. The pipeline always produces output, even with partial data.


LLM Usage by Agent

Agent Qwen 2.5 (Extract) DeepSeek-R1 (Reason) Llama 3.1 (Simulate)
1–5 (Collection + Blog) Theme extraction Relationship inference
6 (Market) Competitor extraction Market reasoning & tiering
7 (Opportunity) Signal extraction Cross-source reasoning
8 (Pain) Signal organization Hypothesis generation Buyer simulation
9 (Target) Role extraction Ownership reasoning
10 (Product) Feature extraction Use case reasoning
11 (Solution) Feature mapping Gap analysis
12 (ROI) Impact extraction ROI inference
13 (Communication) Planning & structure Writing & reasoning

Roadmap

Near-Term

  • Batch Processing — Run pipeline against multiple prospects in parallel
  • CRM Integration — Direct export to HubSpot, Salesforce, Pipedrive
  • Learning Loop — Feed successful outreach responses back to improve Agent 13
  • A/B Testing Engine — Generate multiple email variants with different hooks

Mid-Term

  • Real-Time Monitoring — Continuous tracking of prospect signals (new hires, posts, funding)
  • Team Dashboard — Multi-user support with shared prospect intelligence
  • Custom Agent Plugins — SDK for adding domain-specific collection agents
  • Model Fine-Tuning — Fine-tune local models on successful outreach data

Long-Term

  • Autonomous Outreach — Agent 13 sends emails and LinkedIn messages directly (with approval gate)
  • Multi-Language Support — Generate outreach in the prospect's native language
  • Voice Intelligence — Analyze podcast appearances and webinar recordings
  • Enterprise Deployment — Kubernetes orchestration, role-based access, audit logging

Built by Vagish Kumar G

13 agents. 5 phases. 3 memory layers. Zero hallucination. Zero API costs.

Transforming sales intelligence from manual research to autonomous AI pipelines.


Back to Top

About

Privacy-first AI-powered sales intelligence system using 13 agents, LangGraph orchestration, Ollama LLMs, Redis, Qdrant, and Neo4j to generate personalized outreach intelligence from company digital signals.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors