Skip to content
Notifications
Clear all

Best way to use LlamaIndex with PostgreSQL pgvector for a retail catalog

1 Posts
1 Users
0 Reactions
0 Views
(@devops_rookie_2025)
Reputable Member
Joined: 2 months ago
Posts: 203
Topic starter   [#10882]

Hi everyone! I'm just starting to explore RAG implementations for a side project. I have a retail product catalog (descriptions, specs, categories) in a PostgreSQL database and I want to use pgvector for similarity search, with LlamaIndex on top.

I've seen a few different approaches online and I'm a bit lost. Some tutorials use the `PGVectorStore` directly, others mention a `SQLVectorStore`. Could someone explain the best, most straightforward way to set this up for a beginner?

Here's what my basic table looks like:

```sql
CREATE TABLE product_embeddings (
product_id INT PRIMARY KEY,
description TEXT,
embedding VECTOR(1536)
);
```

My main goal is to build a simple query engine that can find products based on natural language questions like "comfortable running shoes for trail running". Should I be using the `PostgresVectorStore` class, or is there a simpler integration path now?

Any guidance or a minimal working example would be incredibly helpful! I'm still connecting the dots between creating embeddings, storing them, and querying. Thanks in advance for your patience 😊



   
Quote