# akshatt/receptionbot architecture

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

- Interactive diagram: https://gitdiagram.com/akshatt/receptionbot
- Repository: https://github.com/akshatt/receptionbot

## Overview

##### Project Type and Purpose
- ReceptionBot is a conversational AI agent built on the Rasa framework (NLU + Core).
- It handles hotel-related intents: booking rooms, scheduling cleaning, FAQs, dynamic slot filling, and interruptions mid-flow.

##### Top-Level Components
A. Offline Training Pipeline
B. Runtime Serving Architecture

##### Offline Training Pipeline
- Training Data Store (folder “data/” + domain.yml + responses.md)
- Configuration (config.yml)
- Rasa Trainer
– NLU pipeline (DIETClassifier, tokenizers, featurizers)
– Core policies (Memoization, TED, RulePolicy)
- Output (models/ timestamped .tar.gz)

data/ + domain.yml + config.yml → Rasa Trainer → models/

##### Runtime Serving Architecture
1. Channel Connectors (from credentials.yml & endpoints.yml)
– e.g. CLI (rasa shell), REST input, Facebook Messenger, etc.
2. Rasa Server
- Rasa NLU component (intent/entity recognition)
- Rasa Core component (dialogue management using policies + tracker store)
- Domain definitions (responses, slots, forms, actions)
3. Action Server (actions.py)
– Custom action endpoints (external API calls, business logic)
4. Tracker Store (optional persistent storage)
– Could be InMemory, Redis, or a database (configured in endpoints.yml)
5. Response Output
– Bot replies back to the channel connector which forwards to the user UI

User → Channel Connector → Rasa Server → (NLU→Core) →
– If custom action required → Action Server → Core
– Core → Response → Channel Connector → User

##### Component Details & Technologies
- Rasa Framework v1.8 (Python 3.6.8)
- config.yml defines pipeline components (e.g., DIETClassifier, CountVectorsFeaturizer) and Core policies
- domain.yml declares intents, entities, slots, forms, responses, action names
- data/nlu.md, data/stories.md, data/responses.md encapsulate training examples
- endpoints.yml configures action endpoint URL and tracker store
- credentials.yml lists channel credentials (shell, REST, messenger, etc.)
- actions.py hosts Python functions for custom actions (e.g., scheduling cleaning, booking logic)

##### Architectural Patterns & Principles
- Separation of concerns: NLU vs. Core vs. custom actions
- Modular data configuration: domain, stories, NLU examples, responses in distinct files
- Pluggable pipelines: config.yml allows swapping models or policies
- Stateless core with optional persistent tracker store for conversational context

##### Capturing Details
- In the Training section, annotate that multiple timestamped models appear under models/
- In the Runtime section, note that “rasa run actions” launches the Action Server separately
- Split between Rasa NLU processing and Rasa Core dialogue management
- How interruptions mid-flow are handled by the same Core policies and fallback rules

[OFFLINE TRAINING – Blue Section]
data/nlu.md, data/stories.md, domain.yml, config.yml
↓
Rasa Trainer
↓
models/

[RUNTIME SERVING – Green Section]
User ←→ Channel Connector(s) ←→ Rasa Server
↳ Domain + policies (domain.yml, config.yml)
↳ ←→ Tracker Store
↳ → Custom Actions (Action Server via endpoints.yml)
↓
Bot Responses

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Offline Training
    subgraph "Offline Training"
        direction TB
        DataFiles["📄 data/nlu.md<br/>data/stories.md<br/>data/responses.md<br/>domain.yml"]:::paper
        Config["📄 config.yml"]:::paper
        Trainer["🔧 Rasa Trainer"]:::service
        Models["💾 models/<timestamp>.tar.gz"]:::database
    end

    DataFiles -->|feeds| Trainer
    Config -->|uses| Trainer
    Trainer -->|outputs| Models

    %% Runtime Serving
    subgraph "Runtime Serving"
        direction TB
        User["👤 User"]:::external
        Channel["☁️ Channel Connectors"]:::external
        RasaServer["🟩 Rasa Server"]:::service
        subgraph "Core Components"
            direction TB
            NLU["NLU Component"]:::service
            CoreDM["Core Dialogue Manager"]:::service
        end
        TrackerStore["💾 Tracker Store"]:::database
        ActionServer["🔧 Action Server"]:::service
        ResponseTemplates["📄 data/responses.md"]:::paper
    end

    User -->|interacts| Channel
    Channel -->|forwards| RasaServer
    RasaServer --> NLU
    NLU --> CoreDM
    CoreDM -->|uses tracker| TrackerStore
    CoreDM -->|calls| ActionServer
    CoreDM -->|responds| Channel
    ActionServer -->|returns results| CoreDM
    Channel -->|delivers| User

    %% Configuration dependencies
    Config -.->|configures| RasaServer
    ResponseTemplates -.->|defines responses| RasaServer

    %% Click Events
    click DataFiles "https://github.com/akshatt/receptionbot/tree/master/data/"
    click Config "https://github.com/akshatt/receptionbot/blob/master/config.yml"
    click Models "https://github.com/akshatt/receptionbot/tree/master/models/"
    click Channel "https://github.com/akshatt/receptionbot/blob/master/credentials.yml"
    click TrackerStore "https://github.com/akshatt/receptionbot/blob/master/endpoints.yml"
    click ActionServer "https://github.com/akshatt/receptionbot/blob/master/actions.py"
    click ResponseTemplates "https://github.com/akshatt/receptionbot/blob/master/data/responses.md"

    %% Styles
    classDef offline fill:#add8e6,stroke:#000,stroke-width:1px
    classDef runtime fill:#90ee90,stroke:#000,stroke-width:1px
    classDef external fill:#ffa500,stroke:#000,stroke-width:1px
    classDef service fill:#f0f0f0,stroke:#000,stroke-width:1px
    classDef database fill:#ffe4b5,stroke:#000,stroke-width:1px
    classDef paper fill:#e0ffff,stroke:#000,stroke-width:1px

    class DataFiles,Config,Models offline
    class Trainer offline
    class User,Channel,RasaServer,NLU,CoreDM,ActionServer,TrackerStore,ResponseTemplates runtime
    class User,Channel external
```
