Inspiration

Individual professional traders in the Chinese market often face severe information overload: scattered market data, fragmented fundamental research, noisy news sentiment, and lack of a structured decision-making framework. Generic AI stock analysis tools commonly suffer from opaque reasoning, untraceable data sources, and missing risk governance, making them unreliable as decision aids.

This project evolved from an open-source multi-agent trading research framework, with the core goal of building a Chinese-localized, evidence-driven multi-agent stock analysis platform for personal traders. It focuses on verifiable data sources, layered decision logic, structured risk review, and auditable analysis reports — serving as a research assistant and second opinion for stock research and strategy experimentation, rather than a black-box trading signal generator.

What it does

TradingAgents-CN is a full-stack web platform that delivers multi-agent stock analysis for A-share, Hong Kong, and US markets:

  • Layered multi-agent decision pipeline: Market / fundamentals / news analysts collect evidence, followed by bull-bear debate, research synthesis, trader proposal, three-view risk discussion, and final ruling by a Portfolio Manager agent.
  • Multi-source data fusion: Integrates Tushare, AKShare, BaoStock, yfinance, Alpha Vantage and Finnhub, with priority fallback and data quality metadata.
  • Complete web product workflow: Single/batch stock analysis, task center, report management, stock details, watchlist, screening, paper trading and system configuration, all accessible via a Chinese-language SPA interface.
  • Reliability guardrails: Preflight data availability checks before analysis, immutable input snapshots, report evidence guards that remove untraceable claims, task lineage for retries, and structured decision audit trails.
  • Scheduled data synchronization: Automated ingestion of basic stock info, quotes, historical K-lines, financial data and watchlist news via APScheduler.

How we built it

The project adopts a three-layer architecture built on top of the upstream TradingAgents research framework:

  1. Core agent layer (tradingagents/): Built with LangGraph StateGraph + LangChain tool calling, implementing the full multi-agent research, debate and decision workflow with configurable analysis depth.
  2. Backend service layer (app/): Python 3.10 + FastAPI + Uvicorn, with MongoDB as the primary persistent database and Redis for progress tracking, caching and legacy task queues. It provides REST/SSE/WebSocket APIs, securities resolution, data preflight, task orchestration, scheduled sync, configuration management and audit services.
  3. Frontend product layer (frontend/): Vue 3 + TypeScript + Vite 5 + Element Plus, with Pinia for state management and ECharts for visualization. It delivers 10+ functional pages covering analysis, tasks, reports, stocks, watchlist, paper trading and system settings.

Key engineering practices:

  • Canonical security identity normalization across API, UI and provider boundaries
  • Standardized market data units with honest labeling for legacy data of unknown origin
  • Separate dev and local-trial runtime environments with controlled code sync
  • Progressive frontend design system governance

Challenges we ran into

  1. Multi-source data consistency: Different data providers have inconsistent units, date formats, rebase rules and field coverage for A-share/HK/US markets. Building a unified priority + fallback mechanism while preserving provenance metadata required extensive adapter development and boundary normalization.
  2. Agent hallucination and evidence traceability: Large language models tend to generate unsupported claims in financial analysis. We implemented input snapshots and report evidence guards to remove assertions that cannot be bound to source data, at the cost of additional processing complexity and report completeness tradeoffs.
  3. Market-specific adaptation: A-share, Hong Kong and US markets differ in trading calendars, financial reporting standards, ticker formats and data availability. Extending the reliability governance built for A-shares to overseas markets requires incremental verification of each data dimension.
  4. Long-running task reliability: Analysis tasks can take tens of seconds to minutes. Ensuring status persistence, progress tracking, cancelability and retry lineage across background execution, memory state and database records required careful failure handling and zombie task cleanup logic.

What we learned

  • For financial AI systems, data governance and reliability matter far more than the number of agents or model parameters. A single untrustworthy data point can invalidate an entire analysis report.
  • Layered debate-and-ruling agent architecture produces more balanced, explainable conclusions than single-prompt generation for complex research scenarios.
  • Progressive architecture evolution — adding guardrails, standardization and orchestration incrementally on top of a working core — is far more practical for small-team/individual projects than big-bang rewrites.
  • Chinese market securities data has many non-standard conventions. Building a canonical identity layer at the earliest stage prevents massive technical debt later.
  • "Task completed" never equals "report trustworthy". Every level of the pipeline needs explicit quality gates, not just the final output.

Built With

Share this project:

Updates