Skip to content

Repository files navigation

PulseRoute AI — Next-Gen Multimodal WhatsApp Notification Intelligence Engine

Powered by Vectorize Hindsight Persistent Agent Memory

PulseRoute AI is an open-source, multimodal notification intelligence router designed for WhatsApp. It processes incoming text messages, image posters (via local EasyOCR), and voice notes (via local Whisper) to dynamically classify notifications into notify (interrupt immediately), digest (batch for later), or mute (silence noise).

By integrating Vectorize Hindsight Persistent Agent Memory, PulseRoute AI remembers user preferences, routing overrides, and interaction history over time—adapting notification decisions dynamically without model fine-tuning.


🌟 Key Features

  • Multimodal Intelligence: Seamlessly parses text, OCR image posters, and Whisper voice note audio transcripts.
  • Vectorize Hindsight Memory Integration: Retains (retain) user preference rules and routing feedback, and recalls (recall) them using Hindsight's parallel TEMPR (Temporal, Entity, Multi-strategy, Parallel, Retrieval) search engine.
  • 5-Stage Deterministic Pipeline:
    • Stage 0: Hard Firewall for instant scam, phishing, and emergency interception.
    • Stage 1: Local Media Extractor (faster-whisper + EasyOCR).
    • Stage 2: Context Aggregator (Pandas SQL joins across user, group, and sender history).
    • Stage 3: Hindsight Persistent Memory & Decision Engine.
    • Stage 4: Optional LLM Fallback (Zero API calls mode supported).
  • 100% Action Accuracy: Evaluated with 100% action classification accuracy across benchmark datasets.

🏗️ Architecture Overview

                          [ Incoming WhatsApp Message ]
                            (Text / Image / Voice Note)
                                         │
                                         ▼
                   [ Stage 0: Hard Firewall & Rule Checks ]
                                         │
                                         ▼
                   [ Stage 1: Local Media Extraction ]
                         (Whisper + EasyOCR + FastText)
                                         │
                                         ▼
                   [ Stage 2: Pandas Context Aggregation ]
                      (Users, Groups, History, Events)
                                         │
                                         ▼
                 [ Stage 3 & 4: Hindsight Memory Layer ] ◄── Retain & Recall Memory
                (User Preferences, Past Mutes/Notifies,     (Vectorize Hindsight)
                 Feedback Loops & Long-Term Context)
                                         │
                                         ▼
                   [ Final Decision Engine (output.csv) ]
                   action, message_type, reason, confidence, 
                             evidence_message_ids

🧠 How Vectorize Hindsight Memory Works

Unlike stateless notification routers that rely on hardcoded static rules, PulseRoute AI uses Hindsight Cloud to build a continuous memory bank (pulseroute-whatsapp-router).

1. Memory Retain (retain)

When a user sets a custom preference (e.g., "Always route Store X electronics deal alerts as NOTIFY"), PulseRoute AI ingests the fact into Hindsight Cloud:

from pipeline.hindsight_memory import hindsight_manager

hindsight_manager.retain_user_rule(
    user_id="usr_001",
    rule_description="Always route Store X electronics sales as NOTIFY immediately."
)

2. Memory Recall (recall)

Before making a notification routing decision, Stage 3 queries Hindsight Cloud via the parallel TEMPR engine:

recalled_memories = hindsight_manager.recall_user_preferences(
    user_id="usr_001",
    query_context="Store X electronics deal poster"
)

3. Adaptive Decision Transformation

  • Without Memory: Store X promotional deal is muted by default (confidence 0.70).
  • With Hindsight Memory: Recalls stored rule ID: 9a921a3f... and automatically routes as NOTIFY (confidence 0.98).

🚀 Quick Start

1. Environment Setup

# Clone repository
git clone https://github.com/Neer-tech878/PulseRoute-AI---Next-Gen-Multimodal-WhatsApp-Notification-Intelligence-Engine.git
cd PulseRoute-AI---Next-Gen-Multimodal-WhatsApp-Notification-Intelligence-Engine

# Install Python dependencies
pip install -r code/requirements.txt
pip install hindsight-client

2. Set Hindsight Cloud Credentials

export HINDSIGHT_API_KEY="your_hindsight_api_key"
export HINDSIGHT_BASE_URL="https://api.hindsight.vectorize.io"

3. Run Live Hindsight Agent Memory Learning Demo

Demonstrates the agent learning curve live in terminal:

python code/demo_hindsight_learning.py

4. Run Multimodal Pipeline

Processes dataset messages and writes predictions to dataset/output.csv:

python code/main.py

5. Run Evaluation Suite

python code/evaluation/main.py

📊 Benchmark Performance

Metric Accuracy / Value
Action Accuracy 100.0% (30/30 ground-truth samples)
Notify Accuracy 100.0%
Digest Accuracy 100.0%
Mute Accuracy 100.0%
Average Confidence 0.95
Overall Score 98.3%

📁 Repository Structure

├── code/
│   ├── main.py                       # Main pipeline entry point
│   ├── demo_hindsight_learning.py    # Live Hindsight Agent Memory learning demo
│   ├── clear_voice_cache.py          # Cache utility
│   ├── pipeline/
│   │   ├── hindsight_memory.py       # Vectorize Hindsight Cloud SDK integration
│   │   ├── stage0_hard_rules.py      # Hard firewall & regex checks
│   │   ├── stage1_media.py           # Whisper audio & EasyOCR extractor
│   │   ├── stage2_joiner.py          # Pandas context aggregation
│   │   ├── stage3_decision.py        # Hindsight memory recall & scoring engine
│   │   └── stage4_llm.py             # LLM fallback stage
│   └── evaluation/
│       └── main.py                   # Evaluation benchmark script
└── dataset/                          # Input messages & historical context CSVs

🔗 References & Ecosystem


📄 License

Licensed under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages