# komalvardhanl-hexaware/docuchat-pro architecture

> Architecture diagram of the GitHub repository komalvardhanl-hexaware/docuchat-pro, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/komalvardhanl-hexaware/docuchat-pro
- Repository: https://github.com/komalvardhanl-hexaware/docuchat-pro

## Overview

##### Project type and purpose
- This is a full-stack Retrieval-Augmented Generation (RAG) document chat application written in Python.
- Users upload PDF, text, Excel, CSV or SQL files; the app ingests them into a FAISS vector store; at query time, it retrieves relevant chunks and uses Azure OpenAI to generate answers; it also sends traces to Arize Phoenix.

##### File structure
- Top-level files:
- docs_reader.py: document parsers and vector-store loader
- feature1.py: experimental feature or pipeline extension
- test.py: functional or integration tests
- test.pbix: Power BI file for reporting or demo
- requirements.txt: dependency list (streamlit, faiss-cpu, azure-ai, arize, etc.)
- .gitignore, README.md
- README references a ui/streamlit_app.py, so assume a ui folder contains the Streamlit front end.
- Missing config placeholders: .env for Azure keys and Arize credentials.

##### README for additional insights
- The architecture involves:
- Streamlit front-end
- Document ingestion pipelines (docs_reader)
- FAISS vector store for retrieval
- Azure OpenAI service for generation
- Arize Phoenix for tracing/evaluation

##### Final advice
- Essential elements—don’t omit the ingestion pipeline, FAISS store, or tracing agent.
- Keep it detailed but avoid unnecessary sub-subcomponents; focus on the seven or eight major blocks above.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    User["User"]:::actor
    User -->|"interacts with"| UI

    %% UI Layer
    UI["Streamlit UI"]:::ui
    click UI "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/ui/streamlit_app.py"

    UI -->|"upload documents / send queries"| Ingestion
    UI -->|"query retrieval"| Retrieval

    %% Backend Pipeline
    subgraph "Backend Services"
        Ingestion["Ingestion & Embedding Service"]:::backend
        click Ingestion "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/docs_reader.py"
        Feature["Experimental Feature / Pipeline Extension"]:::backend
        click Feature "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/feature1.py"
        Retrieval["Retrieval Service"]:::backend
        FAISS[(FAISS Vector Store)]:::datastore
        Azure["Azure OpenAI API"]:::external
    end

    Ingestion -->|"parses & embeds"| FAISS
    Feature -->|"optional pipeline extension"| FAISS
    Retrieval -->|"fetch top-k chunks"| FAISS
    Retrieval -->|"send prompt + chunks"| Azure
    Azure -->|"return generated answer"| UI

    %% Monitoring & Tracing
    subgraph "Monitoring & Tracing"
        Arize["Arize Phoenix"]:::external
    end

    Ingestion -->|"_ trace data _"| Arize
    Retrieval -->|"_ trace data _"| Arize
    Azure -->|"_ trace data _"| Arize
    UI -->|"_ trace data _"| Arize

    %% Configuration
    Config["Configuration Store (.env)"]:::config

    %% Documentation & Tools
    subgraph "Project Docs & Tools"
        README["README.md"]:::docs
        click README "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/README.md"
        Requirements["requirements.txt"]:::docs
        click Requirements "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/requirements.txt"
        TestHarness["Test Harness / Integration Tests"]:::docs
        click TestHarness "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/test.py"
        Dashboard["Reporting / Demo Dashboard"]:::docs
        click Dashboard "https://github.com/komalvardhanl-hexaware/docuchat-pro/blob/main/test.pbix"
    end

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0366D6,color:#0366D6,stroke-width:2px;
    classDef backend fill:#DFF0D8,stroke:#3C763D,color:#3C763D,stroke-width:2px;
    classDef external fill:#FFF0D0,stroke:#D48806,color:#D48806,stroke-width:2px;
    classDef datastore fill:#F0DFFF,stroke:#6A1B9A,color:#6A1B9A,stroke-width:2px;
    classDef config fill:#F2F2F2,stroke:#999999,color:#333333,stroke-width:2px,stroke-dasharray: 5 5;
    classDef docs fill:#E8E8E8,stroke:#333333,color:#333333,stroke-width:2px;
    classDef actor fill:#FFFFFF,stroke:#000000,color:#000000,stroke-width:2px,stroke-dasharray: 2 2;
```
