# lowkey-one/melp_bot architecture

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

- Interactive diagram: https://gitdiagram.com/lowkey-one/melp_bot
- Repository: https://github.com/lowkey-one/melp_bot

## Overview

##### Project type and purpose
- This is an open-source conversational AI assistant built on the Rasa framework.
- It handles multiple domains (calendar, calls, chat, drive, team management, network queries, user profiles) via NLU, Core (dialogue management), and custom actions.
- It’s containerized for deployment (Docker, docker-compose).

##### File structure
Top level
- actions/          – Python action server code (actions.py)
- data/             – Rasa training data: NLU, rules, stories
- domain/           – Rasa domain definitions per feature
- models/           – Trained model artifacts
- endpoints.yml     – Runtime endpoint config (Rasa server, action server)
- credentials.yml   – Connector credentials (Slack, Facebook, etc.)
- config.yml        – Pipeline & policy configurations
- Dockerfile & docker-compose.yml – Container definitions
- tests/            – Test stories
- dump/             – Static FAQ dumps, UI assets (HTML/CSS/JS)

##### README for additional insights
- It’s boilerplate; no architectural specifics. We infer from standard Rasa design.

##### Detailed checklist
- Separate Rasa NLU, Core, and Action Server as distinct services.
- Training pipeline: data/ + config.yml → train → models/.
- Channel connectors (HTTP, Slack, FB) into Rasa API.
- Action server calls out to third-party REST APIs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Channels
    subgraph "User Interaction"
        direction TB
        User["User"]:::external
        subgraph "Channel Connectors" 
            direction TB
            Slack["Slack Connector"]:::external
            Facebook["Facebook Connector"]:::external
            HTTP["Custom HTTP Connector"]:::external
        end
    end

    %% Rasa Services
    subgraph "Rasa Services"
        direction TB
        NLU["Rasa NLU Server"]:::rasa
        Core["Rasa Core Server"]:::rasa
        Actions["Action Server"]:::code
    end

    %% Runtime Configuration
    subgraph "Runtime Configuration"
        direction TB
        ConfigYML["config.yml"]:::config
        EndpointsYML["endpoints.yml"]:::config
        CredentialsYML["credentials.yml"]:::config
    end

    %% Training Pipeline
    subgraph "Training Pipeline"
        direction TB
        Data["Training Data Store"]:::data
        TrainJob["Training Job"]:::rasa
        Models["Model Store"]:::storage
    end

    %% External Services
    subgraph "External APIs"
        direction TB
        Calendar["Calendar API"]:::external
        Drive["Drive API"]:::external
        Network["Network Query API"]:::external
        Profile["User Profile API"]:::external
    end

    %% Test Harness
    subgraph "Test Harness"
        direction TB
        Tests["tests/test_stories.yml"]:::code
    end

    %% Flows
    User -->|sends message| Slack
    User -->|sends message| Facebook
    User -->|sends message| HTTP
    Slack -->|HTTP request| NLU
    Facebook -->|HTTP request| NLU
    HTTP -->|HTTP request| NLU

    NLU -->|intent & entity| Core
    Core -->|execute policy/story| Core
    Core -->|calls| Actions
    Actions -->|REST calls| Calendar
    Actions -->|REST calls| Drive
    Actions -->|REST calls| Network
    Actions -->|REST calls| Profile
    Actions -->|returns result| Core
    Core -->|response| Slack
    Core -->|response| Facebook
    Core -->|response| HTTP

    ConfigYML -->|defines pipeline & policies| NLU
    ConfigYML -->|defines pipeline & policies| Core
    EndpointsYML -->|NLU endpoint| NLU
    EndpointsYML -->|Core endpoint| Core
    EndpointsYML -->|Action endpoint| Actions
    CredentialsYML -->|connector creds| Slack
    CredentialsYML -->|connector creds| Facebook
    CredentialsYML -->|connector creds| HTTP

    Data -->|source| TrainJob
    ConfigYML -->|configures| TrainJob
    TrainJob -->|produces| Models

    Tests -->|tests stories| Core

    %% Click Events
    click NLU "https://github.com/lowkey-one/melp_bot/blob/main/config.yml"
    click NLU "https://github.com/lowkey-one/melp_bot/tree/main/data/nlu/"
    click NLU "https://github.com/lowkey-one/melp_bot/blob/main/endpoints.yml"
    click Core "https://github.com/lowkey-one/melp_bot/blob/main/config.yml"
    click Core "https://github.com/lowkey-one/melp_bot/tree/main/data/stories/"
    click Core "https://github.com/lowkey-one/melp_bot/blob/main/data/rules/rules.yml"
    click Core "https://github.com/lowkey-one/melp_bot/blob/main/domain/domain.yml"
    click Core "https://github.com/lowkey-one/melp_bot/tree/main/domain/"
    click Core "https://github.com/lowkey-one/melp_bot/blob/main/endpoints.yml"
    click Actions "https://github.com/lowkey-one/melp_bot/blob/main/actions/actions.py"
    click Actions "https://github.com/lowkey-one/melp_bot/tree/main/actions/Dockerfile"
    click Actions "https://github.com/lowkey-one/melp_bot/blob/main/actions/__init__.py"
    click Data "https://github.com/lowkey-one/melp_bot/tree/main/data/nlu/"
    click Data "https://github.com/lowkey-one/melp_bot/tree/main/data/stories/"
    click Data "https://github.com/lowkey-one/melp_bot/tree/main/data/rules/"
    click Data "https://github.com/lowkey-one/melp_bot/tree/main/domain/"
    click Data "https://github.com/lowkey-one/melp_bot/tree/main/dump/"
    click Models "https://github.com/lowkey-one/melp_bot/tree/main/models/"
    click OrchestrationDockerfile "https://github.com/lowkey-one/melp_bot/tree/main/Dockerfile"
    click OrchestrationCompose "https://github.com/lowkey-one/melp_bot/blob/main/docker-compose.yml"
    click CredentialsYML "https://github.com/lowkey-one/melp_bot/blob/main/credentials.yml"
    click ConfigYML "https://github.com/lowkey-one/melp_bot/blob/main/config.yml"
    click EndpointsYML "https://github.com/lowkey-one/melp_bot/blob/main/endpoints.yml"
    click Tests "https://github.com/lowkey-one/melp_bot/blob/main/tests/test_stories.yml"

    %% Styles
    classDef rasa fill:#E0F7FA,stroke:#006064,color:#006064
    classDef code fill:#E8F5E9,stroke:#2E7D32,color:#2E7D32
    classDef config fill:#FFF3E0,stroke:#EF6C00,color:#E65100
    classDef external fill:#ECEFF1,stroke:#455A64,color:#455A64
    classDef data fill:#FFFDE7,stroke:#F9A825,color:#F57F17
    classDef storage fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C
```
