Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

141 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿ“‘ Table of Contents

Click to expand

๐ŸŒŸ Overview

MIRA (Market Intelligence & Research Automation) is an autonomous, self-healing competitor monitoring engine with an AI-powered strategy co-pilot and competitive war room simulator. It scrapes competitor websites on a configurable schedule, detects meaningful content changes using ONNX sentence embeddings, analyzes business impact with Gemini 3.6 Flash (with a local Qwen GGUF fallback), generates auto-battlecards, and pushes real-time alerts to Slack, Email, and Notion / Airtable CRM โ€” all within a 512 MB RAM footprint.


๐Ÿ”ฌ Scrape ๐Ÿง  Detect ๐Ÿ“Š Analyze & Score โš”๏ธ Simulate ๐Ÿšจ Alert
Axios + Puppeteer ONNX Embeddings Gemini 3.6 Flash / Qwen War Room + Oracle Slack + Email + CRM
Static & JS pages Cosine similarity Impact 1โ€“10 + Battlecards Game-theory simulation Real-time webhooks

โœจ Why MIRA?

๐Ÿง  Semantic Understanding
No brittle string diffs. Changes are compared by meaning, not characters. "Price is $100" โ‰ˆ "Current Price: $100" โ†’ no false alert.

๐Ÿ”„ Triple-Tier Fallback
Cloud LLM โ†’ Local GGUF โ†’ Rule-based heuristics. MIRA always produces analysis, even fully offline.

๐Ÿ”ฎ AI Strategy Co-Pilot
Ask MIRA Oracle anything โ€” get instant competitive intelligence, pricing strategy advice, and sales objection scripts powered by your live data.

โš”๏ธ War Room Simulator
"What if we drop prices 30%?" โ€” simulate competitive market reactions with risk scores, counter-offensives, and timeline predictions.

๐Ÿ“ข Multi-Channel Alerts
Slack (instant, high-impact โ‰ฅ 8), Email (periodic digest), Notion/Airtable (every change logged).

๐Ÿฉน Self-Healing
Failed CRM syncs auto-retry via a local SQLite queue. No data loss, ever.

๐Ÿงฉ Chrome Extension
One-click competitor registration from any browser tab. Live badge shows unread intel count.

๐Ÿƒ Auto-Battlecards
LLM-generated competitive battlecards with strengths, weaknesses, killer questions, and sales landmines โ€” ready for your next sales call.

๐Ÿ†• What's New โ€” v2.0

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚                    ๐Ÿš€  MIRA v2.0 HIGHLIGHTS                      โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                                                  โ”‚
  โ”‚  ๐Ÿ”ฎ  AI STRATEGY CO-PILOT (MIRA Oracle)                          โ”‚
  โ”‚      โ€ข Conversational AI with full workspace context             โ”‚
  โ”‚      โ€ข Instant pitch drafts, pricing analysis, SWOT audits       โ”‚
  โ”‚      โ€ข Quick-prompt chips for common strategic queries            โ”‚
  โ”‚                                                                  โ”‚
  โ”‚  โš”๏ธ  COMPETITIVE WAR ROOM SIMULATOR                              โ”‚
  โ”‚      โ€ข "What-If" scenario engine with game-theory modeling       โ”‚
  โ”‚      โ€ข Dynamic risk scoring (1-10) with threat levels            โ”‚
  โ”‚      โ€ข Per-competitor predicted reactions & timelines             โ”‚
  โ”‚      โ€ข Step-by-step counter-offensive playbook generation        โ”‚
  โ”‚      โ€ข Pre-built scenario templates for rapid simulation         โ”‚
  โ”‚                                                                  โ”‚
  โ”‚  ๐Ÿƒ  AUTO-GENERATED BATTLECARDS                                  โ”‚
  โ”‚      โ€ข LLM-powered competitive comparison cards                  โ”‚
  โ”‚      โ€ข Strengths / Weaknesses / Killer Questions / Landmines     โ”‚
  โ”‚      โ€ข One-click refresh from latest intelligence data           โ”‚
  โ”‚      โ€ข CRM sync status tracking (Notion / Airtable)              โ”‚
  โ”‚                                                                  โ”‚
  โ”‚  ๐ŸŽฏ  LIVE SALES OBJECTION "KILL CARDS"                            โ”‚
  โ”‚      โ€ข Real-time 15-second verbatim counter-scripts for pitch calls โ”‚
  โ”‚      โ€ข Live call HUD timer telemetry                             โ”‚
  โ”‚      โ€ข Dynamic displacement triggers & ROI defense per competitor โ”‚
  โ”‚      โ€ข 1-click script copy & AI co-pilot escalation              โ”‚
  โ”‚                                                                  โ”‚
  โ”‚  ๐Ÿ’ป  DEVELOPER SDKs & INTEGRATIONS                               โ”‚
  โ”‚      โ€ข Multi-language SDKs for Node.js, Python, Go, and PHP      โ”‚
  โ”‚      โ€ข Scrape triggers, ONNX similarity, War Room & Webhook APIs โ”‚
  โ”‚      โ€ข 1-click Workspace API Key & ID credential copying         โ”‚
  โ”‚                                                                  โ”‚
  โ”‚  ๐Ÿ”  ENHANCED CONTENT CHANGE INSPECTOR & ANALYTICS               โ”‚
  โ”‚      โ€ข 3 Review Modes: Split Slider, Side-by-Side & Inline Diff  โ”‚
  โ”‚      โ€ข Color-coded text additions (+ green) & removals (- red)   โ”‚
  โ”‚      โ€ข Metadata bar: HTTP Status, Latency, Payload Delta         โ”‚
  โ”‚      โ€ข 7-Day Change Frequency Timeline & Severity Distribution  โ”‚
  โ”‚                                                                  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Live Demo

