Azure-Samples/rag-postgres-openai-python
A web-based chat application that uses OpenAI models to answer natural language questions about data stored in a PostgreSQL database table.

Velocity · 7d
+0.7
★ / day
Trend
→steady
star history
This project builds a RAG (Retrieval-Augmented Generation) system combining vector and keyword search. The backend uses FastAPI and leverages pgvector for semantic vector search and PostgreSQL full-text search, merging results via Reciprocal Rank Fusion. OpenAI embeddings convert user queries and database content into vectors, while OpenAI chat models generate responses based on retrieved context.