Open-source financial intelligence
Live dashboards, options analytics, CSV data export, and AI agents grounded in market data.
π Live demo: open-alpha-finance.vercel.app
Active architecture: frontend-only Next.js runtime.
backend/is kept in the repository as legacy/reference code.
OpenAlpha runs from the frontend/ app only. The Python backend/ folder is legacy/reference code and is not required for local development.
cd frontend
cp .env.example .env.local
npm install
npm run devOpen http://localhost:3000.
Before using the full product, edit frontend/.env.local and add the server-side values you need. Start from frontend/.env.example.
- Quick start
- What OpenAlpha does
- Agentic workflow
- Product surfaces
- Architecture
- Local setup
- Deployment
- Repo layout
- Development checks
- Notes for contributors
Landing page with agent entry point, asset classes, and tools.
OpenAlpha provides you a fully configured agent. You can with its help or not:
- Browse stock dashboards with price, fundamentals, news, SEC filings
- Browse curated commodity dashboards across metals, energy, agriculture, and benchmark series
- Explore macro dashboards for the United States and France
- Browse crypto dashboards for BTC and ETH perpetuals
- Use Quant Alpha for U.S. equity options chains, Greeks, payoff diagrams, and volatility surfaces
- Export raw CSV time series from the dedicated Get the data workspace
- Use AI agents that stay grounded in the current dashboard or workflow
- Send prompts by text or by voice with server-side Voxtral transcription
| Area | What you get |
|---|---|
| Stocks | Price, chart, fundamentals, news, filings copilot |
| Macro | U.S. and France dashboards with country-aware context |
| Commodities | Curated dashboards across metals, energy, agriculture, and benchmark series |
| Crypto | BTC and ETH perpetual dashboards backed by Deribit |
| Quant Alpha | U.S. equity options analytics with chains, Greeks, payoff diagrams, and IV surfaces |
| Data retrieval | Raw CSV export with a dedicated planning assistant |
| Voice input | Optional microphone input on Alpha and Quant Alpha with Voxtral transcription |
Stock dashboard with live market context and grounded agent workflow.
OpenAlpha uses tool-based agentic workflows for both Alpha and Quant Alpha.
The agent stack is intentionally simple and explicit:
- LLM provider: Mistral Chat Completions API
- Model access: direct server-side
fetch - Runtime: custom Next.js route handler at
frontend/src/app/api/agent/route.ts - Orchestrator: custom multi-round tool loop in
frontend/src/server/agent/service.ts - Tool registry: allowlisted function definitions in
frontend/src/server/agent/tools.ts - Client transport: Server-Sent Events (SSE)
- Client rendering:
react-markdown,remark-gfm,remark-math,rehype-highlight,rehype-katex
When you ask Alpha a question, the model does not answer from memory first. The server builds a context-aware request, lets Mistral decide which allowlisted tools to call, executes those tools server-side, feeds the tool output back into the conversation, and only then streams the final answer to the UI.
- The user sends a prompt by text or voice from a dashboard, from Get the data, or from the Quant Alpha workspace.
POST /api/agentorPOST /api/quant-agentvalidates the request, applies the request quota, and normalizes the available context:- stock ticker
- macro country
- commodity instrument
- crypto instrument
- data-planning mode
- quant options context
- The server builds a context-aware user message in
buildUserContent(...).- Example: on a commodity page, the prompt is augmented so the model knows it must stay grounded in that exact commodity dashboard.
- The server sends the conversation to Mistral with:
- the system prompt
- the user message
- the allowlisted tool schema from
TOOL_DEFINITIONS tool_choice: "auto"parallel_tool_calls: false
- If the model tries to answer without calling a tool first, OpenAlpha forces another round with:
You must call at least one tool before answering. Do not answer from memory.
- Each tool call is executed server-side by
dispatchToolWithDisplay(...).- Market and research tools return structured JSON back to the model
- Some tools also emit UI display events such as metric cards or mini charts
- Tool outputs are appended back into the conversation as
toolmessages, and the loop continues.- The loop is bounded to 10 rounds max
- When the model is ready to answer, OpenAlpha switches to a streaming completion request and sends SSE events to the browser.
- The client parses those events and renders:
- tool call traces
- tool success/failure states
- streamed markdown text
- metric cards
- inline charts
- dashboard or data-export handoff cards
- Function calling / tool use through Mistralβs tool schema
- Context injection from the active page so the model stays grounded in the right asset or country
- Bounded planning loop with explicit maximum tool rounds
- Structured tool serialization: tool outputs are returned to the model as JSON, not prose
- SSE streaming for low-latency UI updates while the answer is being generated
- Display side-channel: tools can emit UI artifacts such as
display_metric,display_chart, anddisplay_download - Hard allowlist: only declared server-side tools are callable
- Quota gating on agent requests before model execution
- Voice input through browser recording plus a server-side Voxtral transcription route
OpenAlpha deliberately avoids a heavyweight agent framework. The current stack is:
- Next.js App Router for the API runtime
- Mistral Chat Completions API for model inference
- native
fetchfor model calls and provider calls - custom orchestration code in:
frontend/src/server/agent/service.tsfrontend/src/server/agent/tools.tsfrontend/src/server/agent/prompt.ts
react-markdown+remark-gfmfor assistant response renderingremark-math+rehype-katexfor math supportrehype-highlightfor code block highlighting
Current context-aware behavior:
- Stock dashboard: Alpha uses stock, fundamentals, news, filings, and price-history tools for the current ticker
- Macro dashboard: Alpha uses macro snapshot and series tools for the selected country
- Commodity dashboard: Alpha uses commodity overview and price-history tools for the current instrument
- Crypto dashboard: Alpha uses Deribit-backed crypto overview and price-history tools for the current perpetual
- Get the data: Alpha acts as a data assistant and maps one project to one supported export at a time
- Quant Alpha: Quant Alpha uses option-chain, Greeks, payoff, and volatility-surface tools for the selected U.S. equity
The agent can also suggest handoffs:
- open a stock, macro, commodity, or crypto dashboard when the destination is clear
- open the Get the data page with a prefilled export plan when the user asks for raw data
The data workspace for CSV export and project-to-dataset planning.
- Stocks: equities with overview metrics, chart, fundamentals, news, filings, and agent
- Macro: U.S. and France dashboards with country-aware context
- Commodities: curated commodity dashboards with charts and agent support
- Crypto: BTC and ETH perpetual dashboards backed by Deribit public market data
- dedicated options workspace at
/quant - U.S. equity options only
- live option-chain snapshots from Yahoo Finance
- Black-Scholes Greeks and higher-order Greeks
- payoff diagrams for multi-leg structures
- SSVI-based implied-volatility surfaces
- dedicated Quant Alpha agent with a split chat + analytics display surface
Quant Alpha workspace with the options agent, analytics display surface, and quick-pick flows.
- Active runtime: Next.js single-deploy application in
frontend/ - Legacy/reference code: FastAPI backend in
backend/ - Deployment target: Vercel
- Current crypto scope: BTC and ETH perpetuals only
- Current quant scope: U.S. equity options only
- Get the data exports raw CSV series for:
- stocks
- macro
- commodities
- crypto
- one asset per export
- CSV only
- raw numeric series only
- the app includes a configurable AI request quota flow
- when the quota is exhausted, a password unlock modal can add more requests
- production quota enforcement is designed to run server-side with Upstash Redis
QUOTA_ENABLED=falseforces the legacy cookie quota path for that deployment
- every shared agent window supports typed prompts and microphone input
- browser audio is recorded locally, then transcribed server-side with Voxtral
- the resulting transcript is injected into the normal agent flow
- supported on both Alpha and Quant Alpha
Macro dashboard with country-aware context and live series exploration.
The active application lives in frontend/:
- Next.js App Router
- server-side route handlers under
frontend/src/app/api/... - provider integrations and business logic under
frontend/src/server/... - intended for a single deployment on Vercel
- same-origin
/api/...calls from the UI
The Python backend in backend/ is legacy/reference code.
It stays in the repository for migration history and reference value, but the current project direction is to run OpenAlpha as a frontend-only Next.js application with server-side route handlers. Contributors should treat the backend as legacy unless they are explicitly working on historical parity or migration context.
- Node.js 20+
- npm
Use the Quick start section above to install and run the active app locally.
Create frontend/.env.local from frontend/.env.example and set the server-side values you need.
Required or commonly used variables:
| Variable | Purpose |
|---|---|
MISTRAL_API_KEY |
Enables the AI agent |
MISTRAL_MODEL |
Selects the Mistral model, defaults to mistral-small-latest if omitted |
FRED_API_KEY |
Enables macro data |
EDGAR_USER_AGENT |
Required for SEC EDGAR access |
REQUEST_QUOTA_SIGNING_SECRET |
Signs the request quota cookie |
REQUEST_OVERRIDE_PASSWORD |
Password used to unlock more AI requests |
QUOTA_ENABLED |
Enables the server-side quota adapter, defaults to true |
UPSTASH_REDIS_REST_URL |
Upstash Redis REST endpoint for server-side quota |
UPSTASH_REDIS_REST_TOKEN |
Upstash Redis REST token for server-side quota |
Important notes:
- secrets are server-side only
- do not use
NEXT_PUBLIC_for these values - the active app does not require
NEXT_PUBLIC_API_URL - for deployment, these values belong in Vercel environment variables
- if
QUOTA_ENABLED=true, configure Upstash - set
QUOTA_ENABLED=falseonly when you intentionally want to use the legacy cookie quota path
OpenAlpha is intended to deploy as a single Next.js app on Vercel.
Recommended production setup:
- root directory:
frontend - framework preset:
Next.js - secrets stored in Vercel environment variables
- same-origin
/api/...calls only
The active production model is:
- browser UI in Next.js
- server-side route handlers in Next.js
- no separate FastAPI service required
frontend/β active Next.js applicationbackend/β legacy FastAPI implementation kept for referencedocs/β plans, rollout notes, and internal documentation
cd frontend
npm run lint
npm run buildThis is the next product surface planned for OpenAlpha after the current dashboards, Quant Alpha, and data workflow.
This upcoming surface is intended to focus on equity reports and AI-assisted document analysis:
- browse company reports and filings in a dedicated research workspace
- ask grounded questions about business quality, risks, guidance, and operating changes
- use AI to extract the important signal from long-form company materials faster
- stay focused on document-based research assistance rather than full valuation tooling
This is planned next work, not an active product surface in the current runtime yet.
- the root README documents the active app, not the historical two-service setup
- if you see Python/FastAPI code in the repo, treat it as legacy unless the task explicitly targets it
- README screenshots live in
README.assets/




