SPB Git

spb/airiskindex Public

The most methodologically rigorous, fully transparent AI job-exposure index.

TypeScript 88% Python 6.1% SQL 2.7% CSS 1.2% JavaScript 0.9% Shell 0.8%
10.8 KB · 180 lines markdown
Rendered Raw Blame History
1<div align="center">23<img src="apps/web/public/logo.svg" alt="AI Risk Index" width="360" />45# AI Risk Index67**The most methodologically rigorous, fully transparent AI job-exposure index.**89[![Live](https://img.shields.io/badge/live-www.airiskindex.io-2a78d6)](https://www.airiskindex.io)10[![Methodology](https://img.shields.io/badge/methodology-1.0.0--draft.1-1c5cab)](https://www.airiskindex.io/methodology)11[![Occupations](https://img.shields.io/badge/occupations-1%2C016-2a78d6)](https://www.airiskindex.io/occupations)12[![Scored](https://img.shields.io/badge/scored-923-2a78d6)](https://www.airiskindex.io/ranking)13[![Tasks rated](https://img.shields.io/badge/O*NET_tasks_rated-18%2C796-2a78d6)](https://www.airiskindex.io/methodology)14[![Ratings](https://img.shields.io/badge/dimension_ratings-~225k-1c5cab)](https://www.airiskindex.io/methodology)15[![Rater panel](https://img.shields.io/badge/rater_panel-Sonnet_5_%2B_Haiku_4.5-6da7ec)](https://www.airiskindex.io/methodology)16[![Scores license](https://img.shields.io/badge/scores-CC_BY_4.0-0ca30c)](https://creativecommons.org/licenses/by/4.0/)1718[![Next.js](https://img.shields.io/badge/Next.js-14-000000?logo=nextdotjs)](apps/web)19[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white)](packages/scoring)20[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-4169e1?logo=postgresql&logoColor=white)](packages/db)21[![Python](https://img.shields.io/badge/Python-3.12%2B-3776ab?logo=python&logoColor=white)](apps/etl)22[![Monorepo](https://img.shields.io/badge/pnpm-Turborepo-f69220?logo=pnpm&logoColor=white)](pnpm-workspace.yaml)23[![Tests](https://img.shields.io/badge/tests-12_passing-0ca30c)](packages/scoring/src)2425**[Ranking](https://www.airiskindex.io/ranking)** · **[Insights](https://www.airiskindex.io/insights)** · **[Methodology](https://www.airiskindex.io/methodology)** · **[API](https://www.airiskindex.io/api/v1/methodology)**2627</div>2829---3031## Headline metrics (run 1.0.0-draft.1 · 2026-08-05)3233| Metric | Value | Pastille |34|---|---|---|35| Share of the U.S. wage bill under substitution pressure | **32%** (≈ $4.7T of $14.5T) | ![32%](https://img.shields.io/badge/wage_bill_under_pressure-32%25-e34948) |36| Employment-weighted substitution score | **34** / 100 | ![34](https://img.shields.io/badge/emp--weighted_substitution-34-2a78d6) |37| Employment-weighted augmentation score | **55** / 100 | ![55](https://img.shields.io/badge/emp--weighted_augmentation-55-0ca30c) |38| Workers in high-substitution occupations (≥ 70) | **5.3M** (2.7%) | ![5.3M](https://img.shields.io/badge/workers_high_pressure-5.3M-eda100) |39| Workers in high-augmentation occupations (≥ 70) | **47.8M** (24.6%) | ![47.8M](https://img.shields.io/badge/workers_high_augmentation-47.8M-0ca30c) |40| Coverage | 887 occupations · 194.2M workers (BLS OEWS) | ![coverage](https://img.shields.io/badge/coverage-194.2M_workers-6da7ec) |4142> "Under pressure" means paid work overlapping with what AI can plausibly take over — **not a payroll forecast**. Realized effects to date are concentrated and cohort-specific; measured usage remains majority-augmentative. The index is built as **adaptation guidance, not doom**.4344## What this is4546AI Risk Index scores **every U.S. occupation** on its exposure to AI-driven automation using a **task-based methodology**: each of the ~18,800 O*NET task statements is rated individually by a **multi-model LLM panel**, and occupation scores are derived from importance-weighted task scores. Every number is **transparent, versioned, and reproducible**.4748### The three scores (never collapsed into one)4950| Score | Question it answers |51|---|---|52| **Exposure** | Is AI *technically capable* of performing the occupation's tasks? |53| **Substitution** | Does AI *actually replace* the human — after cost, barriers, and adoption? *(headline)* |54| **Augmentation** | Does AI *assist* the human, raising productivity without replacing them? |5556Every score ships with a **confidence interval derived from rater disagreement** — multi-model replication shows single-model exposure ratings can vary by an order of magnitude, so a single-model index is an artifact. Ours makes the disagreement visible.5758## Methodology in one screen5960**Dimensions & weights** (v1 — defined once in [`packages/scoring/src/weights.ts`](packages/scoring/src/weights.ts), served live at [`/api/v1/methodology`](https://www.airiskindex.io/api/v1/methodology)):6162| Dimension | Weight | Orientation |63|---|---|---|64| Task automatability | 0.35 | direct |65| Current technical feasibility | 0.20 | direct |66| Cost of substitution vs. wage | 0.15 | direct |67| Adoption barriers | 0.20 | **inverted** — strong barriers protect |68| Sector adoption velocity | 0.10 | direct |6970**Formulas** — a rating *r* ∈ [1,5] normalizes to pressure *p* = (r−1)/4 (inverted: 1−(r−1)/4):7172```73substitution_task = 100 · Σ_d  w_d · p_d74exposure_task     = 100 · (w_auto·p_auto + w_feas·p_feas) / (w_auto + w_feas)75augmentation_task = 100 · p_augmentation          (rated separately, outside the composite)76occupation        = importance-weighted mean of its tasks (O*NET IM weights)77CI bounds         = worst/best-case envelope over the rater panel (min/mean/max)78```7980The scoring engine ([`packages/scoring`](packages/scoring)) is **pure and deterministic** — no I/O, no clock, no randomness — pinned by property-based tests (fast-check) and a published worked example reproduced to 3 decimals. Full spec: [METHODOLOGY.md](docs/methodology/METHODOLOGY.md) · [changelog](docs/methodology/CHANGELOG.md).8182**Rating pipeline** ([`apps/worker`](apps/worker)): Anthropic **Message Batches** (50% discount, prompt-cached rubric, schema-constrained JSON output), one request per task × model, deterministic `custom_id`s → idempotent and resumable. Every rating stores model, prompt version, raw response, parsed score, and rationale — the **full audit trail is visible on every occupation page** (expand any task).8384**Integrity rules**: weights/formulas/prompt changes bump `INDEX_VERSION` with a changelog entry; every published score traces to an immutable `score_runs` row; historical runs stay queryable forever.8586## Data sources8788| Source | Version | Role | License |89|---|---|---|---|90| [O*NET database](https://www.onetcenter.org/database.html) | 30.3 (May 2026) | 1,016 occupations, 18,796 task statements, importance weights | CC BY 4.0 |91| [BLS OEWS](https://www.bls.gov/oes/) | May 2025 national | Median wages + employment (830 SOCs) | Public domain |92| ESCO v1.2 + ROME 4.0 | planned | EU/France crosswalk | EUPL / Licence Ouverte |93| Adoption evidence (BTOS, Anthropic Economic Index, …) | 2025–2026 | Grounds the adoption-velocity & barriers rubrics | various |9495Raw dumps are immutable (`data/raw/`, fetched by script, never committed); derived artifacts commit **manifests only** (hashes + row counts). The research corpus grounding v1 — 20+ indices reviewed, verified source URLs, API cost analysis — lives in [`docs/research/`](docs/research/README.md).9697## Public API9899Versioned, JSON, `index_version` in every payload. Rate limit 60 req/min (600 with key).100101```bash102# Health103curl https://www.airiskindex.io/api/v1/health104105# Machine-readable methodology (weights, orientation, thresholds)106curl https://www.airiskindex.io/api/v1/methodology107108# Search occupations109curl "https://www.airiskindex.io/api/v1/occupations?q=paralegal"110111# Full score breakdown: sub-scores, CI bounds, tasks, wages112curl https://www.airiskindex.io/api/v1/occupations/23-2011.00113```114115## Monorepo116117```118airiskindex/119├── apps/120│   ├── web/          # Next.js 14 — site + public API (ranking, insights, detail pages, drawer nav)121│   ├── worker/       # BullMQ + Anthropic Message Batches rater pipeline, recompute, purge scripts122│   └── etl/          # Python 3.12 — O*NET/OEWS download → transform (manifests) → Postgres load123├── packages/124│   ├── scoring/      # Pure TS scoring engine — the auditable core (weights, formulas, CI)125│   ├── db/           # Prisma schema: occupations, tasks, rating audit trail, immutable runs126│   ├── ui/           # Shared React components127│   └── config/       # Shared tsconfig presets128├── data/             # raw/ (immutable, gitignored) · derived/ (manifests committed)129├── docs/130│   ├── methodology/  # METHODOLOGY.md (source of truth), changelog, worked examples131│   └── research/     # Research corpus: indices, data sources, rater API, market evidence132└── infra/            # docker-compose, PM2 wrappers, ngrok config, deploy script133```134135## Quick start136137```bash138pnpm install139docker compose -f infra/docker-compose.dev.yml up -d   # postgres 16 + redis (or brew services)140cp infra/.env.example .env                             # fill DATABASE_URL, ANTHROPIC_API_KEY, RATER_MODELS…141pnpm db:migrate && pnpm db:seed142pnpm dev                                               # web on :3000143```144145Full pipeline to a real index:146147```bash148cd apps/etl && make pipeline        # O*NET 30.3 + OEWS → Postgres (1,016 occupations, 18,796 tasks)149pnpm --filter @airiskindex/worker rate    # multi-model batch rating (parallel, resumable)150pnpm score:recompute                # new immutable score run151```152153Checks (must pass before any commit): `pnpm typecheck && pnpm lint && pnpm test`154155## Design system156157Charts follow a validated, colorblind-safe reference palette (sequential blue for magnitude, CI whiskers in muted ink, emphasis form for "you are here" distributions, visible data-table fallbacks). Fully responsive — right-side drawer navigation on mobile, dark mode with selected (not flipped) palette steps.158159## Roadmap160161- [ ] 5% human review sample + expert Delphi override queue (schema ready)162- [ ] Sensitivity analyses published per release (`docs/methodology/sensitivity/`)163- [ ] Convergent-validity report vs Felten AIOE, GPTs-are-GPTs, ILO gradients164- [ ] ESCO/ROME crosswalk — EU & France coverage165- [ ] API keys + rate limiting middleware166- [ ] `INDEX_VERSION` 1.0.0 — first published run167168## License, citation & contact169170- **Scores & derived data**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — reuse freely with attribution *"AI Risk Index (airiskindex.io), version X"*.171- **Code, site design & text**: © 2026 Simon-Pierre Boucher. All rights reserved.172- Incorporates the O*NET® database (USDOL/ETA, CC BY 4.0) and BLS OEWS data. O*NET® is a trademark of USDOL/ETA, which has not reviewed or endorsed this project.173174> **Cite as:** *AI Risk Index, version 1.0.0-draft.1, airiskindex.io, Simon-Pierre Boucher (2026).*175176**Contact** — methodology questions, corrections, expert-panel participation, commercial licensing & contracts:177**Simon-Pierre Boucher** · [contact@spboucher.ai](mailto:contact@spboucher.ai)178179<sub>[Terms of Service](https://www.airiskindex.io/terms) · [Privacy Policy](https://www.airiskindex.io/privacy)</sub>180