# altplusw/trading-ai-vault architecture

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

- Interactive diagram: https://gitdiagram.com/altplusw/trading-ai-vault
- Repository: https://github.com/altplusw/trading-ai-vault

## Overview

This repository is a specification vault, not the trading implementation: the README identifies the implementation as a separate Python/FastAPI/SQLite project and describes the product as a local-first AI chatbot for paper trading. The graph captures the documented product areas, but the available evidence does not establish their internal call or data flow. Only the chatbot-to-paper-trading relationship is explicit; detailed subsystem connections are therefore omitted.

Main entry points: [`04 - Main AI.md`](https://github.com/altplusw/trading-ai-vault/blob/main/04%20-%20Main%20AI.md) (Main AI), [`10 - Paper Trading.md`](https://github.com/altplusw/trading-ai-vault/blob/main/10%20-%20Paper%20Trading.md) (Paper Trading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ai["AI and Inputs"]
  node_main_ai["Main AI<br/>[04 - Main AI.md]"]
  node_laya["Laya<br/>[05 - Laya.md]"]
  node_market_data["Market Data"]
end

subgraph group_trading["Trading Operations"]
  node_order_flow["Order Flow<br/>[07 - Order Flow.md]"]
  node_strategy["Strategy Engine"]
  node_risk["Risk Engine"]
  node_paper["Paper Trading"]
  node_portfolio[("Portfolio and Positions")]
  node_journal[("Trade Journal")]
end

subgraph group_evidence["Evidence and Learning"]
  node_backtesting["Backtesting"]
  node_calibration["Calibration"]
  node_autonomous["Autonomous Trading"]
  node_improvement["Self Improvement"]
end

subgraph group_platform["Platform and Safety"]
  node_database[("Database<br/>[17 - Database.md]")]
  node_api["API and Tools"]
  node_dashboard["UI Dashboard"]
  node_security["Security<br/>[20 - Security.md]"]
  node_implementation["Trading Implementation"]
end

node_user(("User"))

node_user -.->|"chats with"| node_main_ai
node_main_ai -->|"operates"| node_paper

click node_main_ai "https://github.com/altplusw/trading-ai-vault/blob/main/04%20-%20Main%20AI.md"
click node_laya "https://github.com/altplusw/trading-ai-vault/blob/main/05%20-%20Laya.md"
click node_market_data "https://github.com/altplusw/trading-ai-vault/blob/main/06%20-%20Market%20Data.md"
click node_order_flow "https://github.com/altplusw/trading-ai-vault/blob/main/07%20-%20Order%20Flow.md"
click node_strategy "https://github.com/altplusw/trading-ai-vault/blob/main/08%20-%20Strategy%20Engine.md"
click node_risk "https://github.com/altplusw/trading-ai-vault/blob/main/09%20-%20Risk%20Engine.md"
click node_paper "https://github.com/altplusw/trading-ai-vault/blob/main/10%20-%20Paper%20Trading.md"
click node_portfolio "https://github.com/altplusw/trading-ai-vault/blob/main/11%20-%20Portfolio%20and%20Positions.md"
click node_journal "https://github.com/altplusw/trading-ai-vault/blob/main/12%20-%20Trade%20Journal.md"
click node_backtesting "https://github.com/altplusw/trading-ai-vault/blob/main/13%20-%20Backtesting.md"
click node_calibration "https://github.com/altplusw/trading-ai-vault/blob/main/14%20-%20Calibration.md"
click node_autonomous "https://github.com/altplusw/trading-ai-vault/blob/main/15%20-%20Autonomous%20Trading.md"
click node_improvement "https://github.com/altplusw/trading-ai-vault/blob/main/16%20-%20Self%20Improvement.md"
click node_database "https://github.com/altplusw/trading-ai-vault/blob/main/17%20-%20Database.md"
click node_api "https://github.com/altplusw/trading-ai-vault/blob/main/18%20-%20API%20and%20Tools.md"
click node_dashboard "https://github.com/altplusw/trading-ai-vault/blob/main/19%20-%20UI%20Dashboard.md"
click node_security "https://github.com/altplusw/trading-ai-vault/blob/main/20%20-%20Security.md"

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_main_ai,node_laya,node_market_data,node_user toneBlue
class node_order_flow,node_strategy,node_risk,node_paper,node_portfolio,node_journal toneAmber
class node_backtesting,node_calibration,node_autonomous,node_improvement toneMint
class node_database,node_api,node_dashboard,node_security,node_implementation toneRose
```

## Components

### AI and Inputs

- [Main AI](https://github.com/altplusw/trading-ai-vault/blob/main/04%20-%20Main%20AI.md): `04 - Main AI.md`
- [Laya](https://github.com/altplusw/trading-ai-vault/blob/main/05%20-%20Laya.md): `05 - Laya.md`
- [Market Data](https://github.com/altplusw/trading-ai-vault/blob/main/06%20-%20Market%20Data.md): `06 - Market Data.md`

### Trading Operations

- [Order Flow](https://github.com/altplusw/trading-ai-vault/blob/main/07%20-%20Order%20Flow.md): `07 - Order Flow.md`
- [Strategy Engine](https://github.com/altplusw/trading-ai-vault/blob/main/08%20-%20Strategy%20Engine.md): `08 - Strategy Engine.md`
- [Risk Engine](https://github.com/altplusw/trading-ai-vault/blob/main/09%20-%20Risk%20Engine.md): `09 - Risk Engine.md`
- [Paper Trading](https://github.com/altplusw/trading-ai-vault/blob/main/10%20-%20Paper%20Trading.md): `10 - Paper Trading.md`
- [Portfolio and Positions](https://github.com/altplusw/trading-ai-vault/blob/main/11%20-%20Portfolio%20and%20Positions.md): `11 - Portfolio and Positions.md`
- [Trade Journal](https://github.com/altplusw/trading-ai-vault/blob/main/12%20-%20Trade%20Journal.md): `12 - Trade Journal.md`

### Evidence and Learning

- [Backtesting](https://github.com/altplusw/trading-ai-vault/blob/main/13%20-%20Backtesting.md): `13 - Backtesting.md`
- [Calibration](https://github.com/altplusw/trading-ai-vault/blob/main/14%20-%20Calibration.md): `14 - Calibration.md`
- [Autonomous Trading](https://github.com/altplusw/trading-ai-vault/blob/main/15%20-%20Autonomous%20Trading.md): `15 - Autonomous Trading.md`
- [Self Improvement](https://github.com/altplusw/trading-ai-vault/blob/main/16%20-%20Self%20Improvement.md): `16 - Self Improvement.md`

### Platform and Safety

- [Database](https://github.com/altplusw/trading-ai-vault/blob/main/17%20-%20Database.md): `17 - Database.md`
- [API and Tools](https://github.com/altplusw/trading-ai-vault/blob/main/18%20-%20API%20and%20Tools.md): `18 - API and Tools.md`
- [UI Dashboard](https://github.com/altplusw/trading-ai-vault/blob/main/19%20-%20UI%20Dashboard.md): `19 - UI Dashboard.md`
- [Security](https://github.com/altplusw/trading-ai-vault/blob/main/20%20-%20Security.md): `20 - Security.md`
- **Trading Implementation**

### Other components

- **User**

## Connections

- User → Main AI: chats with
- Main AI → Paper Trading: operates (evidence: `README.md`)
