# alphastream: a multi-agent stock analysis platform that streams its reasoning

> alphastream is a full stack AI financial analysis platform built on Next.js, Flask and LangGraph, with fourteen specialised agents, twenty-one market data adapters and a Server-Sent Events channel that shows the tool calls and intermediate reasoning as they happen. It is a large and unusually complete demonstration, but it is built for one market and its dependencies are pinned hard.

**lc2panda/alphastream** — alphastream 是一个由 AI 驱动的投资决策平台，通过多 Agent 协同编排系统，实时流式输出覆盖全球金融市场的深度洞察。基于 LangGraph 和 Python 构建，它无缝整合技术指标、基本面数据、资金流向分析和情绪智能，形成动态自适应的工作流。不同于传统的回测工具，alphastream 通过 SSE 将完整的决策过程——从数据获取、工具调用到最终推理——全程可视化，为投资者提供透明的可执行智能。

- Repository: https://github.com/lc2panda/alphastream
- Stars: 893 · Forks: 202
- Language: Python
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/lc2panda-alphastream

## The problem: an analyst you can watch think

Most AI finance tools hand you a conclusion. A number, a rating, a paragraph, with the working hidden behind the interface. That is convenient and it is hard to trust, because you cannot see which data the answer came from, which tool was called, or where the reasoning went wrong.

alphastream takes the opposite position. The project description calls it an AI-driven investment decision platform that orchestrates multiple agents and streams deep insight over global financial markets in real time. The key difference from a traditional backtesting tool is that the entire decision process is visible over Server-Sent Events, from data fetching through tool calls to the final reasoning, so the user gets transparent, actionable output rather than a black box.

The stack is a full stack TypeScript and Python application. The frontend is Next.js 16.2.9 with React 19, Tailwind CSS 4, shadcn/ui and TradingView Lightweight Charts with Recharts. The backend is Flask 3.1 on Python 3.11 with Gunicorn and Gevent, and the AI orchestration is LangGraph with LangChain. The model layer is described as DeepSeek V4 driven, with support for any provider that is OpenAI SDK compatible.

The audience is worth being precise about. This is a demonstration of a large, well assembled system, and the repository is a single full stack application with an eval_results/ directory, a CLI directory, an examples directory and a Docker Compose setup. For a developer who wants to see how multi-agent orchestration, streaming UX and market data adapters fit together, it is a substantial reference. For someone who wants a signal to trade, it is a research artefact with a very large surface area.

The licence is MIT, the last push was on 2026-08-07, and the project has no GitHub releases, so the version badge in the documentation, 3.1.0, is the number to quote.

## Four layers, four ports, and why Nginx sits in the middle

The architecture diagram in the documentation is drawn as boxes and ports, and the arrangement is conventional but worth understanding because it explains the deployment.

The frontend layer listens on port 3000 and holds the page routing through the App Router, the component library with ten kinds of artifact cards, and state management across six stores. The reverse proxy layer on port 80 is Nginx 1.25 or later, handling static asset caching, GZIP compression, load balancing and SSL and TLS. The backend layer on port 8888 runs Flask with Gunicorn and Gevent, and inside it sits the LangGraph agent system, the tool layer with more than seventy tools for data queries, search engines, news fetching and computation, and the data adapter layer with twenty-one adapters. Below that sits a cache layer on port 6379 running Redis 7 or later, which the diagram marks as optional with in-memory fallback, for agent state caching, API response caching and session management.

The agent system itself is drawn as fourteen boxes. The documentation names the specialisations: technical analysis, fundamental analysis, capital flow, sentiment, a long and short debate, risk, decision making, reflection, strategy evolution, plus four investor personality agents standing for Buffett, Munger, Lynch and Damodaran.

The LangGraph orchestration is described as dynamic, with parallel, serial and conditional routing, and with Function Calling used for autonomous decisions. That is the interesting engineering claim: the graph decides at run time which agents to run and in what order, rather than following a fixed pipeline.

For a reader evaluating the project, the port map is also the operational map. Frontend on 3000, backend on 8888, cache on 6379 and the proxy on 80 is a layout that will collide with anything else already running on the same host, and the compose file is where those bindings are fixed.

## The data layer: twenty-one adapters and a primary plus backup pair

