# rahulnaik99/indian_tradingagents architecture

> Architecture diagram of the GitHub repository rahulnaik99/indian_tradingagents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rahulnaik99/indian_tradingagents
- Repository: https://github.com/rahulnaik99/indian_tradingagents

## Overview

TradingAgents India is a local-first research workbench for Indian equities. Users initiate research through the dashboard, REST API, or CLI; the central workflow assembles point-in-time evidence, runs analyst and bull/bear debate stages, then produces a trader proposal, risk review, and portfolio verdict for reports or paper trading. A separate deterministic research pipeline runs Fundamental → Technical → Trader → Risk → Hedge-Fund Manager and fails closed to review. The README documents these workflows and capabilities; unsampled subsystems are represented at their existing directory paths, and edges are limited to documented relationships.

Main entry points: [`tradingagents/web/app.py`](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/web/app.py) (Dashboard and API), [`tradingagents/india/evidence_package.py`](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/evidence_package.py) (Point-in-time evidence), [`tradingagents/graph/trading_graph.py`](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/graph/trading_graph.py) (Full analysis graph), [`cli/main.py`](https://github.com/rahulnaik99/indian_tradingagents/blob/main/cli/main.py) (Interactive CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_web["Dashboard and API<br/>[app.py]"]
  node_cli["Interactive CLI<br/>[main.py]"]
end

subgraph group_evidence["Evidence and analysis"]
  node_evidence_package["Point-in-time evidence"]
  node_market_data["Market data vendors"]
  node_india_data["India data providers"]
  node_technical["Deterministic technicals<br/>[technical.py]"]
end

subgraph group_decisions["Decision workflows"]
  node_full_graph["Full analysis graph<br/>[trading_graph.py]"]
  node_analysts["Research analysts"]
  node_debate["Bull-bear research"]
  node_research_manager["Research manager"]
  node_trader_risk["Trader and risk debate"]
  node_portfolio_manager["Portfolio verdict"]
  node_lean_pipeline["Research pipeline<br/>[graph.py]"]
  node_pipeline_agents["Pipeline agents"]
end

subgraph group_results["Results and state"]
  node_storage[("Local SQLite<br/>[storage.py]")]
  node_paper_trading["Paper trading<br/>[paper_trading.py]"]
  node_reports["Reports and audit<br/>[reporting.py]"]
  node_memory[("Research memory")]
end

subgraph group_platform["Runtime services"]
  node_llm["Model providers"]
  node_backtest["Backtesting<br/>[backtest.py]"]
  node_universe["Universe and scanner<br/>[universe.py]"]
  node_calendar_events["Calendar and events<br/>[events.py]"]
end

node_user(("Research user"))

node_user -->|"starts research"| node_web
node_user -->|"runs analysis"| node_cli
node_web -->|"requests evidence"| node_evidence_package
node_web -->|"requests technicals"| node_technical
node_web -->|"starts research"| node_lean_pipeline
node_web -->|"scans universe"| node_universe
node_evidence_package -->|"assembles sources"| node_market_data
node_evidence_package -->|"assembles sources"| node_india_data
node_evidence_package -->|"feeds evidence"| node_full_graph
node_full_graph -->|"runs analysts"| node_analysts
node_analysts -->|"inform debate"| node_debate
node_debate -->|"feeds debate"| node_research_manager
node_research_manager -->|"forms proposal"| node_trader_risk
node_trader_risk -->|"feeds risk review"| node_portfolio_manager
node_portfolio_manager -->|"produces verdict"| node_reports
node_portfolio_manager -->|"supports paper orders"| node_paper_trading
node_web -->|"persists research data"| node_storage
node_paper_trading -->|"stores orders"| node_storage
node_lean_pipeline -->|"runs stages"| node_pipeline_agents
node_lean_pipeline -->|"stores results"| node_storage
node_full_graph -->|"uses models"| node_llm
node_cli -->|"runs analysis"| node_full_graph
node_cli -->|"runs sweeps"| node_backtest
node_web -->|"serves events"| node_calendar_events

click node_web "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/web/app.py"
click node_cli "https://github.com/rahulnaik99/indian_tradingagents/blob/main/cli/main.py"
click node_evidence_package "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/evidence_package.py"
click node_market_data "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/dataflows/vendors"
click node_india_data "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/india/providers"
click node_technical "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/technical.py"
click node_full_graph "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/graph/trading_graph.py"
click node_analysts "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents/analysts"
click node_debate "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents/researchers"
click node_research_manager "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/agents/managers/research_manager.py"
click node_trader_risk "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents"
click node_portfolio_manager "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/agents/managers/portfolio_manager.py"
click node_lean_pipeline "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/langgraph_pipeline/graph.py"
click node_pipeline_agents "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/india/langgraph_pipeline/agents"
click node_storage "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/storage.py"
click node_paper_trading "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/paper_trading.py"
click node_reports "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/reporting.py"
click node_memory "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/memory"
click node_llm "https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/llm_clients"
click node_backtest "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/backtest.py"
click node_universe "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/universe.py"
click node_calendar_events "https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/events.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_cli,node_user toneBlue
class node_evidence_package,node_market_data,node_india_data,node_technical toneAmber
class node_full_graph,node_analysts,node_debate,node_research_manager,node_trader_risk,node_portfolio_manager,node_lean_pipeline,node_pipeline_agents toneMint
class node_storage,node_paper_trading,node_reports,node_memory toneRose
class node_llm,node_backtest,node_universe,node_calendar_events toneIndigo
```

## Components

### User entry

- [Dashboard and API](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/web/app.py): `tradingagents/web/app.py`
- [Interactive CLI](https://github.com/rahulnaik99/indian_tradingagents/blob/main/cli/main.py): `cli/main.py`

### Evidence and analysis

- [Point-in-time evidence](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/evidence_package.py): `tradingagents/india/evidence_package.py`
- [Market data vendors](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/dataflows/vendors): `tradingagents/dataflows/vendors`
- [India data providers](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/india/providers): `tradingagents/india/providers`
- [Deterministic technicals](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/technical.py): `tradingagents/india/technical.py`

### Decision workflows

- [Full analysis graph](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/graph/trading_graph.py): `tradingagents/graph/trading_graph.py`
- [Research analysts](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents/analysts): `tradingagents/agents/analysts`
- [Bull-bear research](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents/researchers): `tradingagents/agents/researchers`
- [Research manager](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/agents/managers/research_manager.py): `tradingagents/agents/managers/research_manager.py`
- [Trader and risk debate](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/agents): `tradingagents/agents`
- [Portfolio verdict](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/agents/managers/portfolio_manager.py): `tradingagents/agents/managers/portfolio_manager.py`
- [Research pipeline](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/langgraph_pipeline/graph.py): `tradingagents/india/langgraph_pipeline/graph.py`
- [Pipeline agents](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/india/langgraph_pipeline/agents): `tradingagents/india/langgraph_pipeline/agents`

### Results and state

- [Local SQLite](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/storage.py): `tradingagents/india/storage.py`
- [Paper trading](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/paper_trading.py): `tradingagents/india/paper_trading.py`
- [Reports and audit](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/reporting.py): `tradingagents/reporting.py`
- [Research memory](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/memory): `tradingagents/memory`

### Runtime services

- [Model providers](https://github.com/rahulnaik99/indian_tradingagents/tree/main/tradingagents/llm_clients): `tradingagents/llm_clients`
- [Backtesting](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/backtest.py): `tradingagents/backtest.py`
- [Universe and scanner](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/universe.py): `tradingagents/india/universe.py`
- [Calendar and events](https://github.com/rahulnaik99/indian_tradingagents/blob/main/tradingagents/india/events.py): `tradingagents/india/events.py`

### Other components

- **Research user**

## Connections

- Research user → Dashboard and API: starts research
- Research user → Interactive CLI: runs analysis
- Dashboard and API → Point-in-time evidence: requests evidence (evidence: `tradingagents/web/app.py`)
- Dashboard and API → Deterministic technicals: requests technicals (evidence: `tradingagents/web/app.py`)
- Dashboard and API → Research pipeline: starts research
- Dashboard and API → Universe and scanner: scans universe (evidence: `tradingagents/web/app.py`)
- Point-in-time evidence → Market data vendors: assembles sources
- Point-in-time evidence → India data providers: assembles sources
- Point-in-time evidence → Full analysis graph: feeds evidence
- Full analysis graph → Research analysts: runs analysts
- Research analysts → Bull-bear research: inform debate
- Bull-bear research → Research manager: feeds debate
- Research manager → Trader and risk debate: forms proposal (evidence: `tradingagents/agents/managers/research_manager.py`)
- Trader and risk debate → Portfolio verdict: feeds risk review (evidence: `tradingagents/agents/managers/portfolio_manager.py`)
- Portfolio verdict → Reports and audit: produces verdict
- Portfolio verdict → Paper trading: supports paper orders
- Dashboard and API → Local SQLite: persists research data (evidence: `tradingagents/web/app.py`)
- Paper trading → Local SQLite: stores orders
- Research pipeline → Pipeline agents: runs stages
- Research pipeline → Local SQLite: stores results
- Full analysis graph → Model providers: uses models (evidence: `tradingagents/graph/trading_graph.py`)
- Interactive CLI → Full analysis graph: runs analysis (evidence: `cli/main.py`)
- Interactive CLI → Backtesting: runs sweeps (evidence: `cli/main.py`)
- Dashboard and API → Calendar and events: serves events (evidence: `tradingagents/web/app.py`)
