# anvithdommata/cerebellum architecture

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

- Interactive diagram: https://gitdiagram.com/anvithdommata/cerebellum
- Repository: https://github.com/anvithdommata/cerebellum

## Overview

Cerebellum is an investment-research platform: users ingest market and reference data, run predictions across five signal engines, inspect forecasts and weights, then evaluate matured forecasts to adapt engine weights. The README describes backfill, settings, and data-source capabilities, but the supplied tree contains only the server entry point and a partial dashboard; most backend paths are absent. Those documented subsystems are shown without invented source paths, and their internal wiring is limited to the documented workflow.

Main entry points: [`server.ts`](https://github.com/anvithdommata/cerebellum/blob/main/server.ts) (HTTP server), [`DashboardPanel.tsx`](https://github.com/anvithdommata/cerebellum/blob/main/DashboardPanel.tsx) (Research dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_server["HTTP server<br/>[server.ts]"]
  node_api["Research API"]
  node_settings["Key settings"]
end

subgraph group_ingest["Data ingestion"]
  node_scheduler["Ingestion scheduler"]
  node_ingestion["Ingestion jobs"]
  node_priceproviders["Price sources"]
  node_fundamentals["Fundamental data"]
  node_newsdata["News data"]
  node_policydata["Government data"]
  node_socialdata[("Social stream")]
end

subgraph group_research["Prediction"]
  node_engines["Signal engines"]
  node_metamodel["Weighted ensemble"]
  node_predictions[("Forecasts")]
  node_backfill["Historical backtest"]
end

subgraph group_learning["Reflection"]
  node_reflection["Outcome scoring"]
  node_plasticity["Weight updates"]
  node_journal[("Mistake journal")]
end

subgraph group_experience["User interface"]
  node_dashboard["Research dashboard<br/>[DashboardPanel.tsx]"]
end

node_user(("Research user"))
node_providers["Market and data APIs"]
node_gemini["Gemini"]
node_settingsfile["Local settings file"]

node_user -->|"requests"| node_server
node_server -->|"routes API"| node_api
node_server -->|"mounts settings"| node_settings
node_server -->|"starts jobs"| node_scheduler
node_scheduler -->|"schedules"| node_ingestion
node_user -->|"triggers imports"| node_ingestion
node_ingestion -->|"fetches prices"| node_priceproviders
node_ingestion -->|"fetches fundamentals"| node_fundamentals
node_ingestion -->|"fetches news"| node_newsdata
node_ingestion -->|"fetches policy data"| node_policydata
node_priceproviders -->|"reads prices"| node_providers
node_fundamentals -->|"reads fundamentals"| node_providers
node_newsdata -->|"scores sentiment"| node_gemini
node_user -->|"runs pipeline"| node_api
node_api -->|"runs inference"| node_engines
node_engines -->|"emits scores"| node_metamodel
node_metamodel -->|"stores forecasts"| node_predictions
node_api -->|"starts backtest"| node_backfill
node_backfill -->|"simulates predictions"| node_engines
node_backfill -->|"evaluates history"| node_reflection
node_api -->|"runs reflection"| node_reflection
node_reflection -->|"reads matured forecasts"| node_predictions
node_reflection -->|"scores outcomes"| node_plasticity
node_plasticity -->|"updates weights"| node_metamodel
node_reflection -->|"records large misses"| node_journal
node_user -->|"views research"| node_dashboard
node_dashboard -->|"loads dashboard data"| node_api
node_dashboard -->|"fetches candles"| node_server
node_user -->|"enters API keys"| node_settings
node_settings -->|"writes keys"| node_settingsfile
node_engines -.->|"reads sentiment stream"| node_socialdata

click node_server "https://github.com/anvithdommata/cerebellum/blob/main/server.ts"
click node_dashboard "https://github.com/anvithdommata/cerebellum/blob/main/DashboardPanel.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_server,node_api,node_settings,node_user toneBlue
class node_scheduler,node_ingestion,node_priceproviders,node_fundamentals,node_newsdata,node_policydata,node_socialdata toneAmber
class node_engines,node_metamodel,node_predictions,node_backfill,node_providers toneMint
class node_reflection,node_plasticity,node_journal toneRose
class node_dashboard,node_gemini,node_settingsfile toneIndigo
```

## Components

### Application entry

- [HTTP server](https://github.com/anvithdommata/cerebellum/blob/main/server.ts): `server.ts`
- **Research API**
- **Key settings**

### Data ingestion

- **Ingestion scheduler**
- **Ingestion jobs**
- **Price sources**
- **Fundamental data**
- **News data**
- **Government data**
- **Social stream**

### Prediction

- **Signal engines**
- **Weighted ensemble**
- **Forecasts**
- **Historical backtest**

### Reflection

- **Outcome scoring**
- **Weight updates**
- **Mistake journal**

### User interface

- [Research dashboard](https://github.com/anvithdommata/cerebellum/blob/main/DashboardPanel.tsx): `DashboardPanel.tsx`

### Other components

- **Research user**
- **Market and data APIs**
- **Gemini**
- **Local settings file**

## Connections

- Research user → HTTP server: requests
- HTTP server → Research API: routes API
- HTTP server → Key settings: mounts settings
- HTTP server → Ingestion scheduler: starts jobs
- Ingestion scheduler → Ingestion jobs: schedules
- Research user → Ingestion jobs: triggers imports
- Ingestion jobs → Price sources: fetches prices
- Ingestion jobs → Fundamental data: fetches fundamentals
- Ingestion jobs → News data: fetches news
- Ingestion jobs → Government data: fetches policy data
- Price sources → Market and data APIs: reads prices
- Fundamental data → Market and data APIs: reads fundamentals
- News data → Gemini: scores sentiment
- Research user → Research API: runs pipeline
- Research API → Signal engines: runs inference
- Signal engines → Weighted ensemble: emits scores
- Weighted ensemble → Forecasts: stores forecasts
- Research API → Historical backtest: starts backtest
- Historical backtest → Signal engines: simulates predictions
- Historical backtest → Outcome scoring: evaluates history
- Research API → Outcome scoring: runs reflection
- Outcome scoring → Forecasts: reads matured forecasts
- Outcome scoring → Weight updates: scores outcomes
- Weight updates → Weighted ensemble: updates weights
- Outcome scoring → Mistake journal: records large misses
- Research user → Research dashboard: views research
- Research dashboard → Research API: loads dashboard data
- Research dashboard → HTTP server: fetches candles
- Research user → Key settings: enters API keys
- Key settings → Local settings file: writes keys
- Signal engines → Social stream: reads sentiment stream
