RAG app for querying database table rows using OpenAI
Top 73.7% on sourcepulse
This project provides a web-based chat application for querying PostgreSQL database rows using OpenAI models, targeting developers building RAG applications on Azure. It offers hybrid search capabilities and OpenAI function calling for advanced query filtering, simplifying complex data interactions.
How It Works
The application leverages PostgreSQL with the pgvector
extension for hybrid search, combining vector similarity search with full-text search. Reciprocal Rank Fusion (RRF) is used to merge results from both search types. OpenAI's embedding API converts user queries into vectors, and function calling can translate natural language questions into SQL WHERE
clauses, enhancing query precision and user experience.
Quick Start & Requirements
azd init -t rag-postgres-openai-python
followed by azd up
for Azure deployment. Local setup requires azd
, Node.js 18+, Python 3.9+, PostgreSQL 14+, pgvector
, Docker, and Git.Highlighted Details
pgvector
and full-text search with RRF.azd
).Maintenance & Community
This is an Azure Samples project, indicating official support and integration with Azure services. Further guidance and issue tracking are available via the project's issue tracker.
Licensing & Compatibility
The project is licensed under the MIT License, permitting commercial use and integration with closed-source applications.
Limitations & Caveats
The specified Azure OpenAI models (gpt-4o-mini, text-embedding-3-large) may not be available in all Azure regions. Function calling and specific embedding models are recommended for optimal performance but can be disabled if unavailable.
1 week ago
Inactive