A consistent, explainable way to price geopolitical risk — built from open macro data, live news, and a rule-bound LLM.

AI Country Risk Dashboard — live terminal showing the world risk map, country risk scores, and live market feeds.
0.0–0.4 low0.4–0.7 moderate0.7–1.0 high

01 Overview

Investors face a flood of geopolitical headlines with no consistent way to price them. The dashboard fuses World Bank macro indicators — refreshed with IMF sub-annual prints and an OWID V-Dem governance index — with recent news and asks an LLM to reconcile both into a single calibrated 0–1 score plus a bullet explanation, for 56 countries (25 developed, 31 emerging), persisted in PostgreSQL and rendered on an interactive map. The map also surfaces live market Prices, an AI-ranked Alerts feed and Econ Calendar, DB-backed Live TV, and a hands-off World Tour idle mode.

02 Pipeline

in

Ingest

World Bank + IMF + OWID macro panels, scraped Google News headlines, and FMP market & calendar feeds.

llm

Score

LangChain + OpenAI gpt-4o → 0–1 under hard rules and a sanctions gate.

db

Persist

Transactional upsert into Neon Postgres.

out

Render

Next.js map, served live from Postgres via cached API routes.

03 Scoring model — five sub-factors

conflict_war0.18
political_stability0.44
governance_corruption0.51
macroeconomic_volatility0.39
regulatory_uncertainty0.33
→ overall_score0.41

A YAML-driven sanctions / investability gate pins un-investable jurisdictions (e.g. Russia, Iran, North Korea) to maximum risk regardless of the model output.

04 Data schema

TableDescription
countryISO-2 code and canonical country name.
indicatorIndicator definitions and units.
yearly_valueAnnual World Bank macro values per country.
recent_indicatorFreshest sub-annual (IMF) values, preferred over annual.
risk_snapshot0–1 risk score and bullet summary for a given date.
risk_snapshot_articleTop-3 news articles tied to a snapshot.
news_alertGlobally AI-ranked alerts feed.
economic_calendar_eventUpcoming economic events with AI importance.
market_priceLive prices (stocks / bonds / crypto / commodities).
price_referenceQuarter- / year-start closes for the 1Q / YTD calc.
live_tv_channelDB-backed Live TV channel list.

05 Stack

Next.jsReactPythonLangChainOpenAIPostgreSQL · NeonMapLibreRechartsWorld Bank APIIMFOWID · V-DemFMPGoogle NewsTypeScript 52%Python 47%