Environment setup

Welcome! I'm Param. In this course we are going to build a document Q&A system with hybrid retrieval: dense semantic vectors plus sparse keyword vectors, fused with Reciprocal Rank Fusion, and reranked by a cross-encoder. The whole stack runs locally on CPU with Qdrant in Docker.

Pure vector search misses exact product codes and error strings. Pure keyword search misses synonyms and paraphrased questions. Hybrid search keeps both signals and lets the database fuse them. It is the pattern every serious search team runs.

The hybrid retrieval stack

How the pieces connect across indexing and query time.

terminal
bash
# Clone the workshop repository
git clone https://github.com/learnwithparam/hybrid-search-qdrant.git
cd hybrid-search-qdrant

# Start Qdrant and the FastAPI service together
docker compose up --build

Docker Compose boots Qdrant on port 6333 and the FastAPI service on port 8000. The service loads the embedding and reranker models at startup.

.env
bash
# Copy the example environment file
cp .env.example .env

# Configure your LLM provider for the answer-generation step
LLM_PROVIDER=openrouter
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MODEL=google/gemma-3-12b-it

# Qdrant is reached over the docker network
QDRANT_HOST=qdrant
QDRANT_PORT=6333

Only the LLM provider key is required from you. Qdrant runs locally and needs no API key. OpenRouter has a free tier if you are starting fresh.

Validation checklist: Environment setup checklist

Loading practice…