# sairohit022001/rag-powered-event-bot architecture

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

- Interactive diagram: https://gitdiagram.com/sairohit022001/rag-powered-event-bot
- Repository: https://github.com/sairohit022001/rag-powered-event-bot

## Overview

##### Project Type and Purpose
- This is a full-stack, single-page Streamlit application (“RAG Powered Event Bot”) that presents an interactive dashboard for a workshop: agenda display, participant matching, session recommendations, venue info, lunch countdown, conversational feedback, and a generative AI assistant.
- It combines UI (Streamlit) + business-logic modules + a Retrieval-Augmented Generation (RAG) pipeline (Faiss vector store + OpenAI LLM).

##### File Structure
- All files live at the project root—no nested services—indicating a monolithic architecture.
- app.py
- Orchestrates the Streamlit UI and routes to feature modules.
- agenda.py, matching.py, recommendations.py, directions.py, lunch_timer.py, feedback.py
- Each implements one feature.
- rag_agent.py
- Encapsulates the RAG workflow: vector store queries + LLM calls.
- requirements.txt / runtime.txt
- Lists dependencies (streamlit, pdfplumber, faiss-cpu, openai, langchain, pyngrok).

##### Extract Insights from the README
- “Retrieval-Augmented Generation” implies: user inputs → embedding lookup in Faiss → prompt construction → OpenAI LLM → response.
- Features map one-to-one to Python modules.
- Uses PDF parsing (pdfplumber) for any static documents.

##### Main Components & Their Interactions
a. UI Layer (Streamlit App)
- Component: app.py + Streamlit UI widgets
b. Feature Modules (Business Logic)
- Subcomponents (Green rectangles):
- Agenda Service (agenda.py)
- Matching Service (matching.py)
- Recommendation Service (recommendations.py)
- Directions Service (directions.py)
- Timer Service (lunch_timer.py)
- Feedback Service (feedback.py)
- Assistant Service (assistant logic via rag_agent.py)
c. RAG Agent
- Central orchestrator (Yellow rectangle):
- Connects to Faiss vector store for similarity search
- Calls OpenAI API (Embeddings + ChatCompletion)
- Uses LangChain abstractions
d. Data Layer
- Event agenda data (could be JSON/CSV/PDF)
- Session metadata (keywords)
- Uploaded resumes (for matching)
- Vector Store (Faiss index)
e. External Services (Gray clouds):
- OpenAI API
- Optional: ngrok (pyngrok) for local tunneling

##### Relationships & Data Flows
1. User → Streamlit UI (app.py)
2. UI → Selected Feature Module
- e.g., click “Match Participants” → matching.py
3. Feature Module → rag_agent (if it needs retrieval or generation) OR direct data source
- matching.py calls rag_agent to embed resumes + query Faiss
- recommendations.py may do keyword match in-memory or via simple lookups
- feedback.py & assistant use rag_agent → OpenAI
4. rag_agent → Faiss Vector Store → returns top-k documents or embeddings
5. rag_agent → OpenAI ChatCompletion → returns conversational response
6. Module → UI → displays results

##### Important Architectural Patterns / Principles
- Separation of Concerns: UI vs. Business Logic vs. Data Access.
- Modular feature services for each dashboard capability.
- RAG pipeline decoupled as its own component.
- Single monolith but logically layered.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        UI["Streamlit App (app.py)"]:::ui
    end

    %% Business Logic Services
    subgraph "Business Logic Services"
        Agenda["Agenda Service (agenda.py)"]:::service
        Matching["Matching Service (matching.py)"]:::service
        Recommendation["Recommendation Service (recommendations.py)"]:::service
        Directions["Directions Service (directions.py)"]:::service
        Timer["Lunch Timer Service (lunch_timer.py)"]:::service
        Feedback["Feedback Service (feedback.py)"]:::service
    end

    %% RAG Orchestrator
    RAG["RAG Agent (rag_agent.py)"]:::rag

    %% Data Layer
    subgraph "Data Layer"
        StaticData["Static Event Data (JSON/CSV/PDF)"]:::data
        VectorStore["Faiss Vector Store"]:::data
    end

    %% External Services
    OpenAI["OpenAI API"]:::external
    Ngrok["ngrok (pyngrok)"]:::external

    %% Documentation & Config
    subgraph "Documentation & Config"
        README["README.md"]:::doc
        Req["requirements.txt"]:::doc
        Runtime["runtime.txt"]:::doc
        Notebook["RAG_POWERED_EVENT_ASSISTANT.ipynb"]:::doc
    end

    %% Connections
    UI -->|"route to Agenda"| Agenda
    UI -->|"route to Matching"| Matching
    UI -->|"route to Recommendations"| Recommendation
    UI -->|"route to Directions"| Directions
    UI -->|"route to Lunch Timer"| Timer
    UI -->|"route to Feedback"| Feedback
    UI -->|"route to AI Assistant"| RAG

    Agenda -->|"load PDF"| StaticData
    Recommendation -->|"lookup sessions"| StaticData
    Directions -->|"lookup venues"| StaticData
    Timer -->|"countdown logic"| StaticData

    Matching -->|"embed & search"| RAG
    Feedback -->|"conversational feedback"| RAG

    RAG -->|"search index"| VectorStore
    RAG -->|"ChatCompletion"| OpenAI

    Ngrok -->|"tunnel to UI"| UI

    %% Click Events
    click UI "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/app.py"
    click Agenda "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/agenda.py"
    click Matching "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/matching.py"
    click Recommendation "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/recommendations.py"
    click Directions "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/directions.py"
    click Timer "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/lunch_timer.py"
    click Feedback "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/feedback.py"
    click RAG "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/rag_agent.py"
    click README "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/README.md"
    click Req "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/requirements.txt"
    click Runtime "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/runtime.txt"
    click Notebook "https://github.com/sairohit022001/rag-powered-event-bot/blob/main/RAG_POWERED_EVENT_ASSISTANT.ipynb"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366D6;
    classDef service fill:#E2F7E1,stroke:#2D7A2D;
    classDef rag fill:#FFF4B2,stroke:#D6A700;
    classDef data fill:#FFE5CC,stroke:#D97706,shape:cylinder;
    classDef external fill:#F0F0F0,stroke:#666666,shape:cloud;
    classDef doc fill:#F5F5F5,stroke:#999999,stroke-dasharray: 2 2;
```
