# kinggio0326/creativityland-local architecture

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

- Interactive diagram: https://gitdiagram.com/kinggio0326/creativityland-local
- Repository: https://github.com/kinggio0326/creativityland-local

## Overview

This repository implements a local market-research and trading system. One workflow gathers and ranks news, derives sentiment and embeddings, evaluates market regime and trading state, then produces weighted signals for bridging and persistence. A separate paper-trading workflow evaluates trade intents through debate, risk and portfolio checks, research scoring, and paper-broker execution. Position management, semantic memory, and the dashboard provide supporting capabilities. The graph reflects the documented pipeline sequences and indexed module references; where wiring is not explicit in the available excerpts, relationships are omitted rather than inferred.

Main entry points: [`local_runtime/orchestration/paper_pipeline.py`](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/orchestration/paper_pipeline.py) (Paper orchestrator), [`local_runtime/signal_local/pipeline.py`](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/pipeline.py) (Signal pipeline), [`local_runtime/semantic_memory/service.py`](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/semantic_memory/service.py) (Semantic memory), [`local_runtime/signal_local/embedding_runner.py`](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/embedding_runner.py) (Article embeddings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_signals["Signal research"]
  node_signal_flow["Signal pipeline<br/>[pipeline.py]"]
  node_scraping["News scraping<br/>[scraper_runner.py]"]
  node_fulltext["Text extraction"]
  node_sentiment["Sentiment analysis"]
  node_embeddings["Article embeddings"]
  node_regime["Market regime<br/>[regime_runner.py]"]
  node_weighted["Weighted signals"]
end

subgraph group_decisions["Trade decisions"]
  node_orchestrator["Paper orchestrator<br/>[paper_pipeline.py]"]
  node_debate["Trade debate"]
  node_alpha["Alpha analysis<br/>[alpha_score.py]"]
  node_alpha_adapter["Alpha adapter"]
  node_research["Research scoring"]
end

subgraph group_execution["Risk and execution"]
  node_portfolio["Portfolio gate"]
  node_ftmo["FTMO risk review"]
  node_macro["Macro risk review<br/>[reviewer.py]"]
  node_broker["Paper broker<br/>[paper_local.py]"]
  node_position_manager["Position manager"]
  node_sltp["SL/TP updates"]
end

subgraph group_memory["Research memory"]
  node_semantic["Semantic memory<br/>[service.py]"]
  node_flat_index[("Vector index<br/>[flat_index.py]")]
  node_embedding_store[("Embedding store")]
end

subgraph group_interfaces["User interfaces"]
  node_dashboard["Local dashboard<br/>[server.py]"]
  node_web_dashboard["Web dashboard<br/>[page.tsx]"]
end

node_operator(("Operator"))

node_signal_flow -->|"runs scraping"| node_scraping
node_signal_flow -->|"extracts text"| node_fulltext
node_signal_flow -->|"runs sentiment"| node_sentiment
node_signal_flow -->|"creates embeddings"| node_embeddings
node_signal_flow -->|"evaluates regime"| node_regime
node_signal_flow -->|"weights signals"| node_weighted
node_embeddings -->|"persists vectors"| node_embedding_store
node_semantic -->|"searches index"| node_flat_index
node_semantic -->|"queries vectors"| node_embedding_store
node_semantic -->|"generates vectors"| node_embeddings
node_operator -.->|"submits intent"| node_orchestrator
node_orchestrator -->|"runs debate"| node_debate
node_orchestrator -->|"reviews FTMO risk"| node_ftmo
node_orchestrator -->|"reviews macro risk"| node_macro
node_orchestrator -->|"checks portfolio"| node_portfolio
node_orchestrator -->|"scores research"| node_research
node_orchestrator -->|"computes alpha"| node_alpha
node_orchestrator -->|"adapts alpha"| node_alpha_adapter
node_orchestrator -->|"retrieves reflections"| node_semantic
node_orchestrator -.->|"sends order request"| node_broker
node_position_manager -.->|"manages stops"| node_sltp
node_operator -.->|"views status"| node_dashboard
node_operator -.->|"uses dashboard"| node_web_dashboard

click node_signal_flow "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/pipeline.py"
click node_scraping "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/scraper_runner.py"
click node_fulltext "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/full_text_extractor.py"
click node_sentiment "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/sentiment_runner.py"
click node_embeddings "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/embedding_runner.py"
click node_regime "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/regime_runner.py"
click node_weighted "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/weighted_signal_runner.py"
click node_orchestrator "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/orchestration/paper_pipeline.py"
click node_debate "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/debate/debate_coordinator.py"
click node_alpha "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/alpha_engine/alpha_score.py"
click node_alpha_adapter "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/alpha_engine/pipeline_adapter.py"
click node_research "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/research_manager/research_manager.py"
click node_portfolio "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/portfolio/portfolio_manager_gate.py"
click node_ftmo "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/ftmo_debate/ftmo_risk_reviewer.py"
click node_macro "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/macro_risk/reviewer.py"
click node_broker "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/brokers/paper_local.py"
click node_position_manager "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/position_management/trade_manager_loop.py"
click node_sltp "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/position_management/sltp_modification_engine.py"
click node_semantic "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/semantic_memory/service.py"
click node_flat_index "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/semantic_memory/flat_index.py"
click node_embedding_store "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/db/repositories/signal_embeddings.py"
click node_dashboard "https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/live_dashboard/server.py"
click node_web_dashboard "https://github.com/kinggio0326/creativityland-local/blob/main/dashboard/src/app/page.tsx"

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_signal_flow,node_scraping,node_fulltext,node_sentiment,node_embeddings,node_regime,node_weighted toneBlue
class node_orchestrator,node_debate,node_alpha,node_alpha_adapter,node_research toneAmber
class node_portfolio,node_ftmo,node_macro,node_broker,node_position_manager,node_sltp toneMint
class node_semantic,node_flat_index,node_embedding_store toneRose
class node_dashboard,node_web_dashboard,node_operator toneIndigo
```

## Components

### Signal research

- [Signal pipeline](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/pipeline.py): `local_runtime/signal_local/pipeline.py`
- [News scraping](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/scraper_runner.py): `local_runtime/signal_local/scraper_runner.py`
- [Text extraction](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/full_text_extractor.py): `local_runtime/signal_local/full_text_extractor.py`
- [Sentiment analysis](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/sentiment_runner.py): `local_runtime/signal_local/sentiment_runner.py`
- [Article embeddings](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/embedding_runner.py): `local_runtime/signal_local/embedding_runner.py`
- [Market regime](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/regime_runner.py): `local_runtime/signal_local/regime_runner.py`
- [Weighted signals](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/signal_local/weighted_signal_runner.py): `local_runtime/signal_local/weighted_signal_runner.py`

### Trade decisions

- [Paper orchestrator](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/orchestration/paper_pipeline.py): `local_runtime/orchestration/paper_pipeline.py`
- [Trade debate](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/debate/debate_coordinator.py): `local_runtime/debate/debate_coordinator.py`
- [Alpha analysis](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/alpha_engine/alpha_score.py): `local_runtime/alpha_engine/alpha_score.py`
- [Alpha adapter](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/alpha_engine/pipeline_adapter.py): `local_runtime/alpha_engine/pipeline_adapter.py`
- [Research scoring](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/research_manager/research_manager.py): `local_runtime/research_manager/research_manager.py`

### Risk and execution

- [Portfolio gate](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/portfolio/portfolio_manager_gate.py): `local_runtime/portfolio/portfolio_manager_gate.py`
- [FTMO risk review](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/ftmo_debate/ftmo_risk_reviewer.py): `local_runtime/ftmo_debate/ftmo_risk_reviewer.py`
- [Macro risk review](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/macro_risk/reviewer.py): `local_runtime/macro_risk/reviewer.py`
- [Paper broker](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/brokers/paper_local.py): `local_runtime/brokers/paper_local.py`
- [Position manager](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/position_management/trade_manager_loop.py): `local_runtime/position_management/trade_manager_loop.py`
- [SL/TP updates](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/position_management/sltp_modification_engine.py): `local_runtime/position_management/sltp_modification_engine.py`

### Research memory

- [Semantic memory](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/semantic_memory/service.py): `local_runtime/semantic_memory/service.py`
- [Vector index](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/semantic_memory/flat_index.py): `local_runtime/semantic_memory/flat_index.py`
- [Embedding store](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/db/repositories/signal_embeddings.py): `local_runtime/db/repositories/signal_embeddings.py`

### User interfaces

- [Local dashboard](https://github.com/kinggio0326/creativityland-local/blob/main/local_runtime/live_dashboard/server.py): `local_runtime/live_dashboard/server.py`
- [Web dashboard](https://github.com/kinggio0326/creativityland-local/blob/main/dashboard/src/app/page.tsx): `dashboard/src/app/page.tsx`

### Other components

- **Operator**

## Connections

- Signal pipeline → News scraping: runs scraping (evidence: `local_runtime/signal_local/pipeline.py`)
- Signal pipeline → Text extraction: extracts text (evidence: `local_runtime/signal_local/pipeline.py`)
- Signal pipeline → Sentiment analysis: runs sentiment (evidence: `local_runtime/signal_local/pipeline.py`)
- Signal pipeline → Article embeddings: creates embeddings (evidence: `local_runtime/signal_local/pipeline.py`)
- Signal pipeline → Market regime: evaluates regime (evidence: `local_runtime/signal_local/pipeline.py`)
- Signal pipeline → Weighted signals: weights signals (evidence: `local_runtime/signal_local/pipeline.py`)
- Article embeddings → Embedding store: persists vectors (evidence: `local_runtime/signal_local/embedding_runner.py`)
- Semantic memory → Vector index: searches index (evidence: `local_runtime/semantic_memory/service.py`)
- Semantic memory → Embedding store: queries vectors (evidence: `local_runtime/semantic_memory/service.py`)
- Semantic memory → Article embeddings: generates vectors (evidence: `local_runtime/semantic_memory/service.py`)
- Operator → Paper orchestrator: submits intent
- Paper orchestrator → Trade debate: runs debate (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → FTMO risk review: reviews FTMO risk (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Macro risk review: reviews macro risk (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Portfolio gate: checks portfolio (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Research scoring: scores research (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Alpha analysis: computes alpha (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Alpha adapter: adapts alpha (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Semantic memory: retrieves reflections (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Paper orchestrator → Paper broker: sends order request (evidence: `local_runtime/orchestration/paper_pipeline.py`)
- Position manager → SL/TP updates: manages stops
- Operator → Local dashboard: views status
- Operator → Web dashboard: uses dashboard
