lc2panda/alphastream
alphastream 是一个由 AI 驱动的投资决策平台,通过多 Agent 协同编排系统,实时流式输出覆盖全球金融市场的深度洞察。基于 LangGraph 和 Python 构建,它无缝整合技术指标、基本面数据、资金流向分析和情绪智能,形成动态自适应的工作流。不同于传统的回测工具,alphastream 通过 SSE 将完整的决策过程——从数据获取、工具调用到最终推理——全程可视化,为投资者提供透明的可执行智能。
📊 Alphastream – AI‑Native Financial Analysis Platform
What it is – A full‑stack web application that lets users chat with an LLM‑driven multi‑agent system to analyse stocks, ETFs, indices and macro data. It combines real‑time market feeds, technical‑analysis charts, fundamental data, news‑sentiment extraction and a suite of 14 specialised agents (plus four “investment‑guru” personalities) orchestrated with LangGraph. The backend is a Flask + Python service; the frontend is a Next.js 16 + React 19 UI built with Tailwind, shadcn/ui and TradingView lightweight charts. All components can be started with a single Docker‑Compose command.
Core capabilities
| Capability | How it works (as described in the README) |
|---|---|
| AI chat & multi‑agent orchestration | Uses DeepSeek V4 (or any OpenAI‑compatible model) via the OpenAI SDK. LangGraph dynamically routes 14 agents (technical, fundamental, capital‑flow, sentiment, bull/bear debate, risk, decision, reflection, strategy‑evolver, plus four investor‑persona agents). Agents can call tools via function‑calling and the whole process streams back to the UI with Server‑Sent Events (SSE). |
| Real‑time market data | Dual‑source adapters (AKShare + BaoStock) provide redundancy for Chinese A‑shares, US stocks (SEC EDGAR), Hong‑Kong, ETFs, indices, macro series (FRED/NBS) and crypto (ccxt/CoinGecko). Technical indicators (K‑line, MA/EMA, MACD, RSI, Bollinger, volume) and fundamental metrics (PE, PB, ROE, financial statements) are exposed via REST endpoints. |
| Smart news & sentiment | Aggregates RSS from six sources and crawls Snowball, East‑Finance forums and Caixin via the OpenCLI crawler. An LLM extracts sentiment and hot‑topic tags. |
| Unified search | 17 search engines (8 Chinese, 9 global, 2 knowledge‑graph) are queried in parallel, de‑duplicated and returned to the agent or UI. |
| UI/UX | Dark glass‑morphism design, responsive three‑column layout, 10 “artifact” cards (charts, risk radar, decision cards, etc.), and persistent state stored in Zustand (local storage). |
| Streaming & observability | Backend emits SSE events (agent.started, agent.progress, agent.tool_call, agent.completed, agent.error). Health, metrics and adapter status endpoints are provided. |
| Deployment | Docker Compose (single‑command dev), separate front‑end/back‑end compose files, and a production compose with Nginx TLS termination. Optional Redis cache and SQLite DB. |
Tech stack (as listed)
- Frontend: Next.js 16.2.9, React 19, Tailwind 4, shadcn/ui, Zustand, Jotai, TradingView Lightweight Charts, Recharts.
- Backend: Flask 3.1 + Gunicorn + Gevent, Python 3.11+, LangGraph (LangChain), OpenAI‑compatible SDK.
- Data adapters: 21 adapters covering A‑shares, US SEC, Hong‑Kong, macro (FRED/NBS/World Bank/IMF), crypto, alternative data (shipping, satellite, corporate registry, jobs, ESG).
- Search: 17 engines (Baidu, Google, Bing, Zhihu, Weibo, etc.) plus WolframAlpha/Wikipedia.
- Cache: Redis 7 (optional) + in‑memory fallback.
- Containerisation: Docker, Docker‑Compose, Nginx 1.25+.
Getting started (quick‑start)
- Clone & configure
git clone https://github.com/lc2panda/alphastream.git cd alphastream cp .env-example .env # fill in at least OPENAI_API_KEY & URL - Run everything
docker compose up -d # starts redis, backend, frontend, nginx - Open
http://localhost:3000in a browser.- Frontend runs on port 3000, backend API on 8888, Nginx proxies both on port 80.
- SSE streams appear in the chat panel as the agents think, call tools, and produce a final analysis.
Alternative – start backend (python3 run.py) and frontend (npm run dev) separately for development, or use the provided docker-compose.frontend.yml / docker-compose.prod.yml for more granular setups.
Typical use cases
- Interactive stock research – Ask the AI “What’s the outlook for TSLA next quarter?” and watch the technical, fundamental and sentiment agents fetch data, run calculations and stream a structured answer.
- Portfolio monitoring – The dashboard shows real‑time indices, personal watch‑list prices and risk‑radar cards.
- Strategy back‑testing aid – Use the “strategy evolver” agent to iterate on a trading idea, with the system automatically pulling relevant data and scoring the approach.
- News‑driven alerts – The news aggregator and sentiment agent can be queried for the latest market‑moving headlines.
License & contribution
The repository includes a full contribution guide, CI pipelines (lint, unit, integration, adapter health checks) and a test suite (≈ 800 backend tests, 40+ frontend tests). Contributions are welcomed via fork‑and‑pull‑request workflow.
Disclaimer – The platform is for exploration only; outputs are not investment advice and may contain errors.
Related
- Project
- Project
- Project
- Project
- Project