# ravikiran10jan/dealsense-ai architecture

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

- Interactive diagram: https://gitdiagram.com/ravikiran10jan/dealsense-ai
- Repository: https://github.com/ravikiran10jan/dealsense-ai

## Overview

##### Project type and purpose
- This is a full-stack, cloud-native AI application (“DealSense AI – Sales Assist Agent”) built to ingest meeting notes, process them through a Retrieval-Augmented Generation (RAG) pipeline, and present insights to sales reps via a web UI/Teams tab.
- The README’s “Architecture Overview” table maps each pipeline step to Azure services, confirming a serverless + containerized design on Azure, with a React-based front end.

##### File structure
- Top level:
- backend/         ← Python code for ingestion, vector store, LLM orchestration, HTTP API
- ui/seller_panel/← React/Vite UI served as Static Web App or Teams tab
- infra/terraform/← IaC definitions (Azure resources)
- docs/            ← Architecture and run instructions
- requirements.txt ← Python dependencies
- backend/ subdirectories:
- ingestion/      ← PPTX/text loaders, chunker, vector store client
- llm/            ← LLM client, answer logic
- orchestration/  ← Hybrid RAG answer orchestration
- retrieval/      ← Semantic & web search modules
- vector_store/   ← Local FAISS store (for mock/testing)
- data/           ← Sample docs, transcripts
- api.py, main.py ← Entrypoints for Azure Function/API Web App
- ui/seller_panel/: React components arranged by feature (BeforeCall, DuringCall, AfterCall, ChatPanel), with a Node-based dev server (server.js) and static build (index.html).

##### Verify README insights
- Explicit Azure service mapping:
- SharePoint input → MS Graph API
- Timer-triggered ingestion → Azure Function
- Raw storage → Azure Blob
- Sanitization & chunking → Azure Container App in VNet
- Embeddings + Vector DB → Azure OpenAI + Azure Cognitive Search (vector index)
- RAG retrieval → Azure Function or API App
- Reasoning → Azure OpenAI GPT-4.x
- UI → Static Web App or Teams tab
- Write-back → Graph API → SharePoint
- Confirms a decoupled, serverless event-driven pipeline with isolated processing stages.

##### Components and their relationships
a. Main components:
1. Client/UI (React Static Web App / Teams Tab)
2. API Layer (Azure Function / API App – “backend/api.py”)
3. Ingestion Pipeline:
- SharePoint connector (Graph API call)
- Blob Storage (raw docs)
- Sanitization container (PII removal)
- Chunking & vector store loader
4. Vector Store (Azure Cognitive Search vector index)
5. RAG Orchestrator (Azure Function / orchestration/hybrid_answer.py)
6. LLM Service (Azure OpenAI GPT & Embeddings)
7. Post-call services (MoM generator + SharePoint writer)
8. Terraform Infra (defines all Azure resources)
b. Interactions & data flow:
- UI ↔ API Layer: user requests, chat messages, configuration
- API → Ingestion trigger (on schedule or manual): fetch docs, push to Blob
- Blob → Container App (sanitization & chunking) → calls Embedding API → stores vectors
- API / RAG Orchestrator → queries Vector Store → invokes Azure OpenAI → aggregates responses
- MoM Gen → writes back via Graph API
c. Architectural patterns:
- Serverless functions for stateless logic (Ingestion, Retrieval)
- Containerized micro-service for heavy processing (PII redaction, chunking)
- Event-driven pipelines: Blob triggers or timer triggers
- RAG pattern: vector search + LLM prompt chaining
- Clear separation of concerns between ingestion, storage, retrieval, reasoning, and UI.
d. Key technologies:
- Python Azure Functions & Container Apps
- Azure Blob Storage, Azure Cognitive Search (vector)
- Azure OpenAI (Embeddings + GPT-4.x)
- React + Vite for UI
- Terraform for IaC
- FAISS (local test store)

