Skip to content

Dr1mS/PulseWorld

Repository files navigation

PulseWorld

Real-time global monitoring platform with local LLM-powered analysis

Node.js License: MIT Status


PulseWorld Dashboard

About

PulseWorld is a self-hosted monitoring system that continuously tracks global events across politics, technology, finance, defense, and international organizations. It aggregates data from 13 independent sources, scores and classifies events using local LLMs via Ollama, and presents everything through a real-time web dashboard.

The system tracks 139 entities (heads of state, tech leaders, financial institutions, military organizations, and more) across 9 geographic regions. Each incoming event is matched to relevant entities, scored for impact, and analyzed by a dual-tier LLM architecture that runs entirely on local hardware — no cloud API calls for analysis.

PulseWorld also includes an experimental prediction engine (Oracle) that generates probabilistic forecasts from detected patterns and compares them against Polymarket odds. This module is a proof of concept — see the dedicated section below.

Key Features

Data Ingestion

  • 13 active data sources polling at intervals from 5 minutes to 24 hours (see Data Sources)
  • Staggered startup to avoid API rate limits
  • Automatic deduplication with configurable similarity threshold
  • Entity matching via keyword extraction across all sources

Local LLM Analysis

  • Dual-tier Ollama architecture: a fast 7B model (T1) for event classification and a 14B model (T2) for deep analysis, predictions, and summaries
  • Both models loaded permanently in memory — no model swapping overhead
  • Priority-based queue system with per-lane processing
  • Hourly automated summaries and a rolling world situation synopsis
  • French-language output by default (configurable)

Market Monitoring

  • Live tracking of major indices (S&P 500, NASDAQ, CAC 40, DAX, FTSE, Nikkei, Hang Seng), individual stocks, and cryptocurrencies via Yahoo Finance
  • Anomaly detection with configurable thresholds per asset class
  • Event-to-market correlation tracking
  • Crypto Fear & Greed index integration

Pattern Detection and Scoring

  • Pre-scoring pipeline that prioritizes events before LLM analysis
  • AI-powered impact scoring (0-100 scale) with category-aware calibration
  • Global tension indicator aggregated from multiple signals

Real-time Dashboard

  • Dark-themed responsive UI built with vanilla HTML/CSS/JS
  • Live event feed via Socket.IO
  • Interactive world map (Leaflet) with entity markers and regional event counts
  • Market ticker bar with real-time price updates
  • Entity detail pages with event history, Wikipedia edit activity, and market correlations
  • Built-in i18n support (French and English)

Polymarket Integration

  • Collects prediction market data from Polymarket's public API
  • Virtual trading module that compares Oracle predictions against market odds
  • Tracks P&L and win rate on simulated bets

Architecture

graph LR
    subgraph Sources["13 Data Sources"]
        S1[RSS / GDELT / Wiki\nHN / Finance / Calendar]
        S2[Polymarket / Trends\nFRED / USGS / FIRMS\nFinnhub]
    end

    subgraph Ingestion["Ingestion"]
        MGR[Collector Manager]
        DEDUP[Dedup + Entity Match]
    end

    subgraph DB["Storage"]
        SQLite[(SQLite\nWAL mode)]
    end

    subgraph LLM["LLM Analysis"]
        T1["T1: qwen2.5:7b\nClassification"]
        T2["T2: qwen2.5:14b\nDeep Analysis"]
    end

    subgraph Oracle["Oracle PoC"]
        PRED[Predictions]
        CAL[Calibration]
        TRADE[Paper Trading]
    end

    subgraph UI["Frontend"]
        WEB[Express + Socket.IO\nDashboard / Map / Markets / Oracle]
    end

    Sources --> Ingestion --> DB
    DB --> LLM --> DB
    DB --> Oracle --> DB
    DB --> UI
Loading

The backend is a single Node.js process running Express and Socket.IO. Collectors run on independent timers with staggered startup delays. The LLM analysis layer uses two dedicated processing lanes — one per model — each with its own priority queue. Both Ollama models are kept loaded permanently (keep_alive: -1) to eliminate cold-start latency. The SQLite database uses WAL mode for concurrent read access.

Oracle Engine — Proof of Concept

PulseWorld includes a prediction engine called Oracle that performs ensemble forecasting on real-world events. The architecture includes:

  • Prediction generation from detected event patterns and signals, with deduplication and validation
  • Automated resolution via event matching, market movement correlation, and LLM-assisted verification
  • Brier score tracking for calibration measurement
  • Platt scaling calibration (requires 30+ resolved predictions to train)
  • Polymarket paper trading that identifies divergences between Oracle predictions and market odds
  • Error analysis and auto-tuning that extracts lessons from failed predictions

