#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| Rank | Project | Score |
|---|---|---|
| 1 | azure-search-openai-demoAzure RAG chat reference on AI Search and Azure OpenAI | 56 out of 100 |
| 2 | rag-postgres-openai-pythonRAG over Postgres table rows with hybrid search and SQL filters | 51 out of 100 |
| 3 | llm-appPathway RAG pipeline templates that re-index live data sources | 48 out of 100 |
| #4 | chat-langchainLangChain docs assistant as a Managed Deep Agent with Next.js UI | 45 out of 100 |
| #5 | chat-with-your-data-solution-acceleratorAzure RAG chat app that answers from your documents with citations | 44 out of 100 |