#1010th of 12 in RAG and search

natural-language-postgres

Next.js text-to-SQL over Postgres with auto-picked charts

Stars
326
License
Apache-2.0
Last commit
Apr 2026
Language
TypeScript

Overview

A Next.js app where the AI SDK and GPT-4o turn a plain-English question into SQL, run it against Postgres, show the rows, pick a chart type and render it with Recharts, and explain the query on request. It ships with a seed script for a unicorn-companies CSV you download yourself; there is no auth and no history. For developers who want a text-to-SQL and charting pattern to copy.

Who it is for: Developers copying a text-to-SQL and charting pattern

Strengths

  • Shows the full loop: generate SQL, execute, explain, chart config, render
  • Deployed demo on Vercel
  • Two secrets to run: OPENAI_API_KEY and a Postgres URL

Weaknesses

  • Single hardcoded dataset; the schema prompt must be rewritten for your tables
  • OpenAI GPT-4o only
  • No auth, tests or history
  • Dataset CSV must be fetched manually from CB Insights

What it needs

  • TypeScript, openai, ai-sdk
  • Needs postgres, openai-api-key
  • 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
2rag-postgres-openai-pythonRAG over Postgres table rows with hybrid search and SQL filters505 stars, MIT51 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