Important: this module is a proof of concept. The calibration requires significantly more data and tuning to produce trustworthy forecasts. It is included in the repository to document the approach and architecture, not as a production forecasting tool. Current Brier score and resolution statistics are visible in the Oracle dashboard tab.

Tech Stack

Layer Technology
Runtime Node.js (developed on v24, v18+ required)
Backend Express 4.18, Socket.IO 4.8
Database SQLite via better-sqlite3 (WAL mode, 34 tables)
AI / LLM Ollama (local), qwen2.5:7b-instruct-q4_K_M (T1), qwen2.5:14b-instruct-Q8_0 (T2)
Frontend Vanilla HTML/CSS/JS, Leaflet 1.9 (maps), Socket.IO client
Data formats RSS (rss-parser), JSON APIs, Yahoo Finance (yahoo-finance2)
External APIs GDELT, Polymarket (Gamma API), Google Trends, FRED, USGS, NASA FIRMS, Finnhub

Data Sources

Source Description Polling Interval API Key Required Status
RSS 50+ international news feeds (BBC, Reuters, AP, CNN, Al Jazeera, France 24, etc.) 5 min No Active
GDELT Global event database — geopolitical event monitoring 15 min No Active
Wikipedia Edit activity tracking on entity Wikipedia pages 30 min No Active
HackerNews Top stories and comments from Hacker News 30 min No Active
Yahoo Finance Stock prices, indices, crypto, Fear & Greed index 5 min (market hours), 15 min (after hours) No Active
Economic Calendar Scheduled economic events (rate decisions, earnings, etc.) 6 hours No Active
Polymarket Prediction market data from Gamma API 2 hours No Active
Google Trends Trending search data for tracked entities 6 hours No Active
FRED Federal Reserve economic indicators 12 hours Yes (free) Active
USGS Earthquake data worldwide 15 min No Active
NASA FIRMS Satellite thermal anomaly and wildfire detection (VIIRS) 1 hour Yes (free) Active
Finnhub Earnings calendar, company news, insider trading 2 hours (news), 24 hours (daily) Yes (free) Active
Reddit Subreddit monitoring via OAuth API 30 min Yes (OAuth) Implemented (disabled)

Reddit is implemented but currently disabled in server.js — it requires OAuth credentials and is commented out at the collector registration level.

Setup and Installation

Prerequisites

  • Node.js v18 or higher
  • Ollama installed and running (ollama.com)
  • RAM: 64 GB recommended (the 14B model uses CPU offloading). 8 GB+ VRAM for the 7B model.
  • Disk: ~10 GB for Ollama models + database growth over time

1. Clone and install

git clone https://github.com/Dr1mS/PulseWorld.git
cd PulseWorld
npm install

2. Pull the Ollama models

ollama pull qwen2.5:7b-instruct-q4_K_M
ollama pull qwen2.5:14b-instruct-Q8_0

3. Configure environment variables

cp .env.example .env

Edit .env and fill in the API keys:

Variable Description Where to get it
FRED_API_KEY Federal Reserve Economic Data fred.stlouisfed.org/docs/api/api_key.html
FINNHUB_API_KEY Financial data and news finnhub.io/register
NASA_FIRMS_API_KEY Satellite fire/thermal data firms.modaps.eosdis.nasa.gov/api/area

All three are free-tier keys. The system will start without them — collectors that need missing keys will log a warning and skip their cycles.

4. Start

npm start

On Windows, you can also use:

start.bat

5. Open the dashboard

Navigate to http://localhost:3001.

Collectors start on staggered timers (10s to 180s after boot). The first LLM analyses will appear within a few minutes once events start flowing in. The AI models need to be warmed up on first use — expect a short delay before the first analysis completes.

Adding New Entities

Entities are defined in JavaScript files under entities/, organized by region or category:

entities/
  usa.js         — US entities
  france.js      — French entities
  europe.js      — European entities
  china.js       — Chinese entities
  russia.js      — Russian entities
  asia.js        — Asian entities
  middle-east.js — Middle East entities
  latam.js       — Latin American entities
  africa.js      — African entities
  tech.js        — Technology companies and leaders
  finance.js     — Financial institutions
  organizations.js — International organizations
  tickers.js     — Stock/crypto ticker mappings
  index.js       — Aggregator (auto-loads all files above)

