Back to directory

RAG on PostgreSQL

A sample chat application and FastAPI backend that answers questions about rows in a PostgreSQL table using OpenAI chat models, hybrid vector and full-text search, and function calling to turn natural-language filters into SQL conditions.

RAG on PostgreSQL

This project combines pgvector-based vector search with PostgreSQL full-text search, merging the two result sets with Reciprocal Rank Fusion, and uses OpenAI function calling to convert queries such as "climbing gear cheaper than $30" into query filter conditions. User queries are converted into vectors through the OpenAI embedding API.

The frontend is built with React and FluentUI, and the backend with Python and FastAPI. It is designed for deployment to Azure Container Apps with the Azure Developer CLI, storing data in Azure PostgreSQL Flexible Server and using Azure OpenAI for the models, with a user-assigned managed identity and logs in Log Analytics.

It can be run through GitHub Codespaces, VS Code Dev Containers, or a local environment with Node.js, Python, PostgreSQL, pgvector and Docker Desktop installed.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.