The app is deployed on Railway and publicly accessible:

๐Ÿ‘‰ https://autonomous-competitor-intelligence-engine-production.up.railway.app/

๐Ÿ—บ๏ธ System Architecture

graph TD
    subgraph "๐Ÿ“ก Input Sources"
        A["๐Ÿงฉ Chrome Extension"] -->|"One-Click API"| B("๐Ÿ“‹ Sequential Queue")
        C["โฐ Scheduled Runner"] -->|"Configurable Interval"| B
    end

    subgraph "โš™๏ธ Core Pipeline"
        B --> D["๐Ÿ•ธ๏ธ Double-Engine Scraper"]
        D -->|"Cleaned Text"| E["๐Ÿง  ONNX Sentence Embedder"]
        E -->|"Cosine Similarity"| F{"๐Ÿ” Semantic Change?"}
        F -->|"similarity >= 0.85"| G["โœ… No Action"]
        F -->|"similarity < 0.85"| H["๐Ÿง  Gemini / Qwen LLM"]
    end

    subgraph "๐Ÿƒ Battlecard Engine"
        H -->|"Change Analysis"| BC["๐Ÿƒ Auto-Battlecard Generator"]
        BC -->|"Strengths / Weaknesses / Landmines"| BD["๐Ÿ“‹ Battlecard DB"]
    end

    subgraph "๐Ÿ”ฎ AI Strategy Layer"
        ORACLE["๐Ÿ”ฎ MIRA Oracle Co-Pilot"]
        WARROOM["โš”๏ธ War Room Simulator"]
        BD --> ORACLE
        BD --> WARROOM
        ORACLE -->|"Conversational AI"| ORACLE_OUT["๐Ÿ’ฌ Strategic Advice"]
        WARROOM -->|"Game Theory"| WAR_OUT["๐Ÿ“Š Simulation Report"]
    end

    subgraph "๐Ÿ“ค Integrations"
        H --> J["๐Ÿ”„ CRM Adapter"]
        J -->|"Idempotent Write"| K["๐Ÿ““ Notion"]
        J -->|"Idempotent Write"| L["๐Ÿ“Š Airtable"]
        J -->|"On Failure"| M["๐Ÿ’พ SQLite Retry Queue"]
        H -->|"Impact >= 8"| N["๐Ÿ’ฌ Slack"]
        H -->|"Periodic Digest"| O["๐Ÿ“ง Email"]
    end

    style K fill:#000000,stroke:#A78BFA,stroke-width:2px,color:#fff
    style N fill:#4A154B,stroke:#A78BFA,stroke-width:2px,color:#fff
    style O fill:#EA4335,stroke:#A78BFA,stroke-width:2px,color:#fff
    style B fill:#0d1117,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
    style D fill:#0d1117,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
    style E fill:#0d1117,stroke:#FFD21E,stroke-width:2px,color:#FFD21E
    style H fill:#0d1117,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
    style F fill:#161b22,stroke:#A78BFA,stroke-width:2px,color:#c9d1d9
    style ORACLE fill:#1a1040,stroke:#A78BFA,stroke-width:2px,color:#d8b4fe
    style WARROOM fill:#1a1040,stroke:#EC4899,stroke-width:2px,color:#f9a8d4
    style BC fill:#0d1117,stroke:#FFD21E,stroke-width:2px,color:#FFD21E
Loading

๐Ÿงฌ ML Pipeline

๐Ÿง  Stage 1 โ€” Semantic Change Detection

Runtime: @huggingface/transformers (ONNX, JavaScript) Model: Xenova/all-MiniLM-L6-v2

const { pipeline } = require('@huggingface/transformers');

const embedder = await pipeline(
  'feature-extraction',
  'Xenova/all-MiniLM-L6-v2'
);

const oldEmbed = await embedder("Price is $100",
  { pooling: 'mean', normalize: true });
const newEmbed = await embedder("Current Price: $100",
  { pooling: 'mean', normalize: true });

// Cosine similarity โ†’ 0.93
// Same meaning โ€” NO alert triggered โœ…

โŒ No string comparison โ€” MIRA understands meaning, not characters.

๐Ÿ“Š Stage 2 โ€” LLM Analysis & Scoring

