How harshchan/qdrant-search-methods works
Project Type and Purpose
• This is a Python-based information retrieval/search application.
• It ingests a CSV dataset of shoe products, preprocesses text data, builds both traditional (BM25, TF-IDF) and vector-based indexes in Qdrant, and exposes:
• A pipeline mode to set up or refresh indexes
• A CLI search mode
• A Streamlit frontend for interactive queries
File Structure
• Top-level scripts:
• main.py (entry point with modes: pipeline, streamlit, search)
• app.py / search_engine.py (core retrieval logic)
• data_preprocessing.py, data_indexing.py, vector_generation.py (ETL + indexing)
• qdrant_setup.py (index/collection setup in Qdrant)
• evaluation.py (runs evaluation metrics, outputs evaluation_report.txt)
• Folders and artifacts:
• data/ (shoe_products_dataset.csv)
• saved_models/ (pickled BM25 corpus, TF-IDF vectorizer)
• qdrant-search-methods.zip (possibly sample query helpers)
Extract Additional Insights from README
• Dependencies defined in requirements.txt
• Qdrant (hosted via Docker on ports 6333/6334) as vector store + search engine
• Virtual environment recommended
• Three modes:
• pipeline → data ingestion, preprocessing, index building
• streamlit → run frontend UI
• search → CLI query and evaluation
Main Components
a. Data Ingestion & Preprocessing
• Input: CSV (data/shoe_products_dataset.csv)
• Scripts: data_preprocessing.py → text cleaning/tokenization
b. Traditional Indexing Module
• data_indexing.py → creates BM25 corpus + TF-IDF vectorizer → saved_models/
c. Vector Generation Module
• vector_generation.py → embed cleaned text (using some embedding model)
d. Qdrant Vector Store
• qdrant_setup.py → collection configuration
• Qdrant Docker containers on ports 6333/6334
e. Retrieval Layer
• search_engine.py / app.py → abstracts querying BM25 & Qdrant
f. Evaluation Module
• evaluation.py → runs queries, computes metrics, writes evaluation_report.txt
g. Frontend UI
• Streamlit app (launched via main.py --mode streamlit)
Relationships and Data Flow
• → Traditional Index Builder → saved_models → Retrieval
• → Vector Generator → Qdrant
• Retrieval Layer → queries both saved_models (in-memory) and Qdrant → returns ranked results
• UI Layer (Streamlit) and CLI Layer (main.py --mode search) both invoke Retrieval Layer
• Evaluation module can call Retrieval Layer to compute IR metrics
Architectural Patterns & Design Principles
• Modular ETL pipeline (separate scripts for preprocessing, indexing, vector gen)
• Separation of concerns:
• Index build vs. Index store vs. Query logic vs. UI
• Adapter pattern in search_engine.py to unify different search backends (BM25, TF-IDF, vector)
• Dockerized external service for scalability (Qdrant)
Essential Details to Capture
• The three modes in main.py and how they trigger different subsystems
• The saved_models artifacts vs. vector store in Qdrant
• The Streamlit server listening on a port vs. CLI interface
• Docker ports and network boundary
Final Advice
Level 1: High-level boundaries (Data, Indexing, Qdrant, Retrieval, UI)
Level 2: Zoom into key modules (preprocessing, vector generation, search engine abstraction)