Embeddings and Vector Databases for Fast RAG (100% Local) | Ollama, Supabase (PostgreSQL + pgvector)

Venelin Valkov · Intermediate ·🔍 RAG & Vector Search ·3mo ago
Complete tutorial and source code (requires MLExpert Pro): https://www.mlexpert.io/academy/v2/context-engineering/embeddings-and-vector-databases Simple keyword is not enough for your RAG. If a user asks for "money" but your documents say "revenue," traditional search fails. In this tutorial, we'll build the storage layer of a production-grade RAG system using Vector Embeddings. We will move beyond simple TF-IDF and implement Semantic Search using local open-source models (Qwen3 Embedding), PostgreSQL, and pgvector via Supabase. Qwen3 Embedding: https://qwenlm.github.io/blog/qwen3-embedding/ Supabase: https://github.com/supabase/supabase HNSW index: https://github.com/pgvector/pgvector?tab=readme-ov-file#hnsw AI Academy: https://www.mlexpert.io/ LinkedIn: https://www.linkedin.com/in/venelin-valkov/ Follow me on X: https://twitter.com/venelin_valkov Discord: https://discord.gg/UaNPxVD6tv Subscribe: http://bit.ly/venelin-subscribe GitHub repository: https://github.com/curiousily/AI-Bootcamp 👍 Don't Forget to Like, Comment, and Subscribe for More Tutorials! 00:00 - How to store your chunks? 01:06 - What are Vector Embeddings? 03:16 - Local Postgres & pgvector setup 06:31 - Initializing Supabase & Docker 07:17 - Generating Embeddings with Ollama and Qwen3 Embedding 09:00 - Storing Data: Inserting Vectors into SQL 09:45 - Full-Text Search Limitations 10:27 - Vector Semantic Search Success 11:30 - Why you need persistence and what's next Join this channel to get access to the perks and support my work: https://www.youtube.com/channel/UCoW_WzQNJVAjxo4osNAxd_g/join
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

The Future of RAG: Dead, Evolving… or Becoming the Brain of AI?
Learn about the future of RAG, from its current state to emerging trends like Agentic RAG and multimodal AI
Medium · Machine Learning
Smart Routing, Transfer Family Ingestion, and Voice Chat — Permission-Aware RAG v4.2
Learn about the latest features in Permission-Aware RAG v4.2, including Smart Routing, Transfer Family Ingestion, and Voice Chat, and how to apply them in your projects
Dev.to · Yoshiki Fujiwara(藤原 善基)@AWS Community Builder
Most Companies Doing GenAI Are Really Just Doing RAG: RAGOps Explained for analysts
Learn why RAGOps is becoming the preferred approach for GenAI projects and how it differs from agent-based approaches
Medium · RAG
RAG - Sliding Window, Token Based Chunking and PDF Chunking Packages
Learn about RAG chunking mechanisms, including Sliding Window, Token Based, and PDF Chunking, to improve your AI model's text processing capabilities
Dev.to AI

Chapters (9)

How to store your chunks?
1:06 What are Vector Embeddings?
3:16 Local Postgres & pgvector setup
6:31 Initializing Supabase & Docker
7:17 Generating Embeddings with Ollama and Qwen3 Embedding
9:00 Storing Data: Inserting Vectors into SQL
9:45 Full-Text Search Limitations
10:27 Vector Semantic Search Success
11:30 Why you need persistence and what's next
Up next
Watch this before applying for jobs as a developer.
Tech With Tim
Watch →