# apoorvvats181/ai-powered-book-recommendation-engine architecture

> Architecture diagram of the GitHub repository apoorvvats181/ai-powered-book-recommendation-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apoorvvats181/ai-powered-book-recommendation-engine
- Repository: https://github.com/apoorvvats181/ai-powered-book-recommendation-engine

## Overview

##### Project type and purpose
- This is a data‑driven, full‑stack book recommendation engine.
- It ingests cleaned book metadata (CSV files), performs NLP pipelines (classification, sentiment analysis, embeddings), stores vector representations in ChromaDB, and exposes an interactive Gradio dashboard for end users.

##### File structure
- Top‑level data files (books_cleaned.csv, books_with_categories.csv, books_with_emotions.csv) indicate an ETL/data‑prep stage.
- Multiple Jupyter notebooks (data‑exploration.ipynb, sentiment‑analysis.ipynb, text‑classification.ipynb, vector‑search.ipynb) show step‑by‑step pipeline development.
- gradio-dashboard.py is the entry point for the UI service.
- tag_descriptor.txt suggests token‑level tagging or additional metadata for classification.

##### README for extra insights
- Core ML components: OpenAI embeddings, Hugging Face BART (zero‑shot classification), RoBERTa (sentiment).
- Vector DB: ChromaDB.
- Framework: LangChain orchestrates searches and chaining model calls.
- UI: Gradio serves the front‑end interface.

##### Final advice
– Capture every pipeline stage as its own component, even if implemented in notebooks.
– Emphasize the orchestration role of LangChain between UI and ML modules.
– Don’t omit the vector database – it’s central to the semantic search capability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    subgraph "Data Preparation" 
        direction TB
        A1["books_cleaned.csv"]:::data
        A2["books_with_categories.csv"]:::data
        A3["books_with_emotions.csv"]:::data
        A4["data-exploration.ipynb"]:::data
    end

    %% ML Pipeline
    subgraph "ML Pipeline"
        direction TB
        B1["Zero-shot Categorization (BART)"]:::ml
        B2["Sentiment Analysis (RoBERTa)"]:::ml
        B3["Embedding Generation (OpenAI)"]:::ml
    end

    %% Storage
    subgraph "Vector Store"
        direction TB
        C1[(ChromaDB)]:::storage
    end

    %% Application & UI
    subgraph "Application & UI"
        direction TB
        D1["LangChain Orchestrator"]:::service
        D2["Gradio Dashboard"]:::service
    end

    %% External Services
    E1["OpenAI API"]:::external
    E2["Hugging Face Models"]:::external

    %% Data Flow
    A1 --> A4
    A2 --> A4
    A3 --> A4
    A4 --> B1
    A4 --> B2
    A4 --> B3

    %% ML to External
    B1 -.-> E2
    B2 -.-> E2
    B3 -.-> E1

    %% ML to Storage
    B3 --> C1

    %% UI and Orchestration
    D2 --> D1
    D1 --> B1
    D1 --> B2
    D1 --> B3
    D1 --> C1
    C1 --> D1
    D1 --> D2

    %% Click Events
    click A1 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/books_cleaned.csv"
    click A2 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/books_with_categories.csv"
    click A3 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/books_with_emotions.csv"
    click A4 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/data-exploration.ipynb"
    click B1 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/text-classification.ipynb"
    click B1 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/tag_descriptor.txt"
    click B2 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/sentiment-analysis.ipynb"
    click B3 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/vector-search.ipynb"
    click C1 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/vector-search.ipynb"
    click D1 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/vector-search.ipynb"
    click D2 "https://github.com/apoorvvats181/ai-powered-book-recommendation-engine/blob/main/gradio-dashboard.py"
    click README["README.md"] "README.md"
    click GITIGNORE[".gitignore"] ".gitignore"
    click DSSTORE[".DS_Store"] ".DS_Store"

    %% Styles
    classDef data fill:#cce5ff,stroke:#1f78b4,color:#000;
    classDef ml fill:#d4edda,stroke:#28a745,color:#000;
    classDef storage fill:#fff3cd,stroke:#fd7e14,color:#000;
    classDef service fill:#e2e3e5,stroke:#6c757d,color:#000;
    classDef external fill:#f8f9fa,stroke:#6c757d,stroke-dasharray:5 5,color:#000;
```
