How eranlary/ai_hedge_2 works
AI_HEDGE_2 is an equity-research and portfolio platform: a ticker run gathers financial and market research, performs valuation, and produces report artifacts that the web app serves. Other documented product domains include portfolio/research features, release-scoped Nasdaq analysis, LLM-run observability, and isolated IBKR Paper execution. The graph retains these separate domains. Some subsystems are documented but not sampled; their links are included only where the README or indexed references support them.
Main entry points: runner.py Analysis runner · (app) Research dashboard · writer.py Report database · cli.py Local CLI
Components 22
Analysis core
- Local CLI
src/ai_hedge/cli.py - Analysis runner
src/ai_hedge/runner.py - Valuation logic
src/ai_hedge/legacy_port.py - Research agents
src/ai_hedge - Market data
src/ai_hedge/yahooquery_data.py - Analysis artifacts
src/ai_hedge/io/artifacts.py - Report database
src/ai_hedge/db/writer.py
Public research app
- Research dashboard
frontend/src/app/(app) - Research API
frontend/src/app/api - Reports and filings
frontend/src/app/(app)/reports/page.tsx - Portfolio features
frontend/src/lib/portfolio-performance-engine.ts
Nasdaq worker
- Nasdaq run control
frontend/src/app/api/nasdaq100/runs/route.ts - Analysis worker
scripts/nasdaq_worker_server.py
Run observability
- Observability app
frontend-obs/src/app/(authed) - Run telemetry
src/ai_hedge/obs - Observability database
frontend-obs/src/lib/obs-db.ts
Paper execution
- Trading control plane
frontend/src/app/api/trading - Paper execution agent
trading_executor/engine.py
Other components
- Research user
- Web user
- Admin user
- IB Gateway
Connections 21
- Research user → Local CLI: starts run
README.md - Local CLI → Analysis runner: dispatches
- Analysis runner → Valuation logic: orchestrates
src/ai_hedge/runner.py - Analysis runner → Research agents: invokes agents
src/ai_hedge/runner.py - Analysis runner → Market data: uses data
- Analysis runner → Analysis artifacts: creates artifacts
README.md - Analysis runner → Report database: writes reports
README.md - Web user → Research dashboard: views research
README.md - Research dashboard → Research API: requests data
- Research API → Report database: serves reports
README.md - Research dashboard → Reports and filings: views reports
README.md - Research dashboard → Portfolio features: tracks portfolios
README.md - Web user → Nasdaq run control: starts analysis
- Nasdaq run control → Analysis worker: dispatches runs
README.md - Analysis worker → Report database: stores results
- Analysis runner → Run telemetry: instruments runs
README.md - Admin user → Observability app: inspects runs
README.md - Observability app → Observability database: reads telemetry
- Web user → Trading control plane: controls trading
- Trading control plane → Paper execution agent: sends commands
- Paper execution agent → IB Gateway: places orders
README.md