How meth04/tradingagent-vn works
TradingAgent-VN simulates an AI investment workspace for Vietnamese equities. Its central workflow collects market and news data, runs specialist analysis, synthesizes investment decisions, applies risk and governance, and presents research or backtest results. Separate capabilities include financial-report RAG, persistent memory and reporting, and several portfolio/backtest strategies. The README documents the product-level stages; source excerpts and the index support selected implementation links. Other runtime paths are included as documented subsystems without inferring unshown calls.
Main entry points: base.py Specialist agents · engine.py Backtest engine · financial_agent.py Financial analyst · debate_engine.py Decision debate
Components 25
Data collection
- Market crawler
vnstock/jobs/crawler.py - News ingestion
tracking_news/app/ingest/pipeline.py - News sources
tracking_news/app/sources - Market database
vnstock/database/repo.py - News database
tracking_news/app/db/articles_repo.py
Investment analysis
- Specialist agents
vnstock/workflows/base.py - Financial analyst
vnstock/agents/financial_agent.py - Financial RAG
vnstock/libs/rag_engine - LLM client
vnstock/core/llm.py - CIO synthesis
vnstock/agents/strategist.py - Decision schemas
vnstock/agents/prompting.py
Cognitive trading
- Planner and context
cognitive_trading/planner/context_packer.py - Analyst swarm
cognitive_trading/swarm/base_analyst.py - Decision debate
cognitive_trading/decision/debate_engine.py - Governance
cognitive_trading/governance/schemas.py - Risk engine
vnstock/engine/risk_engine.py - Trading memory
cognitive_trading/memory - Daily reporting
cognitive_trading/reporting/daily_reporter.py
Workflows and backtesting
- Backtest engine
vnstock/tools/backtest/engine.py - Portfolio strategies
vnstock/workflows
User interfaces
- Realtime API
app/backend/main.py - Realtime app
app/frontend/src/app/page.tsx - Research dashboard
dashboard/src/app - News dashboard
tracking_news/apps/dashboard_streamlit.py
Other components
- Investor
Connections 24
- Investor → Realtime app: uses
README.md - Realtime app → Realtime API: requests analysis
- Realtime API → Specialist agents: invokes analysis
- Market crawler → Market database: stores prices
README.md - News sources → News ingestion: provides articles
tracking_news/app/ingest/pipeline.py - News ingestion → News database: stores articles
tracking_news/app/ingest/pipeline.py - Specialist agents → Financial analyst: runs financial analysis
vnstock/workflows/base.py - Specialist agents → LLM client: requests completion
vnstock/workflows/base.py - Financial analyst → Financial RAG: queries reports
- Financial analyst → LLM client: requests completion
vnstock/agents/financial_agent.py - CIO synthesis → Decision schemas: uses actions
- Planner and context → Analyst swarm: prepares context
- Analyst swarm → Decision debate: feeds debate
README.md - Decision debate → LLM client: requests completion
cognitive_trading/decision/debate_engine.py - Decision debate → Governance: validates decisions
cognitive_trading/decision/debate_engine.py - Governance → Risk engine: constrains decisions
README.md - Planner and context → Trading memory: uses context
cognitive_trading/planner/context_packer.py - Trading memory → Daily reporting: supports reflection
README.md - Specialist agents → Backtest engine: evaluated by
README.md - Backtest engine → Portfolio strategies: runs workflows
vnstock/tools/backtest/engine.py - Backtest engine → Market database: loads market data
vnstock/tools/backtest/engine.py - Investor → Research dashboard: reviews results
README.md - Research dashboard → Backtest engine: presents backtests
README.md - Investor → News dashboard: reviews news
README.md