Cloud: Gemini 3.6 Flash API Local: Qwen2.5-0.5B GGUF via llama-cli (CPU)

Detected changes are analyzed in a single inference pass. The LLM returns structured output:

Output Description
๐Ÿ“‚ Category LLM-classified change type
๐Ÿ“ Summary Plain-English explanation
โ“ Why It Matters Business impact analysis
๐Ÿ“Š Impact Score 1โ€“10 threat/opportunity rating
๐Ÿ“‹ Justification Evidence-based reasoning
๐ŸŽฏ Recommendation Action item with timeline
๐Ÿƒ Battlecard Auto-generated competitive card

๐Ÿ”„ Fallback Chain

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Gemini 3.6 Flash   โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Qwen2.5-0.5B GGUF       โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Rule-Based Heuristics  โ”‚
โ”‚  (Cloud, <1.5s)     โ”‚     โ”‚  (Local, CPU, 7-15s)      โ”‚     โ”‚  (Keyword match, <1ms)  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

When cloud inference is unavailable (rate limits, missing API key), MIRA falls back to local GGUF, then to keyword-based heuristics. Analysis always completes.

๐Ÿงฉ Chrome Extension

Manifest V3 Service Worker Live Badge


The MIRA Chrome Extension turns your browser into a competitor registration tool. Browse any competitor's website, click the extension icon, and it's instantly queued for monitoring.

Feature Description
๐Ÿ–ฑ๏ธ One-Click Add Auto-detects the active tab's URL and infers competitor name from the domain
๐Ÿ”ด Live Badge Service worker polls every 60s โ€” new intel lights up a badge counter on the icon
๐Ÿ”‘ API Key Auth All requests secured with Bearer token, configured via Options page
๐ŸŽฏ Scope Selector Monitor full website, pricing page, or a specific section
๐Ÿ“ Architecture
graph LR
    subgraph "Chrome Extension โ€” Manifest V3"
        POPUP["๐Ÿ–ฑ๏ธ popup.html + popup.js"]
        OPTIONS["โš™๏ธ options.html + options.js"]
        BG["๐Ÿ”„ background.js"]
        STORAGE["๐Ÿ’พ chrome.storage.sync"]
    end

    subgraph "MIRA Backend"
        API_ADD["/api/extension/add-competitor"]
        API_UNREAD["/api/extension/unread-count"]
    end

    POPUP -->|"POST + Bearer"| API_ADD
    BG -->|"GET every 60s"| API_UNREAD
    API_UNREAD -->|"{ unreadCount: N }"| BG
    BG -->|"setBadgeText(N)"| BADGE["๐Ÿ”ด Badge"]
    POPUP --> STORAGE
    OPTIONS --> STORAGE
    BG --> STORAGE

    style POPUP fill:#0d1117,stroke:#4285F4,stroke-width:2px,color:#c9d1d9
    style BG fill:#0d1117,stroke:#FF6D00,stroke-width:2px,color:#c9d1d9
    style OPTIONS fill:#0d1117,stroke:#4285F4,stroke-width:1px,color:#c9d1d9
    style BADGE fill:#38bdf8,stroke:#fff,stroke-width:1px,color:#000
    style API_ADD fill:#161b22,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
    style API_UNREAD fill:#161b22,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
