Why build it before installing a vector DB
Every vector database hides the same three operations behind a fancy API: embed, store, query by nearest neighbor. If you can write those three in 30 lines of NumPy, you will read every vector-DB doc faster, debug bad results faster, and never blindly trust a default again.
The whole loop in one screen
You will:
- Embed a small corpus of documents with a local model.
- Store the vectors in a NumPy matrix and the documents in a parallel list.
- Embed a query, compute cosine similarity against every row, and return the top-k.
This is exactly what Chroma and pgvector do internally — they just add persistence, metadata filtering, and indexes for scale. The retrieval logic is the same.