[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80928":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":12,"rankGlobal":9,"rankLanguage":9,"license":13,"archived":14,"fork":14,"defaultBranch":15,"hasWiki":16,"hasPages":14,"topics":17,"createdAt":9,"pushedAt":9,"updatedAt":18,"readmeContent":19,"aiSummary":20,"trendingCount":12,"starSnapshotCount":12,"syncStatus":21,"lastSyncTime":22,"discoverSource":23},80928,"Global-Affairs-Simulation-Platform","EnceladusLin\u002FGlobal-Affairs-Simulation-Platform","EnceladusLin","An international relations intelligence and forecasting platform that integrates open-source data, event chains, actor modeling, knowledge graphs, and scenario simulation to support geopolitical risk analysis and structured strategic assessment.",null,"Python",32,0,"MIT License",false,"main",true,[],"2026-06-12 02:04:08","\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fyour-org\u002Fir-intel-platform?style=flat-square\" alt=\"License\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flanguages\u002Ftop\u002Fyour-org\u002Fir-intel-platform?style=flat-square\" alt=\"Top Language\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fyour-org\u002Fir-intel-platform?style=flat-square\" alt=\"Stars\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fyour-org\u002Fir-intel-platform?style=flat-square\" alt=\"Forks\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fyour-org\u002Fir-intel-platform?style=flat-square\" alt=\"Issues\">\n  \u003Cbr>\n  \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fyour-org\u002Fir-intel-platform\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg\" alt=\"CI\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.12+-blue?style=flat-square\" alt=\"Python\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftypescript-5.2-blue?style=flat-square\" alt=\"TypeScript\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Freact-18-61dafb?style=flat-square\" alt=\"React\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-active-success?style=flat-square\" alt=\"Status\">\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">🌏 IR Intelligence Platform\u003C\u002Fh1>\n\u003Ch3 align=\"center\">国际关系情报分析与推演平台\u003C\u002Fh3>\n\u003Cp align=\"center\">\u003Cem>Where International Relations meets AI — Analyze. Simulate. Predict.\u003C\u002Fem>\u003C\u002Fp>\n\n---\n\n## 📖 Table of Contents\n\n- [Overview](#-overview)\n- [Why This Project](#-why-this-project)\n- [Features](#-features)\n- [Architecture](#-architecture)\n- [Quick Start](#-quick-start)\n- [Screenshots](#-screenshots)\n- [Technology Stack](#-technology-stack)\n- [API Reference](#-api-reference)\n- [Documentation](#-documentation)\n- [Contributing](#-contributing)\n- [License](#-license)\n- [Acknowledgments](#-acknowledgments)\n\n---\n\n## 🌍 Overview\n\n**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.\n\n> Think of it as an **AI analyst that reads the world's news 24\u002F7**, builds structured geopolitical event graphs, simulates possible futures under different IR theoretical lenses, and learns from its mistakes through systematic calibration.\n\n### Core Philosophy\n\nTraditional geopolitical analysis suffers from three problems:\n1. **Information overload** — too many news sources to track manually\n2. **Cognitive bias** — analysts anchor on familiar narratives\n3. **No feedback loop** — predictions are made but rarely systematically evaluated\n\nThis platform addresses all three by:\n1. **Automated ingestion & abstraction** of global news into structured event models\n2. **Multi-theory, multi-directional scenario generation** to counter confirmation bias\n3. **Built-in calibration tracking** with Brier scores, hit-rate dashboards, and automatic evaluation\n\n\u003Cdetails>\n\u003Csummary>🇨🇳 中文介绍\u003C\u002Fsummary>\n\n**国关推演平台** 是一个端到端的 AI 驱动的国际关系情报分析与推演系统。它实时采集全球新闻，聚类相关报道，使用大语言模型抽象为结构化国际关系事件，应用多种 IR 理论进行分析，生成多方向推演剧本及概率预测，并持续对预测结果进行校准评估。\n\n> 想象一个 **AI 分析师** 全天候阅读全球新闻，构建结构化地缘政治事件图谱，在不同 IR 理论视角下推演可能的未来，并通过系统化校准从错误中学习。\n\n核心解决的问题：信息过载、认知偏差、预测缺乏反馈闭环。\n\u003C\u002Fdetails>\n\n---\n\n## 🎯 Why This Project\n\n| Problem | Solution |\n|---------|----------|\n| 24\u002F7 news cycle overwhelms human analysts | Automated RSS ingestion + LLM clustering & abstraction |\n| Analysis is often single-perspective | 3+ IR theories applied simultaneously to every event |\n| \"Prediction\" without accountability | Built-in calibration: Brier score, hit rate, error analysis |\n| Qualitative analysis lacks structure | Every event → structured data model → quantifiable scenarios |\n| Historical knowledge is underused | Historical analogy engine with 100+ case database |\n| Black-box AI predictions | Every script step is traceable: actor → motivation → evidence |\n\n---\n\n## ✨ Features\n\n### 🔄 Intelligent Ingestion & Clustering\n- Multi-source RSS feed ingestion (Reuters, AP, regional sources)\n- Semantic clustering of related news articles using LLM embeddings\n- Automatic deduplication and story grouping\n\n### 🧠 Event Abstraction Engine\n- LLM-powered extraction of structured IR events from news clusters\n- Captures: actors, event type, crisis stage, strategic dimensions, rule-of-engagement triggers\n- Produces clean, structured `AbstractIRGEvent` data models\n\n### 📊 Multi-Theory Analysis\nApply 6+ international relations theories to each event:\n- **Realism** — power politics, security dilemmas\n- **Liberal Institutionalism** — institutional constraints, norms\n- **Constructivism** — identity, narrative, perception\n- **Geopolitics** — geography, resources, strategic chokepoints\n- **International Political Economy** — trade interdependence\n- **Power Transition Theory** — hegemonic dynamics\n\n### 🌿 Multi-Directional Scenario Scripting\nFor each event, generate scripted scenarios across three directions:\n- 🔴 **Escalation** — conflict intensifies\n- 🟡 **Stalemate** — status quo persists\n- 🟢 **De-escalation** — tensions resolve\n\nEach script includes:\n- Step-by-step timelines with actor motivations\n- Trigger conditions & invalidation conditions\n- Probability distributions (low \u002F central \u002F high estimates)\n- Supporting & counter evidence per step\n- Confidence levels and uncertainty annotations\n\n### 🔀 Branch Engine (Counterfactual Simulation)\n- Create branching \"what-if\" scenarios from any prediction run\n- Simulate alternative actor moves, constraint changes, or external shocks\n- Compare divergence points and new step paths\n\n### 📜 Historical Analogy Engine\n- Curated database of 100+ historical IR cases (Cuban Missile Crisis, Gulf War, South China Sea disputes, etc.)\n- LLM-powered structural similarity matching\n- Historical base-rate probabilities guide current forecasts\n- Full CRUD for case library management\n\n### 📈 Calibration Dashboard\n- **Brier Score** tracking (gold standard for probabilistic forecast accuracy)\n- **Calibration Grade** (A–F) with quality benchmarks\n- Step-level & script-level hit rate tracking\n- By-direction, by-theory, by-event-type, by-crisis-stage breakdowns\n- Calibration curve visualization (predicted vs. actual)\n- Automated improvement suggestions\n\n### 📝 History & Evaluation\n- Complete prediction run history with expandable detail views\n- Record actual outcomes with form-based entry\n- Auto-generate evaluations comparing predictions to reality\n- Error type classification and accuracy rate computation\n\n### 🌐 3D Globe Visualization\n- Interactive 3D globe showing geopolitical events geographically\n- Color-coded crisis stages and relationship types\n- Map layer switching (satellite \u002F dark \u002F night)\n\n### 📄 Report Export\n- Generate structured PDF reports for events, scenarios, themes, and reviews\n- Chinese font support (WenQuanYi \u002F Noto CJK)\n\n### 🌍 Full i18n (Chinese + English)\n- Every user-facing string is internationalized\n- Dynamic date\u002Fnumber formatting based on locale\n\n---\n\n## 🏗 Architecture\n\n```\n                          ┌─────────────────────────────────────┐\n                          │          React 18 + TypeScript        │\n                          │         (Vite build + PWA)           │\n                          │  ┌─────┐ ┌────┐ ┌───┐ ┌──────┐     │\n                          │  │Globe│ │Pipe│ │Scn│ │Calib │ ...  │\n                          │  └──┬──┘ └──┬─┘ └─┬─┘ └──┬───┘     │\n                          └─────┼───────┼─────┼──────┼──────────┘\n                                │       │     │      │\n                          ┌─────┼───────┼─────┼──────┼──────────┐\n                          │     ▼       ▼     ▼      ▼           │\n                          │         REST API (FastAPI)            │\n                          │  ┌─────────────────────────────────┐  │\n                          │  │ Routers: events, scenarios,     │  │\n                          │  │   pipeline, calibration,        │  │\n                          │  │   analogies, reports, auth      │  │\n                          │  └───────────┬─────────────────────┘  │\n                          │              │                        │\n                          │  ┌───────────┼─────────────────────┐  │\n                          │  │ Services: (Business Logic)      │  │\n                          │  │  • Ingestion (RSS + dedup)      │  │\n                          │  │  • Clustering (LLM embedding)   │  │\n                          │  │  • Event Abstraction (LLM)      │  │\n                          │  │  • Theory Analysis (LLM)        │  │\n                          │  │  • Scenario Engine (LLM)        │  │\n                          │  │  • Branch Engine                │  │\n                          │  │  • Analogy Engine               │  │\n                          │  │  • Calibration Service          │  │\n                          │  │  • PDF Export                   │  │\n                          │  └───────────┬─────────────────────┘  │\n                          │              │                        │\n                          │  ┌───────────┼─────────────────────┐  │\n                          │  │ Core:                           │  │\n                          │  │  • LLM Router (Anthropic)       │  │\n                          │  │  • Config Management            │  │\n                          │  │  • Auth (JWT)                   │  │\n                          │  │  • Rate Limiter                 │  │\n                          │  └───────────┬─────────────────────┘  │\n                          │              │                        │\n                          │  ┌───────────▼─────────────────────┐  │\n                          │  │ Database (SQLite \u002F PostgreSQL)  │  │\n                          │  │  + Alembic Migrations           │  │\n                          │  └─────────────────────────────────┘  │\n                          └───────────────────────────────────────┘\n```\n\n### Data Flow\n\n```\nRSS Feeds → News Clusters → Abstract IR Events\n                                  │\n                    ┌─────────────┼─────────────┐\n                    ▼             ▼             ▼\n              Theory         Scenario       Historical\n              Analysis       Scripts        Analogies\n                    │             │             │\n                    └─────────────┼─────────────┘\n                                  ▼\n                          Prediction Runs\n                                  │\n                                  ▼\n                     Actual Outcome Recording\n                                  │\n                                  ▼\n                     Calibration & Evaluation\n                                  │\n                                  ▼\n                          PDF Report Export\n```\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n- **Python 3.12+**\n- **Node.js 18+**\n- **Anthropic API key** ([Get one here](https:\u002F\u002Fconsole.anthropic.com))\n\n### Option 1: One-Click Start\n\n**Windows:**\n```bat\nstart.bat\n```\n\n**Linux \u002F macOS:**\n```bash\nchmod +x start.sh && .\u002Fstart.sh\n```\n\nThe script will automatically:\n1. Check Python & Node environments\n2. Install missing dependencies\n3. Run database migrations\n4. Start backend (port 8000) & frontend (port 5173)\n5. Open the app in your browser\n\n### Option 2: Docker\n\n```bash\n# Build and start\ndocker compose up --build -d\n\n# Check status\ndocker compose ps\n\n# View logs\ndocker compose logs -f backend\n\n# Access the app\nopen http:\u002F\u002Flocalhost:8000\n```\n\n### Option 3: Manual Setup\n\n```bash\n# ── Backend ──\ncd backend\npython -m pip install -r requirements.txt\ncp ..\u002F.env.example ..\u002F.env\n# Edit .env to add your ANTHROPIC_API_KEY\npython -m alembic upgrade head\npython -m uvicorn backend.main:app --reload --port 8000\n\n# ── Frontend ──\ncd frontend\nnpm ci\nnpm run dev\n```\n\nVisit `http:\u002F\u002Flocalhost:5173` in your browser.\n\n> **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.\n\n---\n\n## 📸 Screenshots\n\n\u003C!-- TODO: Add actual screenshots\u002FGIFs of the running application -->\n\u003C!-- Suggested shots:\n1. 3D Globe view with event markers\n2. Pipeline analysis page with progress\n3. Scenario scripts (three-column escalation\u002Fstalemate\u002Fde-escalation view)\n4. Calibration dashboard with Brier gauge\n5. Historical analogy matching results\n6. PDF report preview\n-->\n\n| Feature | Description |\n|---------|-------------|\n| 🌐 **3D Globe** | Interactive globe with event markers, crisis stage coloring, relationship arcs |\n| 📡 **Pipeline** | End-to-end analysis pipeline: ingest → cluster → abstract → theorize → simulate |\n| 🌿 **Scenarios** | Three-column layout showing escalation, stalemate, de-escalation scripts with step details |\n| 📈 **Calibration** | Brier score gauge, grade levels, hit-rate breakdowns by direction\u002Ftheory\u002Fstage |\n| 📜 **Analogies** | Split-panel: event analysis + historical case library with similarity scoring |\n| 📄 **Reports** | Configurable PDF generation for event briefs, scenario reports, thematic reviews |\n\n---\n\n## 🛠 Technology Stack\n\n### Backend\n| Component | Technology |\n|-----------|-----------|\n| Framework | FastAPI (Python 3.12+) |\n| Database ORM | SQLAlchemy 2.0 + Alembic |\n| AI \u002F LLM | Anthropic Claude API (via custom LLM Router) |\n| Auth | JWT (PyJWT + passlib\u002Fbcrypt) |\n| Rate Limiting | SlowAPI |\n| PDF Engine | ReportLab 4.2 (with CJK font support) |\n| Geocoding | Geopy (Nominatim) |\n| Monitoring | Prometheus (prometheus-fastapi-instrumentator) |\n\n### Frontend\n| Component | Technology |\n|-----------|-----------|\n| Framework | React 18 (TypeScript) |\n| Build Tool | Vite 5 |\n| Styling | Tailwind CSS 3 |\n| State | Zustand |\n| Charts | Recharts |\n| 3D Globe | Globe.GL (Three.js) |\n| Maps | Leaflet |\n| i18n | react-i18next \u002F i18next |\n| Routing | React Router 6 |\n| PWA | vite-plugin-pwa (Workbox) |\n\n### DevOps\n| Component | Technology |\n|-----------|-----------|\n| Containerization | Docker + Docker Compose |\n| CI\u002FCD | GitHub Actions |\n| Linting | Ruff (Python), TypeScript Compiler |\n| Testing | Pytest + Playwright (e2e) |\n\n---\n\n## 📚 API Reference\n\nWhen the backend is running, visit:\n- **Swagger UI:** [http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdocs](http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdocs)\n- **ReDoc:** [http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fredoc](http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fredoc)\n\n### Key Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `\u002Fapi\u002Fv1\u002Fauth\u002Fregister` | User registration |\n| `POST` | `\u002Fapi\u002Fv1\u002Fauth\u002Ftoken` | JWT token login |\n| `GET` | `\u002Fapi\u002Fv1\u002Fevents` | List abstract IR events |\n| `POST` | `\u002Fapi\u002Fv1\u002Fpipeline\u002Frun` | Trigger full analysis pipeline |\n| `GET` | `\u002Fapi\u002Fv1\u002Fpipeline\u002Fruns` | List prediction runs |\n| `GET` | `\u002Fapi\u002Fv1\u002Fscenarios\u002F{event_id}` | Get scenario scripts |\n| `POST` | `\u002Fapi\u002Fv1\u002Fbranches` | Create counterfactual branch |\n| `GET` | `\u002Fapi\u002Fv1\u002Fanalogies\u002F{event_id}` | Get historical analogies |\n| `POST` | `\u002Fapi\u002Fv1\u002Fhistory\u002F{run_id}\u002Foutcome` | Record actual outcome |\n| `POST` | `\u002Fapi\u002Fv1\u002Fhistory\u002F{run_id}\u002Fevaluation` | Generate auto-evaluation |\n| `GET` | `\u002Fapi\u002Fv1\u002Fcalibration\u002Fsummary` | Get calibration summary |\n| `POST` | `\u002Fapi\u002Fv1\u002Freports\u002Fexport` | Generate PDF report |\n\n---\n\n## 📖 Documentation\n\n- [Architecture Guide](docs\u002Farchitecture.md) — system design, data models, service interactions\n- [User Guide](docs\u002Fuser-guide.md) — walkthrough of all features\n- [API Reference](http:\u002F\u002Flocalhost:8000\u002Fapi\u002Fdocs) — interactive Swagger docs\n- [Contributing Guide](CONTRIBUTING.md) — how to contribute\n- [Security Policy](SECURITY.md) — vulnerability reporting\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for:\n- Development environment setup\n- Code style guidelines\n- Pull request process\n- Testing requirements\n\n### Quick Contribution Setup\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fyour-org\u002Fir-intel-platform.git\ncd ir-intel-platform\ncp .env.example .env  # Add your ANTHROPIC_API_KEY\npip install -r backend\u002Frequirements.txt\ncd frontend && npm ci && cd ..\n# Start both services and start hacking!\n```\n\n---\n\n## 📄 License\n\nThis project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙏 Acknowledgments\n\n- **Anthropic** — for the Claude API that powers the LLM reasoning\n- **Three.js \u002F Globe.GL** — for the 3D globe visualization\n- **FastAPI** — for the excellent Python web framework\n- **All open-source contributors** whose libraries make this project possible\n\n---\n\n\u003Cp align=\"center\">\n  \u003Csub>Built with ❤️ by the IR Intel Platform team\u003C\u002Fsub>\n  \u003Cbr>\n  \u003Csub>⭐ Star us on GitHub — it helps more people discover the platform!\u003C\u002Fsub>\n\u003C\u002Fp>\n","Global-Affairs-Simulation-Platform 是一个国际关系情报分析与推演平台，集成了开源数据、事件链、参与者建模、知识图谱和情景模拟，支持地缘政治风险分析和结构化战略评估。该项目利用Python开发，结合了自然语言处理、机器学习等技术，能够实时收集全球新闻并将其转化为结构化的国际关系事件，通过多种国际关系理论进行分析，并生成多方向的情景剧本及概率预测。它适用于需要进行复杂国际局势研判、政策制定辅助以及战略规划的场景，特别适合政府机构、智库以及大型企业使用。",2,"2026-06-11 04:02:53","CREATED_QUERY"]