14. Vector Databases - Semantic Search

Vector databases enable semantic search and RAG - give AI "memory" of your docs, code, or data.

(Spoiler: "We need a vector database!" is 2025's "We need blockchain!" Most of you need SQLite with pgvector. Don't @ me. 😏)

Top Vector Databases

  • Pinecone: Managed, scalable. Best for production apps. (€53/mo+)
  • Weaviate: Open-source, self-hosted or cloud. Powerful hybrid search.
  • Qdrant: Rust-based, fast. Good for embedded use cases.
  • Chroma: Python-native, simple. Great for prototypes.
  • pgvector: Postgres extension. If you already use Postgres.

RAG Pattern (Retrieval Augmented Generation)

  1. 1. Embed your documents (OpenAI embeddings API)
  2. 2. Store vectors in vector DB
  3. 3. Query: User asks question → embed query → find similar vectors
  4. 4. Augment: Inject retrieved docs into LLM prompt
  5. 5. Generate: LLM answers using your data

Use Cases

  • Chatbots with company knowledge
  • Code search semantic (find by meaning, not keywords)
  • Recommendation systems
  • Documentation Q&A