Where International Relations meets AI — Analyze. Simulate. Predict.
- Overview
- Why This Project
- Features
- Architecture
- Quick Start
- Screenshots
- Technology Stack
- API Reference
- Documentation
- Contributing
- License
- Acknowledgments
IR Intelligence Platform is an end-to-end AI-powered Geopolitical Intelligence Analysis & Simulation System. It ingests global news in real time, clusters related reports, abstracts them into structured international relations events using LLMs, applies IR theories for analysis, generates multi-directional scenario scripts with probabilistic forecasting, and continuously calibrates predictions against actual outcomes.
Think of it as an AI analyst that reads the world's news 24/7, builds structured geopolitical event graphs, simulates possible futures under different IR theoretical lenses, and learns from its mistakes through systematic calibration.
Traditional geopolitical analysis suffers from three problems:
- Information overload — too many news sources to track manually
- Cognitive bias — analysts anchor on familiar narratives
- No feedback loop — predictions are made but rarely systematically evaluated
This platform addresses all three by:
- Automated ingestion & abstraction of global news into structured event models
- Multi-theory, multi-directional scenario generation to counter confirmation bias
- Built-in calibration tracking with Brier scores, hit-rate dashboards, and automatic evaluation
🇨🇳 中文介绍
国关推演平台 是一个端到端的 AI 驱动的国际关系情报分析与推演系统。它实时采集全球新闻,聚类相关报道,使用大语言模型抽象为结构化国际关系事件,应用多种 IR 理论进行分析,生成多方向推演剧本及概率预测,并持续对预测结果进行校准评估。
想象一个 AI 分析师 全天候阅读全球新闻,构建结构化地缘政治事件图谱,在不同 IR 理论视角下推演可能的未来,并通过系统化校准从错误中学习。
核心解决的问题:信息过载、认知偏差、预测缺乏反馈闭环。
| Problem | Solution |
|---|---|
| 24/7 news cycle overwhelms human analysts | Automated RSS ingestion + LLM clustering & abstraction |
| Analysis is often single-perspective | 3+ IR theories applied simultaneously to every event |
| "Prediction" without accountability | Built-in calibration: Brier score, hit rate, error analysis |
| Qualitative analysis lacks structure | Every event → structured data model → quantifiable scenarios |
| Historical knowledge is underused | Historical analogy engine with 100+ case database |
| Black-box AI predictions | Every script step is traceable: actor → motivation → evidence |
- Multi-source RSS feed ingestion (Reuters, AP, regional sources)
- Semantic clustering of related news articles using LLM embeddings
- Automatic deduplication and story grouping
- LLM-powered extraction of structured IR events from news clusters
- Captures: actors, event type, crisis stage, strategic dimensions, rule-of-engagement triggers
- Produces clean, structured
AbstractIRGEventdata models
Apply 6+ international relations theories to each event:
- Realism — power politics, security dilemmas
- Liberal Institutionalism — institutional constraints, norms
- Constructivism — identity, narrative, perception
- Geopolitics — geography, resources, strategic chokepoints
- International Political Economy — trade interdependence
- Power Transition Theory — hegemonic dynamics
For each event, generate scripted scenarios across three directions:
- 🔴 Escalation — conflict intensifies
- 🟡 Stalemate — status quo persists
- 🟢 De-escalation — tensions resolve
Each script includes:
- Step-by-step timelines with actor motivations
- Trigger conditions & invalidation conditions
- Probability distributions (low / central / high estimates)
- Supporting & counter evidence per step
- Confidence levels and uncertainty annotations
- Create branching "what-if" scenarios from any prediction run
- Simulate alternative actor moves, constraint changes, or external shocks
- Compare divergence points and new step paths
- Curated database of 100+ historical IR cases (Cuban Missile Crisis, Gulf War, South China Sea disputes, etc.)
- LLM-powered structural similarity matching
- Historical base-rate probabilities guide current forecasts
- Full CRUD for case library management
- Brier Score tracking (gold standard for probabilistic forecast accuracy)
- Calibration Grade (A–F) with quality benchmarks
- Step-level & script-level hit rate tracking
- By-direction, by-theory, by-event-type, by-crisis-stage breakdowns
- Calibration curve visualization (predicted vs. actual)
- Automated improvement suggestions
- Complete prediction run history with expandable detail views
- Record actual outcomes with form-based entry
- Auto-generate evaluations comparing predictions to reality
- Error type classification and accuracy rate computation
- Interactive 3D globe showing geopolitical events geographically
- Color-coded crisis stages and relationship types
- Map layer switching (satellite / dark / night)
- Generate structured PDF reports for events, scenarios, themes, and reviews
- Chinese font support (WenQuanYi / Noto CJK)
- Every user-facing string is internationalized
- Dynamic date/number formatting based on locale
┌─────────────────────────────────────┐
│ React 18 + TypeScript │
│ (Vite build + PWA) │
│ ┌─────┐ ┌────┐ ┌───┐ ┌──────┐ │
│ │Globe│ │Pipe│ │Scn│ │Calib │ ... │
│ └──┬──┘ └──┬─┘ └─┬─┘ └──┬───┘ │
└─────┼───────┼─────┼──────┼──────────┘
│ │ │ │
┌─────┼───────┼─────┼──────┼──────────┐
│ ▼ ▼ ▼ ▼ │
│ REST API (FastAPI) │
│ ┌─────────────────────────────────┐ │
│ │ Routers: events, scenarios, │ │
│ │ pipeline, calibration, │ │
│ │ analogies, reports, auth │ │
│ └───────────┬─────────────────────┘ │
│ │ │
│ ┌───────────┼─────────────────────┐ │
│ │ Services: (Business Logic) │ │
│ │ • Ingestion (RSS + dedup) │ │
│ │ • Clustering (LLM embedding) │ │
│ │ • Event Abstraction (LLM) │ │
│ │ • Theory Analysis (LLM) │ │
│ │ • Scenario Engine (LLM) │ │
│ │ • Branch Engine │ │
│ │ • Analogy Engine │ │
│ │ • Calibration Service │ │
│ │ • PDF Export │ │
│ └───────────┬─────────────────────┘ │
│ │ │
│ ┌───────────┼─────────────────────┐ │
│ │ Core: │ │
│ │ • LLM Router (Anthropic) │ │
│ │ • Config Management │ │
│ │ • Auth (JWT) │ │
│ │ • Rate Limiter │ │
│ └───────────┬─────────────────────┘ │
│ │ │
│ ┌───────────▼─────────────────────┐ │
│ │ Database (SQLite / PostgreSQL) │ │
│ │ + Alembic Migrations │ │
│ └─────────────────────────────────┘ │
└───────────────────────────────────────┘
RSS Feeds → News Clusters → Abstract IR Events
│
┌─────────────┼─────────────┐
▼ ▼ ▼
Theory Scenario Historical
Analysis Scripts Analogies
│ │ │
└─────────────┼─────────────┘
▼
Prediction Runs
│
▼
Actual Outcome Recording
│
▼
Calibration & Evaluation
│
▼
PDF Report Export
- Python 3.12+
- Node.js 18+
- Anthropic API key (Get one here)
Windows:
start.batLinux / macOS:
chmod +x start.sh && ./start.shThe script will automatically:
- Check Python & Node environments
- Install missing dependencies
- Run database migrations
- Start backend (port 8000) & frontend (port 5173)
- Open the app in your browser
# Build and start
docker compose up --build -d
# Check status
docker compose ps
# View logs
docker compose logs -f backend
# Access the app
open http://localhost:8000# ── Backend ──
cd backend
python -m pip install -r requirements.txt
cp ../.env.example ../.env
# Edit .env to add your ANTHROPIC_API_KEY
python -m alembic upgrade head
python -m uvicorn backend.main:app --reload --port 8000
# ── Frontend ──
cd frontend
npm ci
npm run devVisit http://localhost:5173 in your browser.
Note: The platform requires a valid Anthropic API key for AI features (event abstraction, theory analysis, scenario generation, etc.). Without it, the ingestion and database features still work.
| Feature | Description |
|---|---|
| 🌐 3D Globe | Interactive globe with event markers, crisis stage coloring, relationship arcs |
| 📡 Pipeline | End-to-end analysis pipeline: ingest → cluster → abstract → theorize → simulate |
| 🌿 Scenarios | Three-column layout showing escalation, stalemate, de-escalation scripts with step details |
| 📈 Calibration | Brier score gauge, grade levels, hit-rate breakdowns by direction/theory/stage |
| 📜 Analogies | Split-panel: event analysis + historical case library with similarity scoring |
| 📄 Reports | Configurable PDF generation for event briefs, scenario reports, thematic reviews |
| Component | Technology |
|---|---|
| Framework | FastAPI (Python 3.12+) |
| Database ORM | SQLAlchemy 2.0 + Alembic |
| AI / LLM | Anthropic Claude API (via custom LLM Router) |
| Auth | JWT (PyJWT + passlib/bcrypt) |
| Rate Limiting | SlowAPI |
| PDF Engine | ReportLab 4.2 (with CJK font support) |
| Geocoding | Geopy (Nominatim) |
| Monitoring | Prometheus (prometheus-fastapi-instrumentator) |
| Component | Technology |
|---|---|
| Framework | React 18 (TypeScript) |
| Build Tool | Vite 5 |
| Styling | Tailwind CSS 3 |
| State | Zustand |
| Charts | Recharts |
| 3D Globe | Globe.GL (Three.js) |
| Maps | Leaflet |
| i18n | react-i18next / i18next |
| Routing | React Router 6 |
| PWA | vite-plugin-pwa (Workbox) |
| Component | Technology |
|---|---|
| Containerization | Docker + Docker Compose |
| CI/CD | GitHub Actions |
| Linting | Ruff (Python), TypeScript Compiler |
| Testing | Pytest + Playwright (e2e) |
When the backend is running, visit:
- Swagger UI: http://localhost:8000/api/docs
- ReDoc: http://localhost:8000/api/redoc
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/register |
User registration |
POST |
/api/v1/auth/token |
JWT token login |
GET |
/api/v1/events |
List abstract IR events |
POST |
/api/v1/pipeline/run |
Trigger full analysis pipeline |
GET |
/api/v1/pipeline/runs |
List prediction runs |
GET |
/api/v1/scenarios/{event_id} |
Get scenario scripts |
POST |
/api/v1/branches |
Create counterfactual branch |
GET |
/api/v1/analogies/{event_id} |
Get historical analogies |
POST |
/api/v1/history/{run_id}/outcome |
Record actual outcome |
POST |
/api/v1/history/{run_id}/evaluation |
Generate auto-evaluation |
GET |
/api/v1/calibration/summary |
Get calibration summary |
POST |
/api/v1/reports/export |
Generate PDF report |
- Architecture Guide — system design, data models, service interactions
- User Guide — walkthrough of all features
- API Reference — interactive Swagger docs
- Contributing Guide — how to contribute
- Security Policy — vulnerability reporting
We welcome contributions! See CONTRIBUTING.md for:
- Development environment setup
- Code style guidelines
- Pull request process
- Testing requirements
git clone https://github.com/your-org/ir-intel-platform.git
cd ir-intel-platform
cp .env.example .env # Add your ANTHROPIC_API_KEY
pip install -r backend/requirements.txt
cd frontend && npm ci && cd ..
# Start both services and start hacking!This project is licensed under the MIT License — see the LICENSE file for details.
- Anthropic — for the Claude API that powers the LLM reasoning
- Three.js / Globe.GL — for the 3D globe visualization
- FastAPI — for the excellent Python web framework
- All open-source contributors whose libraries make this project possible
Built with ❤️ by the IR Intel Platform team
⭐ Star us on GitHub — it helps more people discover the platform!