To add a new entity, add an object to the appropriate regional file. For example, to track a new tech company, add to entities/tech.js:

{
  id: 'openai',
  name: 'OpenAI',
  title: 'AI Research Company',
  country: 'US',
  region: 'NORTH_AMERICA',
  category: 'TECH',
  subcategory: 'ai-company',
  influence: 'HIGH',
  keywords: ['openai', 'chatgpt', 'gpt-4', 'sam altman'],
  wikipedia: 'OpenAI',
  coordinates: { lat: 37.7749, lng: -122.4194 },
  description: 'Leading AI research lab behind ChatGPT and GPT models.'
}

No registration step is needed — entities/index.js automatically aggregates all entity files. The influence level (ULTRA, HIGH, MEDIUM, LOW) determines query priority: ULTRA entities get individual GDELT queries, HIGH entities are grouped by region.

After adding the entity, restart the server. The new entity will be picked up by all collectors on their next cycle.

Changing the LLM Language

LLM analysis output is configured to be in French by default. This is set in prompt templates, not in model configuration.

Files to modify

1. Event analysis promptsanalysis/prompts.js

The JSON schema in the prompt requests French-language fields. Change these lines:

// Current (French):
"summary_fr": "<1 sentence summary in French, max 120 chars>",
"why_it_matters": "<1-2 short sentences in French, max 200 chars>",
"potential_impact": "<1 sentence in French about potential consequences, max 200 chars>",

// Change to (English):
"summary_fr": "<1 sentence summary in English, max 120 chars>",
"why_it_matters": "<1-2 short sentences in English, max 200 chars>",
"potential_impact": "<1 sentence in English about potential consequences, max 200 chars>",

Also update the calibration examples further down in the same file (currently in French).

2. Hourly summary promptanalysis/ai-analyzer.js (around line 347)

The prompt starts with Tu es un journaliste et analyste géopolitique... — replace the entire prompt block with an English equivalent instructing the model to write structured hourly summaries.

3. World summary promptanalysis/ai-analyzer.js (around line 249)

Change "Write a 5-8 sentence world situation summary IN FRENCH" to English, and replace the French tension labels (Calme/Modéré/Élevé/Tendu/Critique) with their English equivalents (Calm/Moderate/Elevated/Tense/Critical).

4. Frontend languagepublic/js/i18n.js

The i18n module supports both French (fr) and English (en). The dashboard has a FR/EN toggle in the top-right corner that switches the UI language. This only affects UI labels — LLM output language is controlled by the prompts above.

Screenshots

Main Dashboard

Dashboard Global overview with event stats, tension indicator, market ticker, conflict/thermal map, and live event feed.

Event Feed

Event Feed Live event feed with LLM-generated impact scores, sentiment indicators, and French-language summaries for each event.

World Map

Map Interactive Leaflet map showing 139 tracked entities across regions, color-coded by category. Regional event counts at the bottom.

Markets

Markets Financial dashboard with major indices, Bitcoin, Fear & Greed indicators, price charts, and real-time anomaly detection.

Oracle Engine

Oracle Prediction engine interface showing pending predictions with probability scores, Brier score tracking, and resolution status.

Hourly Summaries

Summaries LLM-generated hourly news digests organized by theme, with impact scores and event counts per time window.

Entity Detail

Entity Individual entity profile with event statistics, Wikipedia edit activity, source breakdown, market correlations, and impact scoring.

Project Status and Limitations

This is a personal project, built solo as an exploration of real-time data aggregation and local LLM analysis at scale.

  • The Oracle prediction engine is a proof of concept — calibration needs more data to be meaningful
  • The Reddit collector is implemented but disabled (requires OAuth credentials)
  • No automated test suite is included
  • The system is designed to run on a single machine — there is no horizontal scaling or distributed architecture
  • LLM analysis quality depends on the local models and available hardware (8 GB VRAM + 64 GB RAM was the development setup)
  • Active maintenance is not guaranteed

Contributing

This is a personal project I built to explore real-time data aggregation and local LLM analysis. Feel free to fork it, take inspiration, or reuse parts of it for your own work — that's what the MIT license is for. Issues and suggestions are welcome but I can't promise active maintenance.

License

MIT — see LICENSE for details.

Author

Built by Adrien Morelle — github.com/Dr1mS

About

Real-time global monitoring platform with local LLM-powered analysis

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages