Chat with your SQL database . Accurate Text-to-SQL Generation via LLMs using Agentic Retrieval .
Vanna 2.0: Turn Questions into Data Insights
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Natural language → SQL → Answers.** Now with enterprise security and user-aware permissions.
https://github.com/user-attachments/assets/476cd421-d0b0-46af-8b29-0f40c73d6d83
---
What's New in 2.0
🔐 **User-Aware at Every Layer** — Queries automatically filtered per user permissions
🎨 **Modern Web Interface** — Beautiful pre-built component
⚡ **Streaming Responses** — Real-time tables, charts, and progress updates
🔒 **Enterprise Security** — Row-level security, audit logs, rate limiting
🔄 **Production-Ready** — FastAPI integration, observability, lifecycle hooks
> **Upgrading from 0.x?** See the Migration Guide | What changed?
---
Get Started
Try it with Sample Data
Quickstart
Configure
Configure
Web Component
Uses your existing cookies/JWTs. Works with React, Vue, or plain HTML.
---
What You Get
Ask a question in natural language and get back:
**1. Streaming Progress Updates**
**2. SQL Code Block (By default only shown to "admin" users)**
**3. Interactive Data Table**
**4. Charts** (Plotly visualizations)
**5. Natural Language Summary**
All streamed in real-time to your web component.
---
Why Vanna 2.0?
✅ Get Started Instantly
* Production chat interface
* Custom agent with your database
* Embed in any webpage
✅ Enterprise-Ready Security
**User-aware at every layer** — Identity flows through system prompts, tool execution, and SQL filtering
**Row-level security** — Queries automatically filtered per user permissions
**Audit logs** — Every query tracked per user for compliance
**Rate limiting** — Per-user quotas via lifecycle hooks
✅ Beautiful Web UI Included
**Pre-built component** — No need to build your own chat interface
**Streaming tables & charts** — Rich components, not just text
**Responsive & customizable** — Works on mobile, desktop, light/dark themes
**Framework-agnostic** — React, Vue, plain HTML
✅ Works With Your Stack
**Any LLM:** OpenAI, Anthropic, Ollama, Azure, Google Gemini, AWS Bedrock, Mistral, Others
**Any Database:** PostgreSQL, MySQL, Snowflake, BigQuery, Redshift, SQLite, Oracle, SQL Server, DuckDB, ClickHouse, Others
**Your Auth System:** Bring your own — cookies, JWTs, OAuth tokens
**Your Framework:** FastAPI, Flask
✅ Extensible But Opinionated
**Custom tools** — Extend the Tool base class
**Lifecycle hooks** — Quota checking, logging, content filtering
**LLM middlewares** — Caching, prompt engineering
**Observability** — Built-in tracing and metrics
---
Architecture
---
How It Works
**Key Concepts:**
1. **User Resolver** — You define how to extract user identity from requests (cookies, JWTs, etc.)
2. **User-Aware Tools** — Tools automatically check permissions based on user's group memberships
3. **Streaming Components** — Backend streams structured UI components (tables, charts) to frontend
4. **Built-in Web UI** — Pre-built component renders everything beautifully
---
Production Setup with Your Auth
Here's a complete example integrating Vanna with your existing FastAPI app and authentication:
**Then in your frontend:**
See Full Documentation for custom tools, lifecycle hooks, and advanced configuration