# Natural Language Postgres

> Query a Postgres database with natural language and visualize results.

Natural Language Postgres is an open-source demo app built with the Vercel AI SDK and Next.js. It converts plain English questions into SQL, runs them against a PostgreSQL database, and visualizes the results as tables or charts. It also generates clause-by-clause explanations of the generated SQL queries.

Website: https://natural-language-postgres.vercel.app/

## What it is for

- Query relational databases using plain English prompts
- Study an open-source reference implementation of text-to-SQL with the Vercel AI SDK
- Generate instant data visualizations and charts from database query results
- Learn SQL syntax by viewing interactive explanations of generated clauses

## Features

- Natural language to SQL conversion
- Real-time SQL query streaming and execution
- Clause-by-clause explanations on hover
- Automatic data visualization with tables and charts
- One-click deployment to Vercel with GitHub repository template
- Built-in sample queries for testing

## Pricing

Open source. Free and open source; self-host on Vercel with your own OpenAI API key and Postgres database.

## Details

- Type: Web app
- Category: [Development](https://xiry.app/topics/development.md)
- Topic: [Developer Tools](https://xiry.app/topics/development/developer-tools.md)
- Open source: yes
- Platforms: Web, Self-hosted
- For: Developers and data analysts building text-to-SQL workflows or AI data apps.
- Alternative to: Text2SQL.ai, Vanna.ai, Defog.ai
- Tags: postgresql, sql, ai sdk, vercel, text to sql, nextjs

## Why it was saved

- [@nicoalbanese10, 6 November 2024](https://x.com/nicoalbanese10/status/1854264739356110935): Working reference for building natural-language database querying with the Vercel AI SDK, Next.js and shadcn/ui charts; the app itself is open to try.

## Related

- [react-best-practices](https://xiry.app/resources/react-best-practices): Curated React performance rules and coding-agent skills by Vercel (GitHub repo, Open source)
- [Agentation](https://xiry.app/resources/agentation): Connects AI coding agents to browser annotations for automated UI reviews (Web app, Open source)
- [claude-office-skills](https://xiry.app/resources/claude-office-skills): Office document creation and editing skills for Claude Code CLI. (GitHub repo, Open source)
- [Domain SDK](https://xiry.app/resources/domain-sdk): TypeScript SDK for adding and managing custom customer domains across platforms (GitHub repo, Open source)
- [ECC](https://xiry.app/resources/ecc): Agent harness optimization system with skills, hooks, and configs for coding agents (GitHub repo, Open source)
- [Eight Dev Tools, Zero Fluff — Part 6](https://xiry.app/resources/eight-dev-tools-zero-fluff-part-6): Curated list of eight front-end design and developer utility tools (List)

Updated 10 October 2026. Page: https://xiry.app/resources/natural-language-postgres

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
