You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add pgvector tutorial with PostgreSQL integration (feast-dev#5290)
* feat: Add pgvector tutorial with PostgreSQL integration
This commit introduces a comprehensive tutorial demonstrating the use of PostgreSQL with the pgvector extension as a vector database backend for Feast. It includes Docker setup instructions, feature definitions, sample data generation, and vector similarity search functionality. Key files added are `docker-compose.yml`, `example_repo.py`, `feature_store.yaml`, `pgvector_example.py`, `README.md`, and an initialization SQL script for pgvector.
Signed-off-by: Yassin Nouh <[email protected]>
* chore: Remove example_repo.py from pgvector tutorial
Signed-off-by: Yassin Nouh <[email protected]>
* update the docs
Signed-off-by: Yassin Nouh <[email protected]>
---------
Signed-off-by: Yassin Nouh <[email protected]>
This tutorial demonstrates how to use PostgreSQL with the pgvector extension as a vector database backend for Feast. You'll learn how to set up pgvector, create embeddings, store them in Feast, and perform similarity searches.
docker exec -it postgres-pgvector psql -U feast -c "CREATE EXTENSION IF NOT EXISTS vector;"
29
+
```
30
+
31
+
## Project Structure
32
+
33
+
```
34
+
pgvector_tutorial/
35
+
├── README.md
36
+
├── feature_store.yaml # Feast configuration
37
+
├── data/ # Data directory
38
+
│ └── sample_data.parquet # Sample data with embeddings
39
+
└── pgvector_example.py # Example script
40
+
```
41
+
42
+
## Tutorial Steps
43
+
44
+
1. Configure Feast with pgvector
45
+
2. Generate sample data with embeddings
46
+
3. Define feature views
47
+
4. Register and apply feature definitions
48
+
5. Perform vector similarity search
49
+
50
+
Follow the instructions in `pgvector_example.py` to run the complete example.
51
+
52
+
## How It Works
53
+
54
+
This tutorial demonstrates:
55
+
56
+
- Setting up PostgreSQL with pgvector extension
57
+
- Configuring Feast to use pgvector as the online store
58
+
- Generating embeddings for text data
59
+
- Storing embeddings in Feast feature views
60
+
- Performing vector similarity searches using Feast's retrieval API
61
+
62
+
The pgvector extension enables PostgreSQL to store and query vector embeddings efficiently, making it suitable for similarity search applications like semantic search and recommendation systems.
0 commit comments