# sayedalihassaan/vector_database_qdrant-semantic architecture

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

- Interactive diagram: https://gitdiagram.com/sayedalihassaan/vector_database_qdrant-semantic
- Repository: https://github.com/sayedalihassaan/vector_database_qdrant-semantic

## Overview

##### Project type and purpose
- This is a backend‐only Python service (an open-source tool) that implements a semantic search engine.
- It reads text data (e.g. articles), generates embeddings via a configurable model, and stores/queries vectors in a Qdrant vector database.

##### File structure
- Top level:
- Backend.py – the API/CLI entrypoint
- temp.py – scratch/testing script
- .env.example, requirements.txt – environment and dependencies
- src/
- config.py – loads env vars and global settings
- notebooks/ – Jupyter notebooks for data-prep and exploration
- services/ – core modules:
– EmbeddingModel.py (encapsulates the embedding provider)
– VectorDBClient.py (high-level interface for upsert/search)
– QdrantClient.py (low-level wrapper around the Qdrant REST/gRPC API)

##### README
- Confirms the purpose: “Semantic Search Engine using qdrant as a vector database.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% API Layer
    subgraph "API/Service Layer"
        API["Backend.py"]:::api
    end

    %% Configuration Module
    subgraph "Configuration Module"
        Config["config.py"]:::config
    end

    %% Service Layer
    subgraph "Embedding Service"
        Embedding["EmbeddingModel.py"]:::service
    end

    %% Vector DB Layer
    subgraph "Vector DB Layer"
        VectorDB["VectorDBClient.py"]:::service
        Qdrant["QdrantClient.py"]:::service
    end

    %% Offline Data Analysis
    subgraph "Offline Data Analysis"
        Notebooks["Jupyter Notebooks"]:::offline
        SampleData["articles_new.csv"]:::offline
    end

    %% Project Files
    subgraph "Project Files"
        Env[".env.example"]:::files
        Req["requirements.txt"]:::files
    end

    %% External Services
    subgraph "External Services"
        EmbProvider["Embedding Provider"]:::external
        QdrantServer["Qdrant Server"]:::external
    end

    %% Data Flows
    API -->|"reads config"| Config
    API -->|"text input"| Embedding
    Config -->|"env vars"| Env
    Config -->|"dependencies"| Req
    Config --> Embedding
    Embedding -->|"request embedding"| EmbProvider
    EmbProvider -->|"returns vector"| Embedding
    Embedding -->|"embeddings"| VectorDB
    VectorDB -->|"delegates"| Qdrant
    Qdrant -->|"vector search"| QdrantServer
    QdrantServer -->|"results"| Qdrant
    Qdrant -->|"search results"| VectorDB
    VectorDB -->|"returns results"| API

    Notebooks --> SampleData

    %% Click Events
    click API "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/Backend.py"
    click Config "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/src/config.py"
    click Embedding "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/src/services/EmbeddingModel.py"
    click VectorDB "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/src/services/VectorDBClient.py"
    click Qdrant "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/src/services/QdrantClient.py"
    click Notebooks "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/tree/main/src/notebooks/"
    click SampleData "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/src/notebooks/data/articles_new.csv"
    click Env "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/.env.example"
    click Req "https://github.com/sayedalihassaan/vector_database_qdrant-semantic/blob/main/requirements.txt"

    %% Styles
    classDef api fill:#f9f,stroke:#333,stroke-width:1px;
    classDef config fill:#bbf,stroke:#333,stroke-width:1px;
    classDef service fill:#bfb,stroke:#333,stroke-width:1px;
    classDef files fill:#fff2cc,stroke:#333,stroke-width:1px;
    classDef offline fill:#ffe,stroke:#333,stroke-width:1px;
    classDef external fill:#ffb,stroke:#333,stroke-width:1px;
```
