Intelligence in Finance — A Temporal Graph Neural Network platform for corporate stress prediction across the S&P 500.
GraphAlpha models 503 S&P 500 companies as an evolving network — supply-chain dependencies, shared investors, sector co-movement, and board interlocks — and combines temporal graph attention with LLM-extracted features from 10-K/10-Q filings and earnings calls. The result: early signals of corporate financial distress, before traditional metrics react.
Most credit-risk models treat companies in isolation. GraphAlpha treats them as a graph that evolves over time, with three signal layers fused together:
- Linguistic drift in SEC filings — a company that diverges from its own historical language and from its peers is signaling stress.
- Heterogeneous relationships — risk propagates through supply chains, shared investor bases, and sector co-membership.
- Temporal attention — the model learns which relationships and which time windows actually matter for contagion.
End-to-end explainability traces every prediction back through attention weights → signal attribution → source sentences in specific filings.
Interactive dashboard tracking 503 S&P 500 companies with risk scores, signal attribution, and a force-directed network graph with animated edge glow effects.
503-node force-directed graph showing inter-company relationships across 5 edge types. Edges glow to highlight active risk pathways.
Per-company analysis with risk gauge, signal category breakdown, temporal risk timeline, feature attribution charts, and a 1-hop neighbor subgraph.
Auto-generated analyst notes and interactive chat, grounded in the model's signal attribution and graph context.
Benchmarking 5 architectures (MLP, Static GNN, TGN, TGAT, GraphAlpha Transformer) on AUROC, Sharpe ratio, hit rate, and cumulative PnL.
| Model | AUROC | AUPRC | Hit@20 | Sharpe |
|---|---|---|---|---|
| MLP Baseline | 0.700 | 0.450 | 50% | 1.20 |
| Static GNN | 0.736 | 0.520 | 58% | 1.65 |
| TGN | 0.710 | 0.500 | 55% | 1.40 |
| TGAT | 0.720 | 0.530 | 60% | 1.55 |
| GraphAlpha Transformer | 0.742 | 0.627 | 67% | 2.79 |
SEC Filings Market Data Earnings Calls
│ │ │
└────────┬───────────┴──────────┬──────────┘
│ │
Feature Extraction LLM Extraction (GPT)
│ │
┌────────┴───────────┐ │
│ │ │
Language Drift Market Signals Sentiment / Risk Phrases
(Embeddings) Fundamentals Management Tone
│ │ │
└────────┬───────────┴──────────┘
│
Graph Construction
│
┌────────┴────────────────────────┐
│ │
Heterogeneous Edges (5 types) Node Features
• Supply Chain
• Shared Investors
• Sector Co-membership
• Board Interlocks
• News Co-mention
│
└────────┬────────────────────────┘
│
Temporal Graph Transformer (multi-head temporal attention)
│
Risk Scores (0-1)
│
Explainable Reports (attention → attribution → sources)
- Models: PyTorch — custom Temporal Graph Transformer with multi-head temporal attention
- Backend: FastAPI + PyTorch serving
- Frontend: React + TypeScript + Vite + Chart.js
- LLM Integration: OpenAI GPT for feature extraction, analyst note generation, and interactive chat
- Training infra: Slurm-ready (
sbatch_production.sh,train_job.sh,llm_worker*.sh)
git clone https://github.com/zahirnik/GraphAlpha-core.git
cd GraphAlpha-core
pip install -e ".[dev]"
pytestRun the demo app:
streamlit run app/streamlit_app.pyOr the FastAPI backend:
uvicorn app.api.main:app --reloadGraphAlpha-core/
├── src/ # Core library
│ ├── ingestion/ # SEC Edgar, market data, earnings transcripts
│ ├── features/ # Language drift, embeddings, market features
│ ├── graph/ # Graph construction, edge builders, entity resolution
│ ├── models/ # MLP, GNNs, GraphAlpha Transformer, baselines
│ ├── training/ # Lightning modules, losses, data loaders
│ ├── evaluation/ # Metrics, backtesting, portfolio sim, ablations
│ └── explain/ # Attention tracing, signal attribution
├── app/ # FastAPI + React frontend + Streamlit demo
├── configs/ # Hydra YAML configs
├── scripts/ # CLI entry points
├── notebooks/ # Analysis & case studies
├── tests/ # Unit & integration tests
├── docs/ # Architecture, ADRs, writeup
├── run_training.py # Training entry point
├── run_llm_extraction.py # LLM feature extraction pipeline
├── augment_graph.py # Graph augmentation
└── train_production.py # Production training run
- SEC Edgar — 10-K / 10-Q filings via edgartools
- Market data — price & volume via yfinance
- Earnings transcripts — Whisper-based transcription pipeline
- Fundamentals — income statement / balance sheet via custom ingestion
This software is under active development and is not recommended for production use. Provided "as is", without warranty of any kind, express or implied.
- No investment advice. GraphAlpha does not provide investment recommendations, trading signals, or financial advice.
- No guarantee of accuracy. Risk scores, model outputs, and AI-generated analyst notes may contain errors and must not be relied upon for financial decisions.
- No liability. The authors and contributors accept no responsibility or liability for any financial loss, damage, or adverse outcome arising from the use of this software.
- Use at your own risk. By using this software, you acknowledge that it is under development and agree that the authors bear no obligation for its performance, availability, or suitability for any purpose.
@software{graphalpha2026,
title = {GraphAlpha: Temporal Graph Neural Networks for Corporate Stress Prediction},
author = {Nikraftar, Zahir},
year = {2026},
url = {https://github.com/zahirnik/GraphAlpha-core}
}MIT — see LICENSE.




