Title: Lab 3 — Four Engines, One Dataset, One Comparison
Course: AIINFRA 301: Production RAG & LLMOps — Observability and Evaluation > Section: Week 03 — Vector Database Selection: Qdrant, Milvus, Weaviate, and pgvector

🛠️ Lab 3 — Four Engines, One Dataset, One Comparison (50 pts)

Goal: Stand up at least one free, local vector database, load the same small set of documents into it, run a similarity query, and produce a structured comparison of setup effort, query ergonomics, and observed latency. If you're able, repeat with a second engine so you have a real side-by-side. Steps:

1. Prepare a small shared document set: 20–50 short text chunks (a few paragraphs each) on any topic you like — course notes, product docs, or public text work fine. Save them as plain text or JSON with an id per chunk.
2. Generate embeddings for your chunks using any free local embedding approach from AIINFRA 300 (e.g., a local sentence-transformers model or fastembed, which ships with the Qdrant client).
3. Pick your primary engine and stand it up locally using only free tools:
  - Qdrant: docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant:latest, then pip install "qdrant-client[fastembed]".
  - Milvus Lite: pip install pymilvus — runs embedded, no Docker or server required.
  - Weaviate: clone the quickstart docker-compose.yml from the Weaviate Quickstart resource and run docker-compose up -d.
  - pgvector: on a local Postgres 16/17 install, run CREATE EXTENSION vector; then create a table with a vector column.
4. Upsert all of your document embeddings into the engine, then run one similarity query (e.g., "find the 5 chunks most similar to this question") and record the wall-clock time of the query.
5. Note three things as you go: (a) how many commands/lines of setup it took to get a running instance, (b) how natural or awkward the query API felt (do you write raw JSON, a fluent client method, or SQL?), and (c) your observed query latency.
6. Optional but recommended: repeat steps 3–5 with a second engine using the same document set and embeddings, so you can compare directly.
7. Write up a short comparison (1 page or less) covering: which engine(s) you tried, setup effort, query ergonomics, observed latency, and — based on this week's lecture — which engine you'd recommend for a small startup RAG app versus a billion-scale enterprise search system, and why.

Deliverables: Submit your comparison write-up (PDF or text) plus the code/notebook you used to load data and run the query (upload as a file or paste as text).