# chiragandai/summereyes architecture

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

- Interactive diagram: https://gitdiagram.com/chiragandai/summereyes
- Repository: https://github.com/chiragandai/summereyes

## Overview

##### Project Type and Purpose
- It uses Streamlit for the frontend UI, Whisper for speech-to-text, LangChain + FAISS for Retrieval-Augmented Generation (RAG), and an LLM (LLaMA 4 via Groq) for summarization.
- Purpose: let users upload PDFs or speak into the app, retrieve relevant context from a local FAISS index, and generate concise summaries.

##### File Structure
- Top-level directories:
- BackEnd/ – pdf_utils.py (extract text from PDFs)
speechtotext.py (wraps Whisper)
- FrontEnd/ – app.py (Streamlit UI entrypoint)
“we are in a pickle.py” (likely additional UI logic or helpers)
- SummerEyes_local_db/ – index.faiss & index.pkl (persistent FAISS vector store)
- requirements.txt – dependencies
- README.md – project overview
- No separate database server; FAISS files live locally. Deployment is via Streamlit Cloud, inferred from README.

##### README for Additional Insights
- Workflow described: voice → Whisper → transcript; PDF upload → pdf_utils → raw text → chunking → FAISS embedding → retrieval; pass retrieved context + user input to LLaMA for summarization.
- Tech stack confirmed: Streamlit, Whisper, LLaMA 4, Groq, LangChain, FAISS.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users
    User["User"]:::user

    %% Frontend Layer
    subgraph "Streamlit Frontend"
        UI["Streamlit UI"]:::frontend
        Pickle["UI Helpers/Additional Logic"]:::frontend
    end

    %% Backend Processing Services
    subgraph "Backend Services"
        PDF["PDF Processing Service"]:::service
        Speech["Speech Processing Service (Whisper)"]:::service
        RAG["LangChain RAG Orchestrator"]:::service
    end

    %% Vector Store
    subgraph "Local Vector Store"
        FAISSFiles["FAISS Index Files"]:::storage
        Pkl["FAISS Metadata (.pkl)"]:::storage
        Persistence["Local Persistence Directory"]:::storage
    end

    %% LLM Inference
    subgraph "External LLM Inference"
        LLM["LLaMA4 Inference (Groq)"]:::external
    end

    %% Documentation
    subgraph "Project Docs"
        Req["Project Dependencies"]:::doc
        RD["Project Overview Documentation"]:::doc
    end

    %% Data Flow
    User -->|"interacts with"| UI
    UI -->|"upload PDF"| PDF
    UI -->|"audio input"| Speech
    PDF -->|"extracted text"| RAG
    Speech -->|"transcript"| RAG
    RAG -->|"query embeddings"| FAISSFiles
    RAG -->|"query metadata"| Pkl
    FAISSFiles -->|"vectors"| RAG
    Pkl -->|"metadata"| RAG
    RAG -->|"retrieved context"| LLM
    LLM -->|"summary"| UI
    UI -->|"update index"| Persistence

    %% Click Events
    click UI "https://github.com/chiragandai/summereyes/blob/main/FrontEnd/app.py"
    click Pickle "https://github.com/chiragandai/summereyes/blob/main/FrontEnd/we are in a pickle.py"
    click PDF "https://github.com/chiragandai/summereyes/blob/main/BackEnd/pdf_utils.py"
    click Speech "https://github.com/chiragandai/summereyes/blob/main/BackEnd/speechtotext.py"
    click FAISSFiles "https://github.com/chiragandai/summereyes/blob/main/SummerEyes_local_db/index.faiss"
    click Pkl "https://github.com/chiragandai/summereyes/blob/main/SummerEyes_local_db/index.pkl"
    click Persistence "https://github.com/chiragandai/summereyes/tree/main/SummerEyes_local_db/"
    click Req "https://github.com/chiragandai/summereyes/blob/main/requirements.txt"
    click RD "https://github.com/chiragandai/summereyes/blob/main/README.md"

    %% Styles
    classDef frontend fill:#87CEEB,stroke:#333,stroke-width:1px
    classDef service fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef storage fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFD700,stroke:#333,stroke-width:1px
    classDef user fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef doc fill:#FFB6C1,stroke:#333,stroke-width:1px
```
