# manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent architecture

> Architecture diagram of the GitHub repository manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent
- Repository: https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent

## Overview

CrowdWisdomTrading combines two user-facing products: a reproducible price-forecast research pipeline and a REST sentiment-analysis service. The pipeline accepts demo, imported, or live market/social/news data, normalizes and joins it, builds features, evaluates and fits forecasts, then emits reports and audit artifacts. The API analyzes individual or batched text and exposes history. Edges are grounded in the README and SOURCE INDEX references; unsampled implementation details are not inferred beyond those references.

Main entry points: [`src/forecasting/pipeline.py`](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/pipeline.py) (Run orchestrator), [`src/api/routes.py`](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/api/routes.py) (REST endpoints), [`src/core/sentiment/analyzer.py`](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/analyzer.py) (Sentiment orchestrator), [`src/forecasting/providers.py`](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/providers.py) (Live providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_forecast_inputs["Forecast inputs"]
  node_demo_data["Synthetic data<br/>[demo.py]"]
  node_live_providers["Live providers<br/>[providers.py]"]
  node_data_normalization["Data normalization<br/>[data.py]"]
end

subgraph group_forecast_engine["Forecast engine"]
  node_forecast_pipeline["Run orchestrator<br/>[pipeline.py]"]
  node_features["Feature engineering<br/>[features.py]"]
  node_forecast_model["Forecast and validation<br/>[model.py]"]
end

subgraph group_sentiment_api["Sentiment API"]
  node_sentiment_routes["REST endpoints<br/>[routes.py]"]
  node_sentiment_analyzer["Sentiment orchestrator<br/>[analyzer.py]"]
  node_rule_analyzer["Rule scorer<br/>[rule_based.py]"]
  node_ml_analyzer["ML scorer<br/>[ml_model.py]"]
  node_configuration["Configuration<br/>[config.py]"]
end

subgraph group_persistence["Persistence and outputs"]
  node_forecast_store[("Run snapshot store<br/>[storage.py]")]
  node_reporting["Reports and charts<br/>[reporting.py]"]
  node_sentiment_repository[("Sentiment repository<br/>[repository.py]")]
end

node_researcher(("Researcher"))
node_api_client(("API client"))
node_apify["Apify"]
node_tavily["Tavily"]

node_researcher -->|"runs"| node_forecast_pipeline
node_forecast_pipeline -->|"loads demo"| node_demo_data
node_forecast_pipeline -->|"fetches live data"| node_live_providers
node_live_providers -->|"requests X and prices"| node_apify
node_live_providers -->|"searches news"| node_tavily
node_forecast_pipeline -->|"normalizes records"| node_data_normalization
node_forecast_pipeline -->|"builds features"| node_features
node_forecast_pipeline -->|"stores run data"| node_forecast_store
node_forecast_store -->|"uses JSON encoding"| node_data_normalization
node_forecast_pipeline -->|"evaluates and predicts"| node_forecast_model
node_forecast_model -->|"uses feature schema"| node_features
node_forecast_pipeline -->|"writes reports"| node_reporting
node_api_client -->|"requests analysis"| node_sentiment_routes
node_sentiment_routes -->|"analyzes text"| node_sentiment_analyzer
node_sentiment_analyzer -->|"scores with rules"| node_rule_analyzer
node_sentiment_analyzer -->|"scores with ML"| node_ml_analyzer
node_sentiment_routes -->|"reads and stores history"| node_sentiment_repository
node_sentiment_analyzer -->|"uses persistence"| node_sentiment_repository
node_sentiment_routes -->|"loads settings"| node_configuration
node_forecast_pipeline -->|"scores post sentiment"| node_rule_analyzer

click node_forecast_pipeline "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/pipeline.py"
click node_demo_data "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/demo.py"
click node_live_providers "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/providers.py"
click node_data_normalization "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/data.py"
click node_forecast_store "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/storage.py"
click node_features "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/features.py"
click node_forecast_model "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/model.py"
click node_reporting "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/reporting.py"
click node_sentiment_routes "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/api/routes.py"
click node_sentiment_analyzer "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/analyzer.py"
click node_rule_analyzer "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/rule_based.py"
click node_ml_analyzer "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/ml_model.py"
click node_configuration "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/utils/config.py"
click node_sentiment_repository "https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/storage/repository.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_demo_data,node_live_providers,node_data_normalization,node_api_client toneBlue
class node_forecast_pipeline,node_features,node_forecast_model toneAmber
class node_sentiment_routes,node_sentiment_analyzer,node_rule_analyzer,node_ml_analyzer,node_configuration,node_apify toneMint
class node_forecast_store,node_reporting,node_sentiment_repository toneRose
class node_researcher,node_tavily toneIndigo
```

## Components

### Forecast inputs

- [Synthetic data](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/demo.py): `src/forecasting/demo.py`
- [Live providers](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/providers.py): `src/forecasting/providers.py`
- [Data normalization](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/data.py): `src/forecasting/data.py`

### Forecast engine

- [Run orchestrator](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/pipeline.py): `src/forecasting/pipeline.py`
- [Feature engineering](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/features.py): `src/forecasting/features.py`
- [Forecast and validation](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/model.py): `src/forecasting/model.py`

### Sentiment API

- [REST endpoints](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/api/routes.py): `src/api/routes.py`
- [Sentiment orchestrator](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/analyzer.py): `src/core/sentiment/analyzer.py`
- [Rule scorer](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/rule_based.py): `src/core/sentiment/rule_based.py`
- [ML scorer](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/sentiment/ml_model.py): `src/core/sentiment/ml_model.py`
- [Configuration](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/core/utils/config.py): `src/core/utils/config.py`

### Persistence and outputs

- [Run snapshot store](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/storage.py): `src/forecasting/storage.py`
- [Reports and charts](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/forecasting/reporting.py): `src/forecasting/reporting.py`
- [Sentiment repository](https://github.com/manvendra8511/crowdwisdomtrading-x-sentiment-price-prediction-agent/blob/main/src/storage/repository.py): `src/storage/repository.py`

### Other components

- **Researcher**
- **API client**
- **Apify**
- **Tavily**

## Connections

- Researcher → Run orchestrator: runs (evidence: `README.md`)
- Run orchestrator → Synthetic data: loads demo (evidence: `src/forecasting/pipeline.py`)
- Run orchestrator → Live providers: fetches live data (evidence: `README.md`)
- Live providers → Apify: requests X and prices (evidence: `README.md`)
- Live providers → Tavily: searches news (evidence: `README.md`)
- Run orchestrator → Data normalization: normalizes records (evidence: `src/forecasting/pipeline.py`)
- Run orchestrator → Feature engineering: builds features (evidence: `src/forecasting/pipeline.py`)
- Run orchestrator → Run snapshot store: stores run data (evidence: `src/forecasting/pipeline.py`)
- Run snapshot store → Data normalization: uses JSON encoding (evidence: `src/forecasting/storage.py`)
- Run orchestrator → Forecast and validation: evaluates and predicts (evidence: `src/forecasting/pipeline.py`)
- Forecast and validation → Feature engineering: uses feature schema (evidence: `src/forecasting/model.py`)
- Run orchestrator → Reports and charts: writes reports (evidence: `src/forecasting/pipeline.py`)
- API client → REST endpoints: requests analysis (evidence: `README.md`)
- REST endpoints → Sentiment orchestrator: analyzes text (evidence: `src/api/routes.py`)
- Sentiment orchestrator → Rule scorer: scores with rules (evidence: `src/core/sentiment/analyzer.py`)
- Sentiment orchestrator → ML scorer: scores with ML (evidence: `src/core/sentiment/analyzer.py`)
- REST endpoints → Sentiment repository: reads and stores history (evidence: `src/api/routes.py`)
- Sentiment orchestrator → Sentiment repository: uses persistence (evidence: `src/core/sentiment/analyzer.py`)
- REST endpoints → Configuration: loads settings (evidence: `src/api/routes.py`)
- Run orchestrator → Rule scorer: scores post sentiment (evidence: `src/forecasting/pipeline.py`)
