22nd of 12 in RAG and search

rag-postgres-openai-python

RAG over Postgres table rows with hybrid search and SQL filters

Stars
505
License
MIT
Last commit
Oct 2026
Language
Python

Overview

A FastAPI backend and React frontend that answer chat questions about rows in a PostgreSQL table. Retrieval is hybrid (pgvector similarity plus full-text search fused with RRF), an OpenAI function call turns phrases like cheaper than 30 dollars into WHERE clauses, and it runs against Azure OpenAI, OpenAI.com or Ollama; azd deploys it to Container Apps with managed identity. For teams whose knowledge is structured rows, not documents.

Who it is for: Teams whose knowledge base is structured Postgres rows

Strengths

  • Hybrid vector plus full-text search with RRF is implemented in SQL, not a vendor service
  • Provider switch by env var: Azure OpenAI, OpenAI.com or Ollama
  • Evaluation, safety evaluation and load-testing docs included
  • Tests included; dev container and Codespaces configs

Weaknesses

  • Deploy path is Azure-only (azd, Container Apps, Flexible Server)
  • Local run expects Postgres 14+ with pgvector installed yourself
  • Sample schema is one products table; multi-table questions need new code
  • No auth in the app itself

What it needs

  • Python, azure-openai, openai, ollama
  • Needs postgres-pgvector, azure-openai-or-openai-or-ollama, azd
  • GitHub template
  • env example file

Also in RAG and search

See all 12
Also in RAG and search
RankProjectScore
1azure-search-openai-demoAzure RAG chat reference on AI Search and Azure OpenAI7.8k stars, MIT56 out of 100
3llm-appPathway RAG pipeline templates that re-index live data sources Live demo ↗ (opens in a new tab)58.8k stars, MIT48 out of 100
#4chat-langchainLangChain docs assistant as a Managed Deep Agent with Next.js UI6.5k stars, MIT45 out of 100
#5chat-with-your-data-solution-acceleratorAzure RAG chat app that answers from your documents with citations1.2k stars, MIT44 out of 100
#6llm-answer-enginePerplexity-style Next.js answer engine over Brave search results5k stars, MIT41 out of 100