Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vanna

> ๆ•ฐๆฎๅบ“
Open source

๐Ÿค– Chat with your SQL database ๐Ÿ“Š. Accurate Text-to-SQL Generation via LLMs using Agentic Retrieval ๐Ÿ”„.

23.8K stars0 likes1 views
WebsiteGitHub

About

๐Ÿค– Chat with your SQL database ๐Ÿ“Š. Accurate Text-to-SQL Generation via LLMs using Agentic Retrieval ๐Ÿ”„.

Vanna 2.0: Turn Questions into Data Insights

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 <vanna-chat> 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

xml

<script src="https://img.vanna.ai/vanna-components.js"></script>
<vanna-chat
  sse-endpoint="https://your-api.com/chat"
  theme="dark">
</vanna-chat>

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 <vanna-chat> 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

mermaid
sequenceDiagram
    participant U as ๐Ÿ‘ค User
    participant W as ๐ŸŒ <vanna-chat>
    participant S as ๐Ÿ Your Server
    participant A as ๐Ÿค– Agent
    participant T as ๐Ÿงฐ Tools

    U->>W: "Show Q4 sales"
    W->>S: POST /api/vanna/v2/chat_sse (with auth)
    S->>A: User(id=alice, groups=[read_sales])
    A->>T: Execute SQL tool (user-aware)
    T->>T: Apply row-level security
    T->>A: Filtered results
    A->>W: Stream: Table โ†’ Chart โ†’ Summary
    W->>U: Display beautiful UI

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 <vanna-chat> 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:

xml
<vanna-chat sse-endpoint="/api/vanna/v2/chat_sse"></vanna-chat>

See Full Documentation for custom tools, lifecycle hooks, and advanced configuration


Custom Tools

Extend Vanna with custom tools for your specific use case:

โ€ฆ

Advanced Features

Vanna 2.0 includes powerful enterprise features for production use:

Lifecycle Hooks โ€” Add quota checking, custom logging, content filtering at key points in the request lifecycle

LLM Middlewares โ€” Implement caching, prompt engineering, or cost tracking around LLM calls

Conversation Storage โ€” Persist and retrieve conversation history per user

Observability โ€” Built-in tracing and metrics integration

Context Enrichers โ€” Add RAG, memory, or documentation to enhance agent responses

Agent Configuration โ€” Control streaming, temperature, max iterations, and more


Use Cases

Vanna is ideal for:

  • ๐Ÿ“Š Data analytics applications with natural language interfaces
  • ๐Ÿ” Multi-tenant SaaS needing user-aware permissions
  • ๐ŸŽจ Teams wanting a pre-built web component + backend
  • ๐Ÿข Enterprise environments with security/audit requirements
  • ๐Ÿ“ˆ Applications needing rich streaming responses (tables, charts, SQL)
  • ๐Ÿ”„ Integrating with existing authentication systems

Community & Support

  • ๐Ÿ“– Full Documentation โ€” Complete guides and API reference
  • ๐Ÿ’ก GitHub Discussions โ€” Feature requests and Q&A
  • ๐Ÿ› GitHub Issues โ€” Bug reports
  • ๐Ÿ“ง Enterprise Support โ€” [email protected]

Migration Notes

Upgrading from Vanna 0.x?

Vanna 2.0 is a complete rewrite focused on user-aware agents and production deployments. Key changes:

  • New API: Agent-based instead of VannaBase class methods
  • User-aware: Every component now knows the user identity
  • Streaming: Rich UI components instead of text/dataframes
  • Web-first: Built-in <vanna-chat> component and server

Migration path:

  1. Quick wrap โ€” Use LegacyVannaAdapter to wrap your existing Vanna 0.x instance and get the new web UI immediately
  2. Gradual migration โ€” Incrementally move to the new Agent API and tools

See the complete Migration Guide for step-by-step instructions.


License

MIT License โ€” See LICENSE for details.


Built with โค๏ธ by the Vanna team | Website | Docs | Discussions

Issuesยท 289 open

View all issuesOpen on GitHub
  • #1121

    SQL Injection vulnerability in `remove_training_data` (CVE-2026-4229)

    bugUpdated Mar 26, 2026
  • #1085

    Support for Vertex AI endpoint in GeminiLlmService class

    Updated Mar 26, 2026
  • #1055

    Manual Training failed

    bugUpdated Mar 25, 2026
  • #1110

    ไฝ ไปฌๆ˜ฏๆ€ŽไนˆๅŽปๅฎž็Žฐ็”ŸๆˆSQL็š„ๅ‡†็กฎๆ€งไปฅ่ฝๅœฐๅˆฐๅฎž้™…ๅบ”็”จ็š„

    Updated Mar 9, 2026
  • #1112

    Legacy OpenAI_Chat: temperature=0.7 causes 400 with models that only support default

    bugUpdated Mar 9, 2026
  • #1111

    Database Schema Awareness

    Updated Mar 9, 2026
  • #1105

    Vanna 2.0 outputs too much process data on the conversation page

    Updated Mar 6, 2026
  • #1080

    ๆ€Žๆ ทๅฏไปฅ่ฐƒ็”จๆˆ‘็š„chromaDBๅ‘้‡ๅบ“้‡Œ่ฎญ็ปƒ็š„ๅ†…ๅฎน

    Updated Mar 5, 2026
  • #1103

    [Bug] Wrong SQL gets auto-saved to Tool Memory without validation โ€” Poisoned Memory problem

    bugUpdated Feb 28, 2026
  • #1104

    Does Vanna2.0 support connecting with vLLM๏ผŸ

    Updated Feb 26, 2026

> Tags

Pythonagentaidata-visualizationdatabase

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Categoryๆ•ฐๆฎๅบ“
PricingOpen source

> Related tools

P
PostgreSQL
ๅŠŸ่ƒฝๅผบๅคง็š„ๅผ€ๆบๅ…ณ็ณปๅž‹ๆ•ฐๆฎๅบ“
R
Redis
ๅ†…ๅญ˜ๆ•ฐๆฎ็ป“ๆž„ๅญ˜ๅ‚จ๏ผŒๅธธ็”จไฝœ็ผ“ๅญ˜ไธŽ้˜Ÿๅˆ—
M
MySQL
ๅนฟๆณ›ไฝฟ็”จ็š„ๅผ€ๆบๅ…ณ็ณปๅž‹ๆ•ฐๆฎๅบ“