##### Detailed breakdown
2. Ingestion Function → “Raw Blob Storage”
5. Post-call MoM: API Function → “MoM Generator” → “Graph API → SharePoint”
6. At bottom: “Terraform” block managing all Azure resources

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems
    subgraph "External Systems"
        SP["SharePoint"]:::external
        GraphAPI["Graph API"]:::external
        OpenAI["Azure OpenAI"]:::external
    end

    %% Ingestion Pipeline
    subgraph "Ingestion Pipeline"
        IngestFn["Ingestion Function\n(Timer Trigger)"]:::compute
        RawBlob["Raw Blob Storage"]:::storage
        ContainerApp["Sanitization & Chunking\nContainer App"]:::compute
        PPTX["PPTX Loader"]:::compute
        Chunker["Text Chunker"]:::compute
        VSClient["Vector Store Client"]:::compute
        CogSearch["Azure Cognitive Search\n(Vector Index)"]:::storage
        FAISS["Local FAISS Store"]:::storage
    end

    %% Request Pipeline
    subgraph "Request Pipeline"
        UIFn["API Function / App"]:::compute
        Orchestrator["RAG Orchestrator"]:::compute
        COGSearch2["Azure Cognitive Search\n(Vector Index)"]:::storage
        GPT["Azure OpenAI GPT-4"]:::external
    end

    %% Frontend Layer
    subgraph "Frontend Layer"
        UI["React Static Web App / Teams Tab"]:::ui
    end

    %% Post-call Services
    subgraph "Post-call Services"
        MoM["MoM Generator"]:::compute
    end

    %% Terraform IaC
    Terraform["Terraform IaC"]:::infra

    %% Connections: Ingestion Flow
    SP -->|"Graph API"| IngestFn
    IngestFn -->|Store docs| RawBlob
    RawBlob -.blob trigger.-> ContainerApp
    ContainerApp --> PPTX
    ContainerApp --> Chunker
    ContainerApp --> VSClient
    VSClient --> CogSearch
    ContainerApp -->|Test store| FAISS
    ContainerApp -->|Call Embeddings| OpenAI

    %% Connections: Request Flow
    UI <--->|API calls| UIFn
    UIFn --> Orchestrator
    Orchestrator --> COGSearch2
    Orchestrator --> GPT
    GPT --> Orchestrator
    Orchestrator --> UIFn
    UIFn --> COGSearch2
    COGSearch2 --> UIFn
    UIFn -->|"Generate MoM"| MoM
    MoM -->|"Graph API"| SP

    %% Terraform management
    Terraform -.manages.-> IngestFn
    Terraform -.manages.-> ContainerApp
    Terraform -.manages.-> RawBlob
    Terraform -.manages.-> CogSearch
    Terraform -.manages.-> UIFn
    Terraform -.manages.-> MoM

    %% Click Events
    click UI "https://github.com/ravikiran10jan/dealsense-ai/tree/main/ui/seller_panel/"
    click UIFn "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/api.py"
    click IngestFn "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/main.py"
    click PPTX "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/ingestion/pptx_loader.py"
    click Chunker "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/ingestion/text_chunker.py"
    click VSClient "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/ingestion/vector_store.py"
    click Orchestrator "https://github.com/ravikiran10jan/dealsense-ai/blob/main/backend/orchestration/hybrid_answer.py"
    click FAISS "https://github.com/ravikiran10jan/dealsense-ai/tree/main/backend/vector_store/dealsense_faiss/"
    click Terraform "https://github.com/ravikiran10jan/dealsense-ai/tree/main/infra/terraform/"

    %% Styles
    classDef compute fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef storage fill:#ffebcc,stroke:#333,stroke-width:1px
    classDef external fill:#d4edda,stroke:#333,stroke-width:1px
    classDef ui fill:#e5ccff,stroke:#333,stroke-width:1px
    classDef infra fill:#f2f2f2,stroke:#333,stroke-width:1px
```