The adapter layer is where the ambition meets reality, and the documentation is unusually specific about it.

There are twenty-one adapters organised with sixteen business domain registries, covering Chinese equities, US stocks, macro data, crypto and alternative data. The stack table names the sources as AKShare, BaoStock and Wind as a three-source arrangement, and the feature list describes a dual source redundancy with AKShare and BaoStock acting as primary and backup so that data availability is protected when one upstream source fails.

That is the right instinct. Market data libraries break, upstream sites change their HTML, and Chinese providers in particular are prone to intermittent failures that produce KeyError or JSON decode errors rather than a clean error. The requirements file records exactly that history, with a pinned akshare version and a comment naming the specific fixes for a Xueqiu symbol endpoint and an East Money JSON decode error.

The domain coverage in the diagram names US SEC filings for US equities, yfinance for Hong Kong, FRED and NBS for macro, OpenBB for crypto, RSS for news, and five categories of alternative data.

The analysis layers built on top of this are conventional and well specified: technical indicators covering candlesticks, moving averages, exponential averages, MACD, RSI, Bollinger bands and volume analysis; fundamental analysis covering the three financial statements, valuation ratios such as PE, PB and ROE, and peer comparison; and capital flow covering per stock and per sector flows, northbound flows and institutional positioning.

The search and news side is broader still, with seventeen search engines aggregated and six RSS sources plus a crawler for community and newswire sites, and an AI sentiment pass over the results.

## The API surface and the streaming endpoints

The HTTP surface is grouped by function, and the grouping tells you what the product is for.

The market data endpoints cover indices, candlestick data across multiple periods, stock profiles with valuation and market capitalisation, batch quotes and sector constituents. The analysis endpoints cover fundamental analysis, capital flow, scenario prediction and risk analysis, and each of those is a POST, which tells you they take a body of parameters rather than a URL.

The agent endpoints are the interesting ones. The chat endpoint and the agent analysis endpoint both stream over SSE, there is a status endpoint for querying the state of an analysis, and there is a cancel endpoint for stopping one. That last pair is the detail that matters for a real deployment: a long running analysis that cannot be cancelled is a resource leak, and the presence of an explicit cancel route suggests the author thought about it.

There is a health endpoint, a deep health check, a metrics endpoint and a data source status endpoint, which is the set you want for operating the thing rather than using it.

The documentation also states that the full API documentation is in docs/API.md, and the repository has a docs/ directory with screenshots and an API document, plus an eval_results/ directory that suggests the project keeps evaluation output around.

Two structural notes. The backend serves the agent stream and the frontend consumes it, and the deployment uses Docker Compose with an Nginx reverse proxy in front, so the SSE stream has to survive a proxy hop. The compose configuration passes a heartbeat timeout for the SSE stream to the frontend, which suggests that was a problem worth solving rather than a detail.

## Running it: a Python 3.11 image, a Compose stack and a long list of switches

The backend is a single Python image, and the Dockerfile is short enough to read in full. The base is the Python 3.11 slim image, the working directory is /app, and the data and log directories are created in the image, including subdirectories for news, agent memory, agent reflections, agent strategies and agent sessions. The application is installed with the requirements file and served by Gunicorn:

```dockerfile
FROM python:3.11-slim
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8888
CMD ["gunicorn", "--bind", "0.0.0.0:8888", "--workers", "4", "app.web.web_server:app"]
```

The compose file is where the behaviour is configured, and the variables are the interesting part. The agent system is switched on with USE_AGENT_SYSTEM, the maximum number of question and answer rounds is MAX_QA, the database URL points at a SQLite file with USE_DATABASE toggling it, and the cache is REDIS_URL with USE_REDIS_CACHE controlling whether it is used at all, with the service depending on Redis being healthy. Authentication is off by default with AUTH_REQUIRED, rate limiting is on by default with RATE_LIMIT_ENABLED, and MOCK_LLM exists to run without a live model. Logs go to a file with LOG_LEVEL controlling verbosity, and the data and logs directories are mounted as volumes so state survives a container restart.

Two things to note for anyone deploying it. The authentication default is false, which means an exposed instance is an open instance, and the health check in the compose file hits the health endpoint on port 8888 through curl, while the Dockerfile itself uses a Python standard library check instead, with a comment explaining that this avoids depending on curl being present in the image. Both are sensible, and the second is the kind of detail that only appears when a build has broken on it.

