# mohammedmahboob786/movierag architecture

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

- Interactive diagram: https://gitdiagram.com/mohammedmahboob786/movierag
- Repository: https://github.com/mohammedmahboob786/movierag

## Overview

##### Project type and purpose
- This is a retrieval-augmented movie identification application (“MovieRAG”) that ingests audio clips, converts them to text, and uses vector-based similarity search over a prebuilt movie/TV series corpus to identify the source.
- It is organized as a three-stage pipeline: Data Preprocessing, Indexing, and Application (the RAG service exposed via Streamlit).

##### File structure
- Top level:
- Data_Preprocessing)Project_4_Db_retireval.ipynb – notebook for raw data cleaning/extraction
- Indexing)Project_4_Db_retrieval.ipynb – notebook for splitting text, generating embeddings, and persisting them
- RAG_app(using gte-small embeddings).py – the Streamlit-based application code
- README.md – high-level overview and workflow
- Absence of separate frontend/backend folders indicates a single-service Python deployment (Streamlit as both UI and orchestration).

##### README for additional insights
- Describes three phases (preprocessing, indexing, application).
- Lists core technologies: Whisper for ASR, BeautifulSoup & regex for cleaning, LangChain for loaders/chunkers/chains, Hugging Face BERT (“thenlper/gte-small”) for embeddings, ChromaDB for vector storage, and Streamlit for UI.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Offline Pipeline
    subgraph "Offline Pipeline"
        direction TB
        RawCSV["Raw Data CSV Files"]:::external
        DataPre["Data Preprocessing Module"]:::offline
        CleanCSV["Clean Text Corpus CSV"]:::parallelogram
        IndexMod["Indexing Module"]:::offline
        VectorStore["ChromaDB Vector Store"]:::db
        RawCSV -->|"reads"| DataPre
        DataPre -->|"outputs"| CleanCSV
        CleanCSV -->|"consumed by"| IndexMod
        IndexMod -->|"stores embeddings in"| VectorStore
    end

    %% Online Service
    subgraph "Online Service (RAG App)"
        direction TB
        UserAudio["User Audio Input"]:::parallelogram
        WhisperASR["Whisper ASR Model"]:::online
        OnlineEmbed["Embedding Generator (gte-small)"]:::online
        QueryDB["ChromaDB Query Service"]:::db
        LLMChain["LLM Chain for Movie ID"]:::online
        StreamlitUI["Streamlit UI"]:::online
        UserAudio -->|"audio file"| WhisperASR
        WhisperASR -->|"transcript text"| OnlineEmbed
        OnlineEmbed -->|"query vectors"| QueryDB
        QueryDB -->|"top chunks"| LLMChain
        LLMChain -->|"movie/series name"| StreamlitUI
    end

    %% External Services
    subgraph "External Services"
        direction TB
        HFModel["Hugging Face Model Hosting"]:::external
        HFModel -.-> WhisperASR
        HFModel -.-> OnlineEmbed
    end

    %% Documentation
    README["Project Overview (README.md)"]:::external

    %% Connections
    README --> OfflinePipeline
    README --> OnlineService

    %% Click Events
    click DataPre "https://github.com/mohammedmahboob786/movierag/blob/main/Data_Preprocessing)Project_4_Db_retireval.ipynb"
    click IndexMod "https://github.com/mohammedmahboob786/movierag/blob/main/Indexing)Project_4_Db_retrieval.ipynb"
    click StreamlitUI "https://github.com/mohammedmahboob786/movierag/blob/main/RAG_app(using gte-small embeddings).py"
    click README "https://github.com/mohammedmahboob786/movierag/blob/main/README.md"

    %% Styles
    classDef offline fill:#cce5ff,stroke:#004085,color:#004085;
    classDef online fill:#d4edda,stroke:#155724,color:#155724;
    classDef db fill:#fff3cd,stroke:#856404,color:#856404;
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24;
    classDef parallelogram shape:parallelogram;
```
