hsliuping/TradingAgents-CN

基于多智能体LLM的中文金融交易框架 - TradingAgents中文增强版

TradingAgents‑CN Community Edition – What It Is

TradingAgents‑CN is an open‑source‑plus‑proprietary platform that lets you explore Chinese A‑share stocks using multiple AI agents (LLMs) that act like analysts, researchers, and assistants. The system is built on a FastAPI back‑end (Python 3.11) and a Vue 3 front‑end, with MongoDB and Redis for persistence.

Core idea

  • A set of specialized agents (e.g., macro analyst, sector analyst, fundamentals analyst, news analyst, optimistic/reasonable researcher) debate a stock or market theme in a multi‑turn dialogue.
  • The debate output is presented as layered viewpoints, helping a user see different angles of a research question.
  • Users can also ask natural‑language queries to run ad‑hoc research, screen stocks, or get a “stock‑picking assistant” that matches a description to candidate tickers.
  • The platform includes a paper‑trading sandbox and a small learning hub with free courses and guides.

Main features (as described in the README)

Feature What you get
Single‑stock research 5‑level deep, multi‑agent debate with several perspectives.
General research Ask any market‑wide question in plain language; agents coordinate to answer.
Stock screening Natural‑language + filter conditions over 6 000+ A‑share symbols.
Pick‑stock assistant Describe a desired investment thesis; the system suggests matching tickers.
Intelligent assistant Integrated web‑search, tool calling, and a persistent “AI memory” for facts across sessions.
AI memory Project‑level knowledge base that stores facts and previous analysis.
Skill centre Create custom data‑fetching “skills” (e.g., new data‑source adapters).
Learning centre Free structured courses (5 lessons in the current release) and 8 learning guides.
Paper‑trading & replay Simulated trades with post‑trade review.

Architecture & tech stack

  • Back‑end: FastAPI (app/main.py) exposing REST endpoints, running on Python 3.11.
  • Front‑end: Vue 3 + TypeScript UI (frontend/).
  • Persistence: MongoDB (stores user data, research results, agent configs) and Redis (caching, session state).
  • LLM integration: Supports OpenAI, DeepSeek, Alibaba‑Tongyi, etc.; the API key is set in the .env file.
  • Data sources: Public Chinese market APIs – Tushare, AKShare, BaoStock – for price/financial data (users must obtain their own tokens).

Licensing

  • Hybrid model: The core engine (tradingagents/, CLI, docs, tests) is Apache‑2.0 and fully reusable. The application layer (app/, frontend/, core/) is source‑available but non‑commercial; commercial use requires a separate licence.

Who it’s for

  • Students & hobbyists who want hands‑on experience building multi‑agent AI workflows for finance.
  • Researchers exploring how LLM‑driven agents can collaborate on quantitative/qualitative stock analysis.
  • Developers interested in extending the agent framework, adding new data adapters, or building custom agents.

Getting started (quick recap)

  1. Install MongoDB & Redis (or run the provided Docker commands).
  2. Clone the repo, set up a Python virtual environment, install requirements.txt.
  3. Copy .env.example → .env and fill in DB credentials, JWT secret, and an LLM API key.
  4. Run uvicorn app.main:app (backend) and npm run dev inside frontend (UI).
  5. Log in with the auto‑created admin (admin / password from .env).
  6. Configure your LLM key in the system settings, then start exploring the research tools.

Community & contribution

The project is actively looking for contributors (data‑source adapters, Vue UI work, prompt‑engineering, docs). Contributions are evaluated solely on PR quality; a contributor agreement (CLA) is required.


Bottom line: TradingAgents‑CN is a genuine, multi‑agent AI research assistant focused on Chinese equities, offering a concrete example of how LLMs can be orchestrated for financial analysis while providing a learning platform and a modest paper‑trading sandbox.

Related

  • Project
  • Project
  • Project
  • Project
  • Project