# heliodao/helio architecture

> Architecture diagram of the GitHub repository heliodao/helio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heliodao/helio
- Repository: https://github.com/heliodao/helio

## Overview

##### Main Components

a) Core System Components:
- API Server (from agents/api_server.py)
- Memory Management System (from agents/memory.py)
- Role Management System (from agents/roles.py)
- Swarm Network (from agents/swarm.py)
- Telegram Bot Interface (from agents/telegram_bot.py)
- Configuration Management (from config/settings.py)

b) External Integrations:
- Solana Blockchain
- AI/ML Processing Units
- External APIs/Services

**┌─────────────────────────────────────────┐**
- Telegram Bot │ API Server │ Other APIs  │
- ┘

**┌─────────────────────────────────────────┐**
- Role Manager │ Memory System │ Swarm    │
- ┘

**┌─────────────────────────────────────────┐**
- Solana │ AI Models │ WASM Compute Nodes │
- ┘

##### Key Elements to Highlight

a) Swarm Architecture:
- Distributed nature of the swarm nodes
- WASM execution environments
- Node intercommunication patterns

b) AI Integration:
- TensorFlow/PyTorch processing units
- Model deployment flow
- Data processing pipeline

c) Blockchain Integration:
- Solana connection points
- Smart contract interaction paths
- Transaction processing flow

##### Specific Implementation Notes

- The modular nature of the agents/ directory structure
- Configuration management flow from config/settings.py
- Main application entry point (main.py) connections
- Role-based access control from roles.py
- Memory management patterns from memory.py

##### Scale and Detail Level

Maintain L2 detail level showing:
- Major components and their interactions
- Key data flows
- System boundaries
- Integration points
- Scaling mechanisms

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef interface fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef memory fill:#f1c40f,stroke:#f39c12,color:black
    classDef blockchain fill:#9b59b6,stroke:#8e44ad,color:white
    classDef ai fill:#e67e22,stroke:#d35400,color:white
    classDef infrastructure fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Interface Layer
    subgraph Interface
        TB["Telegram Bot"]:::interface
        AS["API Server"]:::interface
        EA["External APIs"]:::interface
    end

    %% Core Processing Layer
    subgraph Core
        RM["Role Manager"]:::processing
        MS["Memory System"]:::memory
        SW["Swarm Network"]:::processing
        CM["Config Manager"]:::processing
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        SB["Solana Blockchain"]:::blockchain
        AI["AI Models"]:::ai
        WN["WASM Compute Nodes"]:::infrastructure
    end

    %% Relationships
    TB --> AS
    TB --> RM
    AS --> RM
    AS --> MS
    RM <--> MS
    RM --> SW
    SW <--> WN
    MS <--> SB
    SW <--> AI
    CM --> RM
    CM --> MS
    CM --> SW

    %% Click Events
    click AS "https://github.com/HelioDAO/Helio/blob/main/agents/api_server.py"
    click MS "https://github.com/HelioDAO/Helio/blob/main/agents/memory.py"
    click RM "https://github.com/HelioDAO/Helio/blob/main/agents/roles.py"
    click SW "https://github.com/HelioDAO/Helio/blob/main/agents/swarm.py"
    click TB "https://github.com/HelioDAO/Helio/blob/main/agents/telegram_bot.py"
    click CM "https://github.com/HelioDAO/Helio/blob/main/config/settings.py"

    %% Legend
    subgraph Legend
        L1["Interface Components"]:::interface
        L2["Processing Components"]:::processing
        L3["Memory Components"]:::memory
        L4["Blockchain Components"]:::blockchain
        L5["AI Components"]:::ai
        L6["Infrastructure Components"]:::infrastructure
    end
```