The frontend has its own compose file and production Dockerfile, and the API URL is passed to it as a build argument, which means a change to the backend address is a frontend rebuild rather than a configuration change.

## Licence, governance and the honest limits of the demonstration

The licence is MIT, and the repository carries a standard set of community files. The interesting one is a contract stated at the top of the documentation: any feature or architecture change in this project must be reflected in the related documentation when it is done, and the project calls that part of its contract. That is a small sentence with a large meaning for a codebase this size, because most of what makes a project like this usable is the documentation rather than the code.

The engineering hygiene is visible too. There is a CI workflow, a weekly adapter smoke test workflow that exists precisely because the data adapters break, a coverage configuration, a pre-commit setup and a gitmodules file. The weekly smoke test is the one to watch, since it is the mechanism that would tell you a Chinese market data source has changed shape underneath the project.

The honest limits are these. The coverage of markets is heavily weighted to Chinese and US equities, so a reader trading elsewhere would find the adapter layer thin. The dependency set is large and heavily pinned, with exact versions for Flask, loguru, matplotlib, seaborn, sqlalchemy, scikit-learn and statsmodels among others, and the requirements file records a series of upgrades and security fixes, which means a functioning environment is a moving target that needs attention. The model layer depends on an external provider even when the orchestration is local, and the MOCK_LLM switch exists precisely because that dependency is not optional.

None of that is a reason to dismiss the project. It is a reason to read it as what it is: a well documented, thoroughly instrumented demonstration of how to build a streaming multi-agent financial analysis product, with a production-shaped deployment rather than a notebook. The documentation contract and the weekly adapter smoke test are the two features worth borrowing whatever you do with it.

## Conclusion

Adopt alphastream if you are studying how a multi-agent financial analysis system is put together, or if you want a working reference for streaming agent reasoning over market data and can accept a stack pinned to Python 3.11 and Chinese market data sources. Do not adopt it as a decision system for real money, since the documentation does not describe any validation, backtesting discipline or risk controls for its conclusions. Before you run it, read the environment variables in docker-compose.yml, because authentication is off by default and the model provider is a separate key, and check the market coverage of the adapters against the exchanges you actually trade.

## FAQ

### What is alphastream and what does it do?

It is an AI-driven investment analysis platform that orchestrates multiple agents and streams its reasoning in real time over Server-Sent Events, so the user can see data fetching, tool calls and the final inference rather than only the conclusion. It covers Chinese and US equities, Hong Kong stocks, ETFs, indices and sectors.

### How many agents does the alphastream system use?

Fourteen specialised agents, covering technical analysis, fundamental analysis, capital flow, sentiment, a long and short debate, risk, decision making, reflection and strategy evolution, plus four investor personality agents modelled on Buffett, Munger, Lynch and Damodaran. LangGraph orchestrates them with parallel, serial and conditional routing.

### How do I run alphastream?

The project ships Docker Compose files for the backend, the frontend and production, plus a Dockerfile that builds a Python 3.11 image and serves the Flask app with Gunicorn on port 8888. The compose file configures the agent system, the database, the optional Redis cache, authentication, rate limiting and the mock model switch through environment variables.

### Where does alphastream get its market data?

From a data adapter layer of twenty-one adapters organised across sixteen business domain registries, with AKShare and BaoStock providing primary and backup coverage for Chinese markets alongside Wind, SEC filings for US equities, yfinance for Hong Kong, FRED and NBS for macro data, OpenBB for crypto and RSS sources for news.

### What licence is alphastream released under?

MIT, with the LICENSE file at the root of the repository. The project has no GitHub releases, so the version shown in the documentation badge, 3.1.0, is the number to quote, and the last push was on 2026-08-07.

## Sources

- [Issues](https://github.com/lc2panda/alphastream/issues)
- [lc2panda/alphastream on GitHub](https://github.com/lc2panda/alphastream)
- [License: MIT](https://github.com/lc2panda/alphastream/blob/main/LICENSE)
- [README](https://github.com/lc2panda/alphastream/blob/main/README.md)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lc2panda-alphastream
