English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

TradingAgents-CN: A Deep Migration Plan from LangGraph to Agno

Forum topic · QianXun · 2025-11-24

Summary

This post presents a detailed engineering plan for migrating TradingAgents-CN, a multi-agent financial trading decision framework built on LangGraph 0.4.8, LangChain, and FastAPI, to the Agno agent framework. The current system orchestrates 11 core agents (four analysts, two researchers, one trader, four risk managers) across A-share, Hong Kong, and US market data, with multi-provider LLM support including OpenAI, Anthropic, DeepSeek, and DashScope. Motivations include Agno's claimed 10,000x faster agent instantiation and ~50x lower memory footprint, decentralized execution, and native multimodal support. The author recommends a phased, incremental migration over roughly 12-18 weeks across six stages: base infrastructure, core agent migration, workflow orchestration, advanced features (memory, risk management), integration and testing, and production rollout. The plan includes proposed Agno-style architecture code for workflows, state management, tool systems, and an LLM adapter layer, plus acceptance criteria (functional parity, API compatibility, >=90% unit test coverage, 30-second per-stock analysis, 80%+ memory reduction), a risk matrix covering framework maturity and API incompatibility, contingency plans, a 12-14 person team plan, and an estimated total budget of $640,000 with a ~17-month ROI horizon.

TradingAgents-CN: A Deep Migration Plan from LangGraph to Agno

This is a structured English summary of a long Chinese technical planning document.

1. Background

TradingAgents-CN is a multi-agent financial trading decision framework:

  • Stack: LangGraph 0.4.8 + LangChain + FastAPI (+ MongoDB/motor, Redis)
  • Agents: 11 core agents — 4 analysts (Market, SocialMedia, News, Fundamentals), 2 researchers (Bull, Bear), 1 Trader, 4 risk roles (Risky/Safe/Neutral debators, RiskManager)
  • Data: multi-source integration for China A-shares, HK stocks, US stocks (akshare, tushare, yfinance, finnhub, eodhd, baostock)
  • LLM providers: OpenAI, Anthropic, DeepSeek, Google, DashScope (Ali Bailian), etc., via a factory pattern
  • Deployment: full Web app + CLI + API service
  • Current graph workflow uses StateGraph with a shared AgentState (extending MessagesState) and typed sub-states like InvestDebateState (bull/bear history, judge decision).

    2. Migration Motivation

    1. Performance: Agno claims agent creation ~10,000x faster and ~1/50 the memory usage vs LangGraph 2. Architecture: decentralized execution engine, zero-copy data pipeline 3. Developer efficiency: declarative, modular agent definitions 4. Multimodal support and alignment with agent-framework trends

    Goals: 1000–10000x agent creation speedup, 90–95% memory reduction, full functional parity, backward-compatible APIs.

    3. LangGraph vs Agno (author's assessment)

    | Dimension | LangGraph | Agno | |---|---|---| | Agent creation speed | baseline | claimed 10,000x | | Memory usage | baseline | claimed 1/50 | | Learning curve | moderate | simpler | | Ecosystem | mature | emerging | | Feature completeness | complete | unverified |

    Notably, the author flags Agno's maturity, API compatibility, and documentation as high risks; the Agno architecture samples in the document are explicitly speculative.

    4. Recommended Strategy and Target Architecture

    Three strategies were compared: progressive migration (recommended), full rewrite, and dual-track running. The recommended target architecture includes:

  • TradingAgentsWorkflow(Workflow) with an AnalysisStage enum; analysts run in parallel, researchers sequentially, risk debators in parallel, trader last
  • Declarative TradingState, DebateState, RiskDebateState classes with optional report fields and debate stages
  • Decorator-based @Tool definitions for stock data, technical indicators, news, valuation
  • An AgnoLLMFactory producing provider-specific LLM instances from environment API keys
  • 5. Phased Plan (~12–18 weeks, 6 stages)

    1. Base infrastructure (2–3 wks): Agno setup, state system, LLM adapter layer, minimal agent template 2. Core agents (3–4 wks): migrate 4 analysts + 2 researchers, tool system, prompt templates 3. Workflow orchestration (2–3 wks): workflow engine, agent messaging, parallel/async coordination, state propagation and rollback 4. Advanced features (2–3 wks): memory system (FinancialSituationMemory + vector DB), risk management, agent pooling, monitoring 5. Integration & testing (2–3 wks): FastAPI/frontend/data compatibility, functional, performance, stress, and regression tests 6. Deployment (1–2 wks): blue-green rollout, monitoring, rollback plan, user docs

    Key milestones at weeks 3, 7, 10, 13, and 18.

    6. Acceptance Criteria

  • Functional parity: agent output quality >= 95% of original; all 7 workflow stages complete; all 6 data sources functional (quality score >= 0.8)
  • API compatibility: all existing endpoints (/api/analyze/{symbol}, /api/batch_analyze, etc.) return unchanged formats
  • Performance: 100-agent creation >= 100x faster; per-stock analysis <= 30s and >= 50% faster; memory increase <= 500MB and >= 80% lower than original; 10-way concurrency works
  • Quality: >= 90% unit, 85% integration, 80% E2E test coverage
  • 7. Risks and Mitigations

    High-priority risks: Agno framework immaturity, missing API compatibility, insufficient test coverage. Mitigations include PoC validation, adapter layers, keeping the LangGraph version in parallel, blue-green deployment, and rollback triggers (e.g., abort migration if core features are unachievable or performance is >50% below expectations).

    8. Resources and Budget

  • Team: 12–14 people (PM, architect, 2 Agno developers, 2 integration engineers, 2 QA, ops, product, QA governance, 1–2 backup)
  • Budget: ~$640,000 total ($510k labor, $75k technical, $55k other)
  • ROI: estimated $450k/year savings; payback in ~17 months
*Note: figures are the original author's estimates; Agno performance claims are vendor claims, and the Agno code samples are speculative reconstructions.*

Tags

#tradingagents-cn#langgraph#agno#multi-agent-systems#llm#financial-trading#framework-migration#python

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/176360545