Loading
๐Ÿ”ง Installation
  1. Navigate to chrome://extensions/ and enable Developer mode
  2. Click Load unpacked โ†’ select the extension/ directory
  3. Click the MIRA extension icon โ†’ Configure Server Settings
  4. Enter your server URL (e.g., http://localhost:3000) and Extension API Key (from dashboard Settings)
  5. Click Verify and Save โœ…

โšก Core Features

๐Ÿ•ธ๏ธ Intelligent Double-Engine Scraper
Engine Library Use Case
โšก Fast Fetch axios + cheerio Static HTML โ€” fast and lightweight
๐ŸŒ JS Render puppeteer (headless Chromium) SPAs & dynamic JS content

Smart Cleaning Pipeline:

  • ๐Ÿงน Strips cookie banners, nav bars, footers, sidebars
  • ๐Ÿ”„ Rotates User-Agent strings to avoid bot detection
  • ๐Ÿ–ผ๏ธ Blocks images/CSS in Puppeteer to minimize RAM
  • ๐Ÿ“ธ Captures screenshots for audit trails
๐Ÿ” Tech Stack & DNS Enrichment
  • ๐ŸŒ DNS Resolution โ€” A-records & MX-records for server/email hosting detection
  • ๐Ÿ”ง Header Inspection โ€” Reads server, x-powered-by headers
  • ๐Ÿ“Š Dashboard Widget โ€” Enriched tech profiles displayed in competitor sidebar
๐Ÿ’ผ Idempotent CRM Sync
  • ๐Ÿ”’ Deduplication โ€” Queries Notion/Airtable before writes
  • ๐Ÿ”„ SQLite Retry Queue โ€” Failed syncs queued locally, auto-retried
  • ๐Ÿ“Š Dynamic Schema Matching โ€” Case-insensitive, whitespace-tolerant
  • โœ… Status Tracking โ€” synced / failed / pending per card
๐Ÿ“ข Multi-Channel Alerts
Channel Trigger Content
๐Ÿ’ฌ Slack Impact โ‰ฅ 8 Immediate webhook with full intel card
๐Ÿ“ง Email Periodic digest HTML summary of recent changes
๐Ÿ““ Notion Every change Structured database row
๐Ÿ“Š Airtable Every change Structured record
๐Ÿ–ฅ๏ธ Rich Dashboard UI

Built with React 18 + Tailwind CSS + Vite, the dashboard features:

  • ๐Ÿ” Command Palette โ€” Cmd/Ctrl + K global search & quick navigation
  • ๐Ÿ“Š Intel Feed โ€” Card-based timeline of all detected changes, filterable by impact
  • ๐Ÿ—‚๏ธ Visual Diff Modal โ€” Side-by-side content diff viewer for every scrape
  • ๐Ÿ”” Live Badge โ€” Unread intel count synced with the Chrome Extension badge
  • โš™๏ธ Settings Panel โ€” Per-workspace CRM keys, SMTP, Slack webhook, and API key management
  • ๐Ÿ’€ Skeleton Loaders โ€” Smooth loading states throughout the UI

๐Ÿ”ฎ AI Strategy Co-Pilot โ€” MIRA Oracle

Gemini Powered Context-Aware Conversational


MIRA Oracle is an embedded AI strategy co-pilot that has real-time access to your entire competitive intelligence workspace โ€” business profile, competitor radar, intel signals, and battlecards. Ask it anything and get actionable strategic advice instantly.


๐Ÿ’ก What Can You Ask?

  • "How should I position against [Competitor X] in enterprise deals?"
  • "Draft a 60-second elevator pitch highlighting our advantages"
  • "What are the top 3 pricing risks if we go freemium?"
  • "Summarize all high-impact competitor moves this week"
  • "Write objection-handling scripts for [Competitor]'s latest feature"

โšก Quick-Prompt Chips

Pre-built strategy prompts for instant access:

Chip Action
๐ŸŽฏ Competitor SWOT Full SWOT analysis of a tracked competitor
๐Ÿ’ฐ Pricing Strategy Price positioning based on market signals
๐Ÿ“ Pitch Draft 60-second elevator pitch generator
๐Ÿ›ก๏ธ Objection Handling Counter-arguments for sales calls
๐Ÿ“Š Weekly Briefing Executive summary of all market movements

๐Ÿ—๏ธ How It Works

graph LR
    USER["๐Ÿ‘ค User Query"] --> CTX["๐Ÿ“ฆ Context Assembler"]
    CTX --> |"Profile + Competitors + Intel + Battlecards"| LLM["๐Ÿง  Gemini 3.6 Flash"]
    LLM --> RESP["๐Ÿ’ฌ Strategic Response"]
    RESP --> CONV["๐Ÿ”„ Conversation Memory"]
    CONV --> |"Multi-turn context"| CTX

    style USER fill:#0d1117,stroke:#A78BFA,stroke-width:2px,color:#c9d1d9
    style CTX fill:#0d1117,stroke:#FFD21E,stroke-width:2px,color:#FFD21E
    style LLM fill:#1a1040,stroke:#A78BFA,stroke-width:2px,color:#d8b4fe
    style RESP fill:#0d1117,stroke:#00C853,stroke-width:2px,color:#00C853
    style CONV fill:#161b22,stroke:#A78BFA,stroke-width:1px,color:#c9d1d9
Loading

Fallback: When Gemini is unavailable, Oracle generates intelligent contextual reports using your live workspace data โ€” competitor counts, high-impact signals, and rule-based strategic recommendations.

โš”๏ธ Competitive War Room Simulator

Game Theory Risk Scoring Playbook


"What happens if we drop prices by 30%?" โ€” The War Room runs a full market simulation powered by Gemini, modeling how each competitor is likely to react, with timelines, risk scores, and a step-by-step counter-offensive playbook.


๐Ÿ“Š Simulation Output Structure

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    โš”๏ธ  WAR ROOM SIMULATION                     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                โ”‚
โ”‚  ๐Ÿ“‹ SCENARIO:  "Drop pricing 30% across all tiers"             โ”‚
โ”‚                                                                โ”‚
โ”‚  ๐ŸŽฏ RISK SCORE:     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘  8/10 โ€” HIGH RISK               โ”‚
โ”‚                                                                โ”‚
โ”‚  ๐Ÿ“ˆ MARKET IMPACT:                                             โ”‚
โ”‚     "Aggressive pricing will trigger a race-to-bottom in       โ”‚
โ”‚      the mid-market segment within 2-3 weeks..."               โ”‚
โ”‚                                                                โ”‚
โ”‚  ๐Ÿ‘ฅ COMPETITOR RESPONSES:                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚
โ”‚  โ”‚ Competitor  โ”‚ Predicted Action      โ”‚ Prob  โ”‚ When     โ”‚      โ”‚
โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค       โ”‚
โ”‚  โ”‚ Rival A     โ”‚ Match pricing +       โ”‚ 85%   โ”‚ 1-2 wks  โ”‚      โ”‚
โ”‚  โ”‚             โ”‚  launch ad blitz      โ”‚       โ”‚          โ”‚      โ”‚
โ”‚  โ”‚ Rival B     โ”‚ Highlight premium     โ”‚ 60%   โ”‚ 2-4 wks  โ”‚      โ”‚
โ”‚  โ”‚             โ”‚  positioning          โ”‚       โ”‚          โ”‚      โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
โ”‚                                                                โ”‚
โ”‚  ๐Ÿ›ก๏ธ COUNTER-OFFENSIVE PLAYBOOK:                                โ”‚
โ”‚     Step 1 โ†’ Days 1-7:  Distribute battlecards to sales        โ”‚
โ”‚     Step 2 โ†’ Weeks 2-4: Publish customer success stories       โ”‚
โ”‚     Step 3 โ†’ Month 2:   Release differentiation features       โ”‚
โ”‚                                                                โ”‚
โ”‚  โš–๏ธ VERDICT: PROCEED WITH CAUTION                              โ”‚
โ”‚                                                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฎ Pre-Built Scenario Templates

Template Description
๐Ÿ’ฐ Price Drop "Drop prices by 30% across all tiers"
๐Ÿš€ AI Feature Launch "Launch an AI-powered feature competitor doesn't have"
๐Ÿ†“ Freemium Pivot "Introduce a free tier to capture market share"
๐Ÿข Enterprise Push "Pivot to enterprise-only with premium support"

๐Ÿ’ก Or type any custom hypothesis โ€” e.g., "Acquire competitor X's top engineer and launch a PR campaign"

๐Ÿƒ Auto-Generated Battlecards

Every tracked competitor gets an auto-generated battlecard powered by LLM analysis. Battlecards are living documents that evolve as new intelligence signals are captured.


๐Ÿ“‹ Card Contents

Each battlecard includes:

  • โœ… Strengths โ€” What they do well
  • โŒ Weaknesses โ€” Where they fall short
  • ๐ŸŽฏ Killer Questions โ€” Ask prospects to expose competitor gaps
  • ๐Ÿ’ฃ Sales Landmines โ€” Trigger questions that shift the deal in your favor

๐Ÿ”„ Lifecycle

Stage Mechanism
Generation Auto-created on first competitor scrape
Refresh One-click regenerate from latest intel data
Sync Status tracked: synced / pending / failed
CRM Push Auto-syncs to Notion / Airtable alongside intel cards

๐ŸŽฏ Live Sales Kill Cards

Live Execution Dynamic Conversion Verbatim Scripts


Never get caught off guard on a sales call again. The Live Sales Kill Cards Co-Pilot converts real-time competitor telemetry and AI battlecards into 15-second verbatim counter-scripts, customer migration triggers, pricing defenses, and landmine questions โ€” strictly personalized per monitored competitor target.


โšก Key Capabilities

  • โฑ๏ธ Live Call HUD Timer โ€” Active call duration telemetry with start, pause, and reset controls
  • ๐ŸŽฏ Target Competitor Filtering โ€” Instant dropdown filtering across all active workspace competitors
  • โšก 15-Second Verbatim Counter-Scripts โ€” Numbered, out-loud responses for reps during live calls
  • ๐Ÿ’ฃ Landmine Questions โ€” Trap questions reps ask prospects to expose competitor vulnerabilities
  • ๐Ÿ›ก๏ธ Verified Evidence & Proof โ€” Scraped domain evidence and price point comparison benchmarks
  • 1๏ธโƒฃ One-Click Script Copy & Oracle Escalation โ€” Copy scripts instantly or push queries directly to MIRA Oracle AI

๐Ÿ”„ Dynamic Competitor Engine

Unlike legacy static cheat-sheets, MIRA Kill Cards are 100% dynamic:

Element Source Data
๐ŸŽฏ Objection Cards Synthesized from competitor objection_handling array
โšก Displacement Cards Generated from switching_triggers & elevator_pitch
๐Ÿ’ฐ Pricing ROI Defense Derived from pricing_comparison & why_we_win
๐Ÿ›ก๏ธ Evidence Snippets Extracted from recent competitor web scrapes & intel signals
๐Ÿ”„ Auto-Generation One-click AI synthesis for new competitor targets

๐Ÿค– Model Configurations

Component Model Runtime Disk RAM Latency
๐Ÿ” Embeddings Xenova/all-MiniLM-L6-v2 ONNX (JavaScript) ~90 MB ~80 MB < 0.5s
๐Ÿง  LLM (Cloud) gemini-3.6-flash Google API โ€” โ€” < 1.5s
๐Ÿง  LLM (Local) Qwen2.5-0.5B-Instruct llama-cli (GGUF Q4_K_M) ~382 MB ~350 MB 7โ€“15s
๐Ÿ”ง Fallback Rule-based heuristic Node.js keyword matching โ€” โ€” < 1ms
๐Ÿ”ฎ Oracle gemini-3.6-flash Google API (contextual) โ€” โ€” < 2s
โš”๏ธ War Room gemini-3.6-flash Google API (game-theory) โ€” โ€” < 3s

๐Ÿ’ก Configure your Gemini API key and other integration credentials via the dashboard Settings tab โ€” no .env changes needed.

๐Ÿš€ Quick Start

Prerequisites

โœ… Node.js    v20+
โœ… NPM        v10+
โœ… OS         macOS / Linux / Windows (WSL)

1๏ธโƒฃ Clone & Install

git clone https://github.com/NitheshK4/Autonomous-Competitor-Intelligence-Engine.git
cd Autonomous-Competitor-Intelligence-Engine

npm install
npm run install:all

๐Ÿ’ก No Python required. All ML inference runs natively in Node.js.

2๏ธโƒฃ Configure

cp .env.example .env
# Only PORT and NODE_ENV are needed โ€” all API keys (Gemini, Slack,
# Notion, Airtable, SMTP) are configured via the dashboard Settings tab.

3๏ธโƒฃ Launch

npm run dev
Service URL
๐Ÿ–ฅ๏ธ Backend API http://localhost:3000
๐ŸŽจ Dashboard http://localhost:5173

4๏ธโƒฃ Test

npm test

Validates: Scraping โ†’ Semantic Detection โ†’ LLM Inference โ†’ Battlecards โ†’ CRM Sync

๐Ÿ” Environment Variables

Create a .env in the project root (copy from .env.example). Only PORT is strictly required โ€” all integration credentials are managed via the dashboard Settings tab and persisted in SQLite.

Variable Required Default Description
PORT โœ… 3000 Express server port
NODE_ENV โ€” development production for optimized builds
PUPPETEER_EXECUTABLE_PATH โ€” bundled Override Chrome binary (e.g. /usr/bin/google-chrome-stable)

Note: GEMINI_API_KEY, SLACK_WEBHOOK_URL, Notion, Airtable, and SMTP credentials are all configured through the dashboard Settings tab โ€” no .env entry needed.

๐Ÿ“ก API Reference

Dashboard endpoints use X-Workspace-Id header (defaults to default). Extension endpoints require Authorization: Bearer <api_key>.

๐Ÿ“‹ Dashboard Endpoints
Method Endpoint Description
GET /health Health check
GET /api/profile Get business profile
POST /api/profile Save business profile
GET /api/competitors List competitors
POST /api/competitors Add competitor
GET /api/competitors/:id Competitor details
PUT /api/competitors/:id Update competitor
DELETE /api/competitors/:id Remove competitor
POST /api/competitors/:id/check Trigger immediate scrape
GET /api/intelligence Get intel cards
PUT /api/intelligence/:id Update card (read/unread)
POST /api/intelligence/read-all Mark all read
POST /api/intelligence/:id/retry Retry failed CRM sync
GET /api/settings Get settings
POST /api/settings Save settings
POST /api/settings/test-email Test SMTP
GET /api/debug-status Pipeline debug info
๐Ÿƒ Battlecard Endpoints
Method Endpoint Description
GET /api/battlecards List all battlecards
GET /api/battlecards/:competitorId Get battlecard for competitor
POST /api/battlecards/:competitorId/generate Generate / refresh battlecard
DELETE /api/battlecards/:competitorId Delete battlecard
๐Ÿ”ฎ AI Strategy Co-Pilot & War Room Endpoints
Method Endpoint Description
POST /api/oracle/chat Send message to MIRA Oracle (AI Co-Pilot)
POST /api/warroom/simulate Run War Room "What-If" simulation

Oracle Request Body:

{
  "message": "How should we counter Competitor X's new AI feature?",
  "history": [
    { "role": "user", "text": "Previous question..." },
    { "role": "assistant", "text": "Previous answer..." }
  ]
}

War Room Request Body:

{
  "move": "Drop pricing by 30% across all tiers"
}

War Room Response Structure:

{
  "scenario": "Drop pricing by 30% across all tiers",
  "risk_score": 8,
  "risk_level": "HIGH",
  "market_impact_summary": "Aggressive pricing will trigger...",
  "competitor_responses": [
    {
      "competitor_name": "Rival A",
      "predicted_action": "Match pricing + launch ad blitz",
      "likelihood_pct": 85,
      "timeframe": "1-2 Weeks",
      "threat_severity": "High"
    }
  ],
  "counter_offensive_playbook": [
    {
      "step": 1,
      "phase": "Immediate (Days 1-7)",
      "action": "Distribute battlecards to SDRs",
      "details": "Equip sales team before competitors adjust messaging"
    }
  ],
  "strategic_verdict": "PROCEED WITH CAUTION"
}
๐Ÿงฉ Extension Endpoints
Method Endpoint Description
GET /api/extension/status Connection check
GET /api/extension/unread-count Unread card count (badge)
POST /api/extension/add-competitor Register competitor from browser

๐Ÿ”Œ Integration Guides

๐Ÿ““ Notion CRM
  1. Create an integration at Notion My Integrations
  2. Create a database with these properties:
Property Type
Title Title
Competitor Name Select
URL URL
Category Select
Impact Score Number
Recommended Action Text
Summary Text
Justification Text
Screenshot URL URL
  1. Connect integration to database โ†’ ... โ†’ Connect to
  2. Copy Database ID from page URL
  3. Enter credentials in dashboard Settings
๐Ÿ“Š Airtable CRM
  1. Generate a PAT with data.records:write at Airtable Tokens
  2. Create a Base โ†’ Table named Competitor Intel
  3. Enter Base ID, Table name, and Token in dashboard Settings
๐Ÿ’ฌ Slack
  1. Create an Incoming Webhook in your workspace
  2. Paste the webhook URL in dashboard Settings
  3. Impact Score โ‰ฅ 8 โ†’ instant Slack alert โšก
๐Ÿ“ง Email (SMTP)
  1. For Gmail: generate an App Password at security.google.com
  2. Configure in Settings: smtp.gmail.com / Port 587
  3. Click Test SMTP Connection to verify
  4. Periodic digests arrive automatically ๐Ÿ“ฌ

๐Ÿ› ๏ธ Tech Stack

Tech Stack

Layer Technologies
๐Ÿ–ฅ๏ธ Backend Node.js 20, Express 4, SQLite (sqlite3), UUID
๐ŸŽจ Frontend React 18, Vite 5, Tailwind CSS 3, Lucide React, PHP (SSR Dashboard)
๐Ÿ˜ PHP SDK & SSR MiraClient.php, Server-Side Rendered Dashboard & CSV Exporter
๐Ÿ•ธ๏ธ Scraping Axios, Cheerio, Puppeteer (headless Chromium)
๐Ÿง  AI / ML HuggingFace Transformers (ONNX), Gemini 3.6 Flash, Qwen GGUF
๐Ÿ”ฎ Strategy AI MIRA Oracle (Co-Pilot), War Room Simulator (Game Theory)
๐Ÿƒ Battlecards LLM-powered auto-generation with CRM sync
๐Ÿ”Œ Integrations Notion SDK, Airtable REST, Slack Webhooks, Nodemailer
๐Ÿงฉ Extension Chrome Manifest V3, Service Workers
๐Ÿ”ง Tooling Concurrently, Nodemon, Docker

๐Ÿ“ Project Structure

๐Ÿ“ฆ MIRA โ€” Autonomous Competitor Intelligence Engine
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ php/                        # Complete PHP Subsystem & Intelligence Portal
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ src/
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ Console/            # PHP CLI Command Runners
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ MiraCliCommand.php
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ Core/               # Configuration & Environment Manager
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Config.php
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ Services/           # War Room Simulator & Battlecard Services
โ”‚   โ”‚       โ”œโ”€โ”€ BattlecardService.php
โ”‚   โ”‚       โ””โ”€โ”€ WarRoomSimulator.php
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ tests/                  # PHP Subsystem Unit Test Suite
โ”‚   โ”‚   โ””โ”€โ”€ MiraClientTest.php
โ”‚   โ”œโ”€โ”€ MiraClient.php             # Object-Oriented PHP SDK API Client
โ”‚   โ”œโ”€โ”€ mira.php                   # Executable PHP CLI tool
โ”‚   โ”œโ”€โ”€ index.php                  # Server-Side Rendered PHP Dashboard
โ”‚   โ”œโ”€โ”€ export.php                 # PHP CSV/JSON Intelligence Exporter
โ”‚   โ”œโ”€โ”€ composer.json              # PSR-4 Package Manifest
โ”‚   โ””โ”€โ”€ README.md                  # PHP Subsystem Documentation
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ client/                     # React + Vite + Tailwind CSS dashboard
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx                # Root dashboard application (all views)
โ”‚   โ”‚   โ”œโ”€โ”€ index.css              # Global + Tailwind styles
โ”‚   โ”‚   โ”œโ”€โ”€ main.jsx               # React entry point
โ”‚   โ”‚   โ””โ”€โ”€ components/
โ”‚   โ”‚       โ”œโ”€โ”€ BattlecardsView.jsx   # ๐Ÿƒ Auto-generated battlecards UI
โ”‚   โ”‚       โ”œโ”€โ”€ CommandPalette.jsx    # ๐Ÿ” Cmd+K global search & quick actions
โ”‚   โ”‚       โ”œโ”€โ”€ Sidebar.jsx           # ๐Ÿ“ฑ Navigation sidebar
โ”‚   โ”‚       โ”œโ”€โ”€ SkeletonLoader.jsx    # ๐Ÿ’€ Loading state placeholders
โ”‚   โ”‚       โ”œโ”€โ”€ StrategyCopilotModal.jsx # ๐Ÿ”ฎ MIRA Oracle AI chat modal
โ”‚   โ”‚       โ”œโ”€โ”€ TopBar.jsx            # ๐Ÿ” Top navigation bar
โ”‚   โ”‚       โ”œโ”€โ”€ VisualDiffModal.jsx   # ๐Ÿ—‚๏ธ Side-by-side content diff viewer
โ”‚   โ”‚       โ””โ”€โ”€ WarRoomView.jsx       # โš”๏ธ War Room scenario simulator
โ”‚   โ”œโ”€โ”€ index.html
โ”‚   โ”œโ”€โ”€ tailwind.config.js         # Tailwind theme configuration
โ”‚   โ””โ”€โ”€ vite.config.js             # Vite config with API proxy to :3000
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ server/                     # Node.js + Express backend
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ index.js               # Express server, routes, scheduler
โ”‚       โ”œโ”€โ”€ scraper.js             # Double-engine scraper (Axios + Puppeteer)
โ”‚       โ”œโ”€โ”€ detector.js            # Semantic change detection (ONNX)
โ”‚       โ”œโ”€โ”€ llm.js                 # LLM inference + Oracle + War Room + Battlecards
โ”‚       โ”œโ”€โ”€ crm.js                 # Notion & Airtable CRM adapter
โ”‚       โ”œโ”€โ”€ queue.js               # Sequential processing queue
โ”‚       โ”œโ”€โ”€ slack.js               # Slack webhook alerts
โ”‚       โ”œโ”€โ”€ mailer.js              # SMTP email digest
โ”‚       โ”œโ”€โ”€ enrichment.js          # DNS & header enrichment
โ”‚       โ”œโ”€โ”€ db.js                  # SQLite database layer
โ”‚       โ””โ”€โ”€ verify-test.js         # Integration tests
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ extension/                  # Chrome Extension (MV3)
โ”‚   โ”œโ”€โ”€ manifest.json
โ”‚   โ”œโ”€โ”€ popup.html / popup.js      # One-click competitor registration
โ”‚   โ”œโ”€โ”€ options.html / options.js  # Server URL & API key config
โ”‚   โ”œโ”€โ”€ background.js              # Badge polling service worker
โ”‚   โ””โ”€โ”€ icon*.png                  # Icons (16, 48, 128)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ docs/                       # Documentation & screenshots
โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”œโ”€โ”€ railway_deployment_guide.md
โ”‚   โ””โ”€โ”€ walkthrough.md
โ”œโ”€โ”€ data_exporter.py               # CSV/Markdown export utility
โ”œโ”€โ”€ Dockerfile                     # Production container (Node 20 + Chrome)
โ”œโ”€โ”€ package.json                   # Workspace orchestrator
โ””โ”€โ”€ .env.example                   # Environment template

๐Ÿณ Deployment

Railway (Recommended)

The Dockerfile installs Google Chrome Stable, downloads ONNX models, builds the Vite client, and starts Express โ€” all automatically.

  1. Create a project on Railway
  2. Link your GitHub repo
  3. Set env vars: PORT=3000, NODE_ENV=production
  4. Deploy ๐Ÿš€

All integration credentials (Gemini, Slack, Notion, etc.) are configured via the dashboard Settings after deploy โ€” no extra env vars needed.

Docker (Manual)

docker build -t mira .
docker run -p 3000:3000 --env-file .env mira

โš ๏ธ Known Limitations

Issue Details
โณ Cold Start First run downloads models (~90 MB ONNX + ~382 MB GGUF). Cached after.
๐Ÿค– Anti-Bot Some sites block headless scrapers โ†’ graceful Axios fallback.
๐Ÿ“‹ Sequential Queue One-at-a-time processing to stay under 512 MB RAM.
๐Ÿ”„ Rate Limits Gemini may throttle โ†’ auto-fallback to GGUF โ†’ heuristics.
๐Ÿ”ฎ Oracle Fallback Without Gemini key, Oracle provides data-driven reports (not conversational AI).
โš”๏ธ War Room Fallback Without Gemini key, simulations use deterministic rule-based modeling.

๐Ÿค Contributing

  1. Fork the repository
  2. Branch โ†’ git checkout -b feature/your-feature
  3. Commit โ†’ git commit -m 'Add your feature'
  4. Push โ†’ git push origin feature/your-feature
  5. PR โ†’ Open a Pull Request

Please ensure npm test passes before submitting.

๐Ÿ“œ License

Licensed under the MIT License โ€” see LICENSE for details.



MIT Stars Issues


๐Ÿ”ฎ MIRA Oracle โ€ข โš”๏ธ War Room Simulator โ€ข ๐Ÿƒ Auto-Battlecards โ€ข ๐Ÿง  Semantic Intelligence โ€ข ๐Ÿ•ธ๏ธ Smart Scraping

About

An AI-powered platform that monitors competitor websites, detects meaningful changes using semantic analysis, scores business impact with a local LLM, and delivers actionable intelligence.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages