# blackout-ybigpp/lecture-assist architecture

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

- Interactive diagram: https://gitdiagram.com/blackout-ybigpp/lecture-assist
- Repository: https://github.com/blackout-ybigpp/lecture-assist

## Overview

##### Main Components Identification
The project appears to be a distributed system with several key components:

a) Core Components:
- RAG (Retrieval-Augmented Generation) Module
- Socket API Service
- Slack Bot Integration
- Frontend Interface
- Microphone Input System

##### Input Layer
- Frontend interface (frontend.py) at the top

##### Processing Layer (Center)
- RAG Module (central component)
- Subcomponents for:
- Question-Answering (rag_qa.py)
- Bed Processing (rag_bed.py)
- Summarization (sum.py, sum_recent.py, sum_sen.py)
- Vector Processing (vector_pos.py, vector_stt.py)

##### Integration Layer (Right)
- Socket API Service
- Slack Bot Service

##### Utility Layer (Bottom)
- Buffer Management
- Summarization Utils

B. Connection Flow:

##### RAG Module → Slack Bot

- Blue: Input components (mic, frontend)
- Green: Processing components (RAG module)
- Orange: Integration services (Socket API, Slack Bot)
- Gray: Utility components

D. Technical Details to Include:

##### Infrastructure
- Traefik as the reverse proxy/load balancer (indicated by traefik.toml)
- Configuration management (config.py)

##### RAG Module Details
- Vector Store
- Question-Answering Pipeline
- Summarization Engine

##### Communication Protocols
- WebSocket connections
- HTTP/REST endpoints
- Slack API integration

E. Additional Considerations:

##### Deployment boundaries
- Container boundaries (indicated by .devcontainer)
- Service boundaries

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        MIC["Microphone Input"]:::input
        FE["Frontend Interface"]:::input
    end

    subgraph "Processing Core"
        RAG["RAG Module"]:::processing
        
        subgraph "RAG Components"
            QA["Question-Answering"]:::ragcomp
            BED["Bed Processing"]:::ragcomp
            SUM["Summarization"]:::ragcomp
            VEC["Vector Processing"]:::ragcomp
        end
    end

    subgraph "Integration Services"
        SOCK["Socket API Service"]:::integration
        SLACK["Slack Bot"]:::integration
    end

    subgraph "Utility Layer"
        BUF["Buffer Manager"]:::utility
        SUMU["Summarization Utils"]:::utility
        CONF["Configuration"]:::utility
        PROXY["Traefik Proxy"]:::utility
    end

    %% Connections
    MIC --> BUF
    BUF --> RAG
    RAG --> SOCK
    SOCK --> FE
    RAG --> SLACK
    
    %% RAG Internal Connections
    RAG --- QA
    RAG --- BED
    RAG --- SUM
    RAG --- VEC
    
    %% Utility Connections
    CONF -.-> RAG
    CONF -.-> SOCK
    CONF -.-> SLACK
    PROXY -.-> SOCK
    SUMU -.-> SUM

    %% Click Events
    click MIC "https://github.com/blackout-ybigpp/lecture-assist/blob/main/mic.py"
    click FE "https://github.com/blackout-ybigpp/lecture-assist/blob/main/frontend.py"
    click RAG "https://github.com/blackout-ybigpp/lecture-assist/tree/main/RAG"
    click QA "https://github.com/blackout-ybigpp/lecture-assist/blob/main/RAG/rag_qa.py"
    click BED "https://github.com/blackout-ybigpp/lecture-assist/blob/main/RAG/rag_bed.py"
    click SUM "https://github.com/blackout-ybigpp/lecture-assist/blob/main/RAG/sum.py"
    click VEC "https://github.com/blackout-ybigpp/lecture-assist/blob/main/RAG/vector_stt.py"
    click SOCK "https://github.com/blackout-ybigpp/lecture-assist/blob/main/socket-api/main.py"
    click SLACK "https://github.com/blackout-ybigpp/lecture-assist/blob/main/slack_bot/bot_main.py"
    click BUF "https://github.com/blackout-ybigpp/lecture-assist/blob/main/utils/buffer_manager.py"
    click SUMU "https://github.com/blackout-ybigpp/lecture-assist/blob/main/utils/summarize.py"
    click CONF "https://github.com/blackout-ybigpp/lecture-assist/blob/main/config.py"
    click PROXY "https://github.com/blackout-ybigpp/lecture-assist/blob/main/traefik.toml"

    %% Styling
    classDef input fill:#3498db,stroke:#2980b9,stroke-width:2px
    classDef processing fill:#2ecc71,stroke:#27ae60,stroke-width:2px
    classDef integration fill:#e67e22,stroke:#d35400,stroke-width:2px
    classDef utility fill:#95a5a6,stroke:#7f8c8d,stroke-width:2px
    classDef ragcomp fill:#1abc9c,stroke:#16a085,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Processing Components"]:::processing
        L3["Integration Services"]:::integration
        L4["Utility Components"]:::utility
        L5["RAG Subcomponents"]:::ragcomp
    end
```
