# qusong0627/quantmind architecture

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

- Interactive diagram: https://gitdiagram.com/qusong0627/quantmind
- Repository: https://github.com/qusong0627/quantmind

## Overview

QuantMind is an AI-native quantitative research and trading platform spanning market data, factor discovery, model training and inference, backtesting, and simulated trading. The principal workflow begins in the desktop/web client, passes through backend services, and produces research signals, reports, or simulated orders. The README documents the end-to-end stages and product capabilities; source excerpts provide implementation evidence for selected simulation, backtesting, and storage components. Several README-described subsystems are represented at their supported directory paths because their internals were not sampled.

Main entry points: [`backend/services/simulation/engine.py`](https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/engine.py) (Simulation engine), [`backend/services/engine/data_platform`](https://github.com/qusong0627/quantmind/tree/master/backend/services/engine/data_platform) (Market data platform), [`backend/services/engine/qlib_app/services/backtest_service_query.py`](https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/qlib_app/services/backtest_service_query.py) (Qlib backtests), [`backend/services/engine/inference/inference_backtest_service.py`](https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/inference/inference_backtest_service.py) (Batch inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_client["Desktop and web client"]
  node_community["Community model hub<br/>[hub_proxy.py]"]
end

subgraph group_research["Research and intelligence"]
  node_news["News and sentiment"]
  node_marketanalysis["Market analysis"]
  node_researchscan["Research and screening<br/>[research.py]"]
  node_factor["Factor evolution"]
end

subgraph group_quant["Quant engines"]
  node_modeltraining["Model training"]
  node_inference["Batch inference"]
  node_backtestservice["Qlib backtests"]
  node_backtestmanager["Backtest engine manager<br/>[engine_manager.py]"]
  node_eventengine["Event-driven engine<br/>[engine.py]"]
end

subgraph group_trading["Trading and risk"]
  node_simulation["Simulation engine<br/>[engine.py]"]
  node_execution["Order execution"]
  node_ledger[("Orders and trade ledger<br/>[order.py]")]
  node_preflight["Trading preflight and risk<br/>[market_rules.py]"]
  node_broker["Broker bridge<br/>[routes.py]"]
end

subgraph group_platform["Platform services"]
  node_api["API services"]
  node_marketdata[("Market data platform")]
  node_strategy[("Strategy storage")]
  node_observability["Production monitoring<br/>[logging.py]"]
end

node_researcher(("Researcher / trader"))

node_researcher -->|"uses"| node_client
node_client -.->|"requests services"| node_api
node_api -.->|"serves data"| node_marketdata
node_marketdata -.->|"feeds screening"| node_researchscan
node_marketdata -.->|"provides market context"| node_news
node_researcher -->|"monitors news"| node_news
node_researcher -->|"reviews markets"| node_marketanalysis
node_researcher -->|"screens stocks"| node_researchscan
node_researcher -->|"proposes hypotheses"| node_factor
node_factor -->|"produces factors"| node_modeltraining
node_marketdata -->|"provides features"| node_modeltraining
node_modeltraining -->|"supplies models"| node_inference
node_inference -->|"provides scores"| node_backtestservice
node_researcher -->|"configures backtests"| node_backtestservice
node_backtestservice -.->|"runs backtest"| node_backtestmanager
node_backtestmanager -->|"dispatches run"| node_eventengine
node_researcher -->|"manages strategies"| node_strategy
node_strategy -->|"loads strategy"| node_simulation
node_inference -.->|"supplies signals"| node_simulation
node_researcher -->|"checks readiness"| node_preflight
node_simulation -->|"loads local bars"| node_marketdata
node_simulation -.->|"submits orders"| node_execution
node_execution -.->|"records fills"| node_ledger
node_simulation -.->|"applies market rules"| node_preflight
node_researcher -->|"shares models"| node_community
node_api -.->|"serves hub requests"| node_community
node_researcher -.->|"connects broker"| node_broker
node_backtestservice -.->|"logs activity"| node_observability

click node_client "https://github.com/qusong0627/quantmind/tree/master/electron"
click node_api "https://github.com/qusong0627/quantmind/tree/master/backend/services/api"
click node_marketdata "https://github.com/qusong0627/quantmind/tree/master/backend/services/engine/data_platform"
click node_news "https://github.com/qusong0627/quantmind/tree/master/backend/services/api/news"
click node_marketanalysis "https://github.com/qusong0627/quantmind/tree/master/backend/services/api/market_analysis"
click node_researchscan "https://github.com/qusong0627/quantmind/blob/master/backend/services/api/routers/research.py"
click node_factor "https://github.com/qusong0627/quantmind/tree/master/alphaagent/components/coder/CoSTEER"
click node_modeltraining "https://github.com/qusong0627/quantmind/tree/master/backend/services/engine"
click node_inference "https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/inference/inference_backtest_service.py"
click node_backtestservice "https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/qlib_app/services/backtest_service_query.py"
click node_backtestmanager "https://github.com/qusong0627/quantmind/blob/master/backend/shared/backtest_engine/integration/engine_manager.py"
click node_eventengine "https://github.com/qusong0627/quantmind/blob/master/backend/shared/backtest_engine/core/engine.py"
click node_strategy "https://github.com/qusong0627/quantmind/blob/master/backend/shared/strategy_storage.py"
click node_simulation "https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/engine.py"
click node_execution "https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/services/execution_engine.py"
click node_ledger "https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/models/order.py"
click node_preflight "https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/services/market_rules.py"
click node_broker "https://github.com/qusong0627/quantmind/blob/master/bridge/windows/src/api/routes.py"
click node_community "https://github.com/qusong0627/quantmind/blob/master/backend/services/api/routers/hub_proxy.py"
click node_observability "https://github.com/qusong0627/quantmind/blob/master/backend/shared/observability/logging.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_client,node_community toneBlue
class node_news,node_marketanalysis,node_researchscan,node_factor toneAmber
class node_modeltraining,node_inference,node_backtestservice,node_backtestmanager,node_eventengine toneMint
class node_simulation,node_execution,node_ledger,node_preflight,node_broker toneRose
class node_api,node_marketdata,node_strategy,node_observability,node_researcher toneIndigo
```

## Components

### User experience

- [Desktop and web client](https://github.com/qusong0627/quantmind/tree/master/electron): `electron`
- [Community model hub](https://github.com/qusong0627/quantmind/blob/master/backend/services/api/routers/hub_proxy.py): `backend/services/api/routers/hub_proxy.py`

### Research and intelligence

- [News and sentiment](https://github.com/qusong0627/quantmind/tree/master/backend/services/api/news): `backend/services/api/news`
- [Market analysis](https://github.com/qusong0627/quantmind/tree/master/backend/services/api/market_analysis): `backend/services/api/market_analysis`
- [Research and screening](https://github.com/qusong0627/quantmind/blob/master/backend/services/api/routers/research.py): `backend/services/api/routers/research.py`
- [Factor evolution](https://github.com/qusong0627/quantmind/tree/master/alphaagent/components/coder/CoSTEER): `alphaagent/components/coder/CoSTEER`

### Quant engines

- [Model training](https://github.com/qusong0627/quantmind/tree/master/backend/services/engine): `backend/services/engine`
- [Batch inference](https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/inference/inference_backtest_service.py): `backend/services/engine/inference/inference_backtest_service.py`
- [Qlib backtests](https://github.com/qusong0627/quantmind/blob/master/backend/services/engine/qlib_app/services/backtest_service_query.py): `backend/services/engine/qlib_app/services/backtest_service_query.py`
- [Backtest engine manager](https://github.com/qusong0627/quantmind/blob/master/backend/shared/backtest_engine/integration/engine_manager.py): `backend/shared/backtest_engine/integration/engine_manager.py`
- [Event-driven engine](https://github.com/qusong0627/quantmind/blob/master/backend/shared/backtest_engine/core/engine.py): `backend/shared/backtest_engine/core/engine.py`

### Trading and risk

- [Simulation engine](https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/engine.py): `backend/services/simulation/engine.py`
- [Order execution](https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/services/execution_engine.py): `backend/services/simulation/services/execution_engine.py`
- [Orders and trade ledger](https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/models/order.py): `backend/services/simulation/models/order.py`
- [Trading preflight and risk](https://github.com/qusong0627/quantmind/blob/master/backend/services/simulation/services/market_rules.py): `backend/services/simulation/services/market_rules.py`
- [Broker bridge](https://github.com/qusong0627/quantmind/blob/master/bridge/windows/src/api/routes.py): `bridge/windows/src/api/routes.py`

### Platform services

- [API services](https://github.com/qusong0627/quantmind/tree/master/backend/services/api): `backend/services/api`
- [Market data platform](https://github.com/qusong0627/quantmind/tree/master/backend/services/engine/data_platform): `backend/services/engine/data_platform`
- [Strategy storage](https://github.com/qusong0627/quantmind/blob/master/backend/shared/strategy_storage.py): `backend/shared/strategy_storage.py`
- [Production monitoring](https://github.com/qusong0627/quantmind/blob/master/backend/shared/observability/logging.py): `backend/shared/observability/logging.py`

### Other components

- **Researcher / trader**

## Connections

- Researcher / trader → Desktop and web client: uses
- Desktop and web client → API services: requests services
- API services → Market data platform: serves data
- Market data platform → Research and screening: feeds screening
- Market data platform → News and sentiment: provides market context
- Researcher / trader → News and sentiment: monitors news
- Researcher / trader → Market analysis: reviews markets
- Researcher / trader → Research and screening: screens stocks
- Researcher / trader → Factor evolution: proposes hypotheses
- Factor evolution → Model training: produces factors
- Market data platform → Model training: provides features (evidence: `backend/services/engine/inference/inference_backtest_service.py`)
- Model training → Batch inference: supplies models (evidence: `backend/services/engine/inference/inference_backtest_service.py`)
- Batch inference → Qlib backtests: provides scores
- Researcher / trader → Qlib backtests: configures backtests
- Qlib backtests → Backtest engine manager: runs backtest
- Backtest engine manager → Event-driven engine: dispatches run (evidence: `backend/shared/backtest_engine/integration/engine_manager.py`)
- Researcher / trader → Strategy storage: manages strategies
- Strategy storage → Simulation engine: loads strategy (evidence: `backend/services/simulation/engine.py`)
- Batch inference → Simulation engine: supplies signals
- Researcher / trader → Trading preflight and risk: checks readiness
- Simulation engine → Market data platform: loads local bars (evidence: `backend/services/simulation/engine.py`)
- Simulation engine → Order execution: submits orders (evidence: `backend/services/simulation/engine.py`)
- Order execution → Orders and trade ledger: records fills (evidence: `backend/services/simulation/services/execution_engine.py`)
- Simulation engine → Trading preflight and risk: applies market rules (evidence: `backend/services/simulation/engine.py`)
- Researcher / trader → Community model hub: shares models
- API services → Community model hub: serves hub requests
- Researcher / trader → Broker bridge: connects broker
- Qlib backtests → Production monitoring: logs activity (evidence: `backend/services/engine/qlib_app/services/backtest_service_query.py`)
