← all repositories

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.

493 stars Python RAG · SearchLanguage Models
rag-postgres-openai-python
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.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.