Skip to content

An advanced vector search system that demonstrates multiple approaches to semantic search and retrieval

Notifications You must be signed in to change notification settings

MHHamdan/VectorSphere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ VectorSphere: Scalable AI-Powered Vector Search System

VectorSphere Logo

πŸ“Œ Overview

VectorSphere is a high-performance AI-powered vector search system designed for semantic search and retrieval at scale. It integrates multiple embedding models, advanced vector search algorithms, and retrieval techniques, making it ideal for recommendation systems, intelligent search, and knowledge retrieval.


✨ Key Features

πŸ”Ή Multi-Model Embedding Pipeline

  • βœ… Supports multiple embedding models: SentenceTransformers, OpenAI, Hugging Face, Custom Fine-tuned Models
  • βœ… Optimized embedding caching for efficiency
  • βœ… Supports fine-tuning models for domain-specific embeddings

πŸ”Ή Scalable Vector Search Implementation

  • βœ… HNSW algorithm for fast approximate nearest neighbor search
  • βœ… FAISS-based indexing for scalable retrieval
  • βœ… Hybrid Search (BM25 + Vector Similarity) for improved results

πŸ”Ή Advanced Retrieval System

  • βœ… Combines BM25 text search with vector similarity
  • βœ… Re-ranking pipeline to refine search results
  • βœ… Retrieval-Augmented Generation (RAG) using LLMs

πŸ”Ή Production-Ready Infrastructure

  • βœ… MLOps pipeline for model deployment & monitoring
  • βœ… Observability with Prometheus & Grafana
  • βœ… Performance benchmarking tools

βš™οΈ Technical Architecture

VectorSphere follows a modular and scalable architecture:

πŸ“Œ Core Components

πŸ”Ή Embedding Service

  • Multiple embedding model support (SentenceTransformers, OpenAI, Custom Models)
  • Fine-tuning pipeline for adapting embeddings to specific domains
  • Caching and optimization for efficient query processing

πŸ”Ή Vector Storage & Search

  • Primary: Weaviate integration for scalable vector storage
  • Secondary: FAISS for rapid prototyping and experimentation
  • Hybrid: PGVector for vector storage inside PostgreSQL

πŸ”Ή Retrieval System

  • Hybrid search: combines traditional BM25 text search with vector similarity
  • Re-ranking pipeline: uses AI models to improve search relevance
  • Retrieval-Augmented Generation (RAG) with LLM backends

πŸ”Ή API Layer

  • Built with FastAPI for high-performance APIs
  • Async support for handling high-load requests
  • Security mechanisms (rate limiting, authentication)

πŸ”Ή MLOps Pipeline

  • Containerized using Docker
  • Kubeflow pipelines for model training & deployment
  • Monitoring & Observability with Prometheus and Grafana

πŸ›  Technology Stack

Category Technology Used
Backend Framework FastAPI
Machine Learning PyTorch, Hugging Face Transformers
Vector Search Weaviate, FAISS, PGVector
Text Search Elasticsearch
Data Processing Ray, Dask
MLOps Docker, Kubeflow
Monitoring Prometheus, Grafana

πŸ”§ Getting Started

πŸ“Œ Prerequisites

Before running the project, ensure you have the following installed:

  • Python 3.9+
  • Docker & Docker Compose
  • Git

πŸ“Œ Installation Steps

# Clone the repository
git clone https://github.com/MHHamdan/VectorSphere.git
cd VectorSphere

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

## πŸ“Œ Running the Project

```bash
# Start the services
docker-compose up -d

# Run the API
uvicorn app.main:app --reload

🌍 Accessing the Services

Service URL
API Documentation http://localhost:8000/docs
Vector Database Console http://localhost:8080

πŸ“‚ Project Structure

VectorSphere/
β”‚
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py                 # FastAPI application
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ embedding.py        # Embedding service
β”‚   β”‚   β”œβ”€β”€ vector_db.py        # Vector database service
β”‚   β”‚   β”œβ”€β”€ hybrid_search.py    # BM25 + Vector hybrid search
β”‚   β”‚   β”œβ”€β”€ reranking.py        # Re-ranking module
β”‚   β”‚   └── streaming.py        # Real-time vector ingestion
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ config.py           # Configuration module
β”‚   β”‚   β”œβ”€β”€ dependencies.py     # API dependencies
β”‚   └── routes/
β”‚       β”œβ”€β”€ search.py           # API endpoints for search
β”‚       β”œβ”€β”€ embeddings.py       # API endpoints for embeddings
β”‚       β”œβ”€β”€ health.py           # Health check routes
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_embedding_service.py
β”‚   β”œβ”€β”€ test_vector_db_service.py
β”‚   β”œβ”€β”€ test_api.py
β”‚
β”œβ”€β”€ scripts/                    # Utility scripts
β”‚   β”œβ”€β”€ benchmark.py            # Benchmarking FAISS vs Weaviate
β”‚   β”œβ”€β”€ ingest_vectors.py       # Vector ingestion
β”‚   β”œβ”€β”€ update_index.py         # Refresh FAISS index
β”‚
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── .env

πŸš€ Development Roadmap

βœ… Phase 1: Core Implementation
  - Base embedding functionality
  - Vector search system
  - REST API

πŸ”œ Phase 2: Advanced Features
  - Hybrid search implementation (BM25 + Vectors)
  - RAG integration
  - Performance optimization

πŸ”œ Phase 3: Production Readiness
  - MLOps pipeline
  - Monitoring & observability
  - Documentation and examples

🀝 Contributing

We welcome contributions! Please check out our Contributor Guide before submitting pull requests.

πŸ“œ License

This project is licensed under the MIT License.

πŸ“© Contact

For questions or suggestions, open an issue on GitHub:
πŸ”— VectorSphere GitHub Repo

About

An advanced vector search system that demonstrates multiple approaches to semantic search and retrieval

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published