# meetjariwala10/insightsage architecture

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

- Interactive diagram: https://gitdiagram.com/meetjariwala10/insightsage
- Repository: https://github.com/meetjariwala10/insightsage

## Overview

##### Project type and purpose
- InsightSage is a Python-based, single‐page web application (Streamlit frontend) that orchestrates an audio processing pipeline and AI services to transcribe meeting recordings, generate summaries and tasks, and send email notifications. It’s essentially a full-stack AI-powered meeting assistant using local file storage and external AI and SMTP services.

##### File structure
- Top-level scripts:
- new_app.py (main Streamlit app)
- audio_transcription.py (transcription logic)
- mp3_to_wav.py (FFmpeg wrapper)
- process_transcripts.py (orchestration & email)
- transcripts_vdb.py (Whisper integration)
- transcripts_ollama.py (Ollama & LangChain integration)
- speaker_recognition.ipynb (speaker diarization exploration)
- Data directories (per README):
- Audio/ (raw uploads)
- WAV_Audio/ (converted)
- TEXT_Transcripts/ (TXT output)
- JSON_Transcripts/ (JSON output)
- Summaries/ (AI summaries)
- Config/build files:
- .env(.example), requirements.txt, ffmpeg-master-…/

##### README for additional insights
- Technology stack: Streamlit (UI), FFmpeg (conversion), Whisper & LangChain + Ollama (AI), SMTP (email).
- Features emphasize a staged pipeline: conversion → transcription → diarization → summarization & task extraction → Q&A → email.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        User["User (Browser)"]:::external
        StreamlitUI["Streamlit UI"]:::ui
    end

    %% Application Orchestration
    subgraph "Application Layer"
        direction TB
        AppEntry["App Entry Point (app.py)"]:::app
        EnvConfig["Env Config (.env/.env.example)"]:::config
        Requirements["Dependencies (requirements.txt)"]:::config
        Readme["Documentation (README.md)"]:::config
        EmailModule["Email Notification Module\n(process_transcripts.py)"]:::processing
    end

    %% Processing Modules
    subgraph "Processing Layer"
        direction TB
        FFmpegConv["FFmpeg Converter\n(mp3_to_wav.py)"]:::processing
        AudioTrans["Audio Transcription\n(audio_transcription.py)"]:::processing
        WhisperTrans["Whisper Transcription\n(transcripts_vdb.py)"]:::processing
        Diarization["Speaker Diarization\n(speaker_recognition.ipynb)"]:::processing
        AIAgent["LangChain & Ollama AI Agent\n(transcripts_ollama.py)"]:::processing
    end

    %% Storage
    subgraph "File Storage" 
        direction TB
        RawAudio["Raw Audio (Audio/)"]:::storage
        WAVAudio["Converted WAV (WAV_Audio/)"]:::storage
        TextTrans["Text Transcripts (TEXT_Transcripts/)"]:::storage
        JsonTrans["JSON Transcripts (JSON_Transcripts/)"]:::storage
        Summaries["Summaries (Summaries/)"]:::storage
    end

    %% External Services
    subgraph "External Services"
        direction TB
        FFmpegCLI["FFmpeg CLI"]:::external
        WhisperModel["Whisper Model"]:::external
        OllamaServer["Ollama Server"]:::external
        SMTPService["Gmail SMTP"]:::external
    end

    %% Data Flows
    User -->|uploads MP3| StreamlitUI
    StreamlitUI -->|invoke converter| FFmpegConv
    FFmpegConv -->|calls CLI| FFmpegCLI
    FFmpegConv -->|outputs WAV| WAVAudio

    StreamlitUI -->|invoke transcription| AudioTrans
    AudioTrans -->|uses transcription logic| WhisperTrans
    WhisperTrans -->|calls model| WhisperModel
    WhisperTrans -->|outputs TXT| TextTrans
    WhisperTrans -->|outputs JSON| JsonTrans

    WhisperTrans -->|optional diarization| Diarization
    Diarization -->|writes JSON| JsonTrans

    StreamlitUI -->|invoke AI agent| AIAgent
    AIAgent -->|calls Ollama| OllamaServer
    AIAgent -->|outputs summary| Summaries

    StreamlitUI -->|display transcripts & summaries| StreamlitUI

    StreamlitUI -->|send tasks| EmailModule
    EmailModule -->|via SMTP| SMTPService

    %% Config and Docs Links
    StreamlitUI --> AppEntry
    StreamlitUI --> EnvConfig
    StreamlitUI --> Requirements
    StreamlitUI --> Readme

    %% Click Events
    click StreamlitUI "https://github.com/meetjariwala10/insightsage/blob/main/new_app.py"
    click FFmpegConv "https://github.com/meetjariwala10/insightsage/blob/main/mp3_to_wav.py"
    click AudioTrans "https://github.com/meetjariwala10/insightsage/blob/main/audio_transcription.py"
    click WhisperTrans "https://github.com/meetjariwala10/insightsage/blob/main/transcripts_vdb.py"
    click AIAgent "https://github.com/meetjariwala10/insightsage/blob/main/transcripts_ollama.py"
    click Diarization "https://github.com/meetjariwala10/insightsage/blob/main/speaker_recognition.ipynb"
    click EmailModule "https://github.com/meetjariwala10/insightsage/blob/main/process_transcripts.py"
    click AppEntry "https://github.com/meetjariwala10/insightsage/blob/main/app.py"
    click EnvConfig "https://github.com/meetjariwala10/insightsage/blob/main/.env"
    click Requirements "https://github.com/meetjariwala10/insightsage/blob/main/requirements.txt"
    click Readme "https://github.com/meetjariwala10/insightsage/blob/main/README.md"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#005B96,color:#005B96;
    classDef processing fill:#E6F4EA,stroke:#2E7D32,color:#2E7D32;
    classDef storage fill:#FFF4E5,stroke:#F57C00,color:#E65100,stroke-dasharray: 5 2;
    classDef external fill:#F3E5F5,stroke:#6A1B9A,color:#4A148C;
    classDef app fill:#E8EAF6,stroke:#3949AB,color:#1A237E;
    classDef config fill:#F0F0F0,stroke:#9E9E9E,color:#616161;
```
