PostgreSQL pgvector for Python developers: Practical Guide

preview_player
Показать описание
The pgvector extension turns PostgreSQL into a complete vector database for general-purpose generative AI applications. This hands-on practical guide for Python developers explains how to set up the extension, perform vector similarity searches, pre-filter data, create specialized indexes, and scale horizontally.

The guide is based on OpenAI's cookbook for Postgres:

0:00 Introduction
0:49 Setting up Postgres with pgvector
3:58 Configuring an OpenAI API key
4:07 Loading sample data set
6:19 Exploring the data set
7:06 Performing the vector similarity search
10:06 Data pre-filtering
12:33 Optimizing the search with specialized indexes
14:28 Scaling with the distributed Postgres (YugabyteDB)

Curious to learn even more about databases? Follow me here:
Рекомендации по теме
Комментарии
Автор

quite interesting topic! it would be interesting to see dynamic query rewriter for SQL queries + PgVector search, specifically for RAG applications. The downside of using traditional filtering/search seems to be automatic query construction that is aware of the existing database options to filter on. To scale to different types of databases (different clients) we might need to customize our code to match domain specific knowledge which ideally we wouldn't need to since this is labor expensive. Automatic schema creation for optimal querying seems to be a topic that needs more research .

awakenwithoutcoffee
Автор

00:01 Learn how to use PG Vector extension in practice
02:17 Using PGVector extension with Docker and loading sample dataset
04:44 Generating movie embeddings and connecting to PostgreSQL instance for analysis.
07:20 Using pgvector for similarity search and movie recommendations
09:38 Data pre-filtering is essential for optimizing vector similarity search in PostgreSQL.
11:52 PostgreSQL pgvector supports various index types for vectorized data and performs similarity search.
14:18 Introducing Yab DB as a distributed SQL database for horizontal scaling and high availability.
16:36 Running PostgreSQL pgvector for Python developers on a local laptop
Crafted by Merlin AI.00:01 Learn how to use PG Vector extension in practice
02:17 Using PGVector extension with Docker and loading sample dataset
04:44 Generating movie embeddings and connecting to PostgreSQL instance for analysis.
07:20 Using pgvector for similarity search and movie recommendations
09:38 Data pre-filtering is essential for optimizing vector similarity search in PostgreSQL.
11:52 PostgreSQL pgvector supports various index types for vectorized data and performs similarity search.
14:18 Introducing Yab DB as a distributed SQL database for horizontal scaling and high availability.
16:36 Running PostgreSQL pgvector for Python developers on a local laptop
Crafted by Merlin AI.

ramsiddu
Автор

Thanks for the great work demystifying pgvector, I was very worry as I had to work on a new project with pgvector but now dependencies seems quite clear as the business scenarios you exposed. Thanks!

gonzalea
Автор

Nice can we run the entire demo in a CPU laptop? Please confirm

karthikb.s.k.
Автор

Im getting this error while running the cell where we are establishing a connnection with psycopg. OperationalError: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres" - i havent changed the password, db or host in the code. Any idea why this is happening or how to fix this? Sorry Im a beginner and doesnt have much ideas to troubleshoot.

AI.ML.DataScientistWork
Автор

I am using pgvector to insert data in postgres table, how to add additional columns like your movie schema?

dewanjeesoma
join shbcf.ru