AI Compare
​
​
ToolsArticlesServices
Best for
    All tools

    Sales

    AI tools for finding leads, qualifying them, preparing quotes, following up and keeping the CRM up to date.

    Marketing

    AI tools for content, social media, images, video, SEO and campaigns.

    Customer service

    AI tools for answering customer emails, chats and calls, handling requests and escalating the hard cases.

    Operations

    AI tools for running the daily work: workflows, scheduling, projects, purchasing and delivery.

    Finance

    AI tools for invoices, bookkeeping, reconciliation, spreadsheets and financial reporting.

    Management & Admin

    AI tools for owners, managers and office staff: planning, reports, documents, meetings, scheduling and everyday admin.

    HR

    AI tools for hiring, screening candidates, onboarding, training and answering employee questions.

    Legal & Compliance

    AI tools for reviewing contracts, tracking deadlines and preparing compliance work for a qualified person to check.

    IT & Development

    AI tools for developers and IT teams: coding, AI models, agents, infrastructure and integrations.

Find AI tools for your team
AllAssistantsWriting & DocsImagesVideoAudioAI AgentsAutomationCode
← Back to tools

β€’

2023-05-13

vanna logo

vanna

Not rated yet

23.8K GitHub stars

Type:

Framework

Platforms:

Github

Task:

Engineer promptsBuild RAG systemsManage databasesChat with AIMonitor infrastructure

Best for:

IT & Development
Visit websiteView on GitHub

Pricing


Pricing information has not been added yet.

Overview

Vanna is an open-source framework for building natural-language interfaces to databases, especially text-to-SQL applications. It connects language models with database schemas, documentation, examples, and query execution so users can ask business questions in ordinary language and receive generated SQL and data-backed answers.

The framework is designed around retrieval-augmented generation for SQL: relevant schema information, documentation, and prior examples can be supplied to the model before it writes a query. Developers can connect different LLMs, vector stores, databases, and application interfaces, then add controls around query execution and result presentation.

Vanna is useful for analytics assistants, internal data tools, and embedded products where users need database access without writing SQL manually. Its modular architecture lets teams keep their existing data warehouse and model choices while adding a conversational layer on top.

README

Vanna 2.0: Turn Questions into Data Insights

Natural language β†’ SQL β†’ Answers. Now with enterprise security and user-aware permissions.

Python License Code style: black

https://github.com/user-attachments/assets/476cd421-d0b0-46af-8b29-0f40c73d6d83

Vanna2 Demo


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

<!-- Drop into any existing webpage -->
<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

Vanna2 Diagram


How It Works

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:

from fastapi import FastAPI
from vanna import Agent
from vanna.servers.fastapi.routes import register_chat_routes
from vanna.servers.base import ChatHandler
from vanna.core.user import UserResolver, User, RequestContext
from vanna.integrations.anthropic import AnthropicLlmService
from vanna.tools import RunSqlTool
from vanna.integrations.sqlite import SqliteRunner
from vanna.core.registry import ToolRegistry

# Your existing FastAPI app
app = FastAPI()

# 1. Define your user resolver (using YOUR auth system)
class MyUserResolver(UserResolver):
    async def resolve_user(self, request_context: RequestContext) -> User:
        # Extract from cookies, JWTs, or session
        token = request_context.get_header('Authorization')
        user_data = self.decode_jwt(token)  # Your existing logic

        return User(
            id=user_data['id'],
            email=user_data['email'],
            group_memberships=user_data['groups']  # Used for permissions
        )

# 2. Set up agent with tools
llm = AnthropicLlmService(model="claude-sonnet-4-5")
tools = ToolRegistry()
tools.register(RunSqlTool(sql_runner=SqliteRunner("./data.db")))

agent = Agent(
    llm_service=llm,
    tool_registry=tools,
    user_resolver=MyUserResolver()
)

# 3. Add Vanna routes to your app
chat_handler = ChatHandler(agent)
register_chat_routes(app, chat_handler)

# Now you have:
# - POST /api/vanna/v2/chat_sse (streaming endpoint)
# - GET / (optional web UI)

Then in your frontend:

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

from vanna.core.tool import Tool, ToolContext, ToolResult
from pydantic import BaseModel, Field
from typing import Type

class EmailArgs(BaseModel):
    recipient: str = Field(description="Email recipient")
    subject: str = Field(description="Email subject")

class EmailTool(Tool[EmailArgs]):
    @property
    def name(self) -> str:
        return "send_email"

    @property
    def access_groups(self) -> list[str]:
        return ["send_email"]  # Permission check

    def get_args_schema(self) -> Type[EmailArgs]:
        return EmailArgs

    async def execute(self, context: ToolContext, args: EmailArgs) -> ToolResult:
        user = context.user  # Automatically injected

        # Your business logic
        await self.email_service.send(
            from_email=user.email,
            to=args.recipient,
            subject=args.subject
        )

        return ToolResult(success=True, result_for_llm=f"Email sent to {args.recipient}")

# Register your tool
tools.register(EmailTool())

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 β€” support@vanna.ai

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

Releases

Release information has not been added yet.

Complete your AI stack

Add specialist tools for research, coding, visual content, video, and automation.

Perplexity logo
Perplexity
Research

AI-powered search and research assistant

View tool
Cursor logo
Cursor
Coding

AI coding editor and autonomous software development platform

View tool
Midjourney logo
Midjourney
Images

AI image and video generation with advanced personalization

View tool
Runway logo
Runway
Video

AI video generation and creative production platform

View tool
n8n logo
n8n
Automation

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

View tool
Best alternatives

Compare similar tools in the same category.

CodeRabbit logo

CodeRabbit

AI-powered code review assistant for pull requests.

OpenClaw logo

OpenClaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

Cursor logo

Cursor

AI coding editor and autonomous software development platform

DeepSeek logo

DeepSeek

AI assistant for reasoning, coding, research, and agent tasks

ECC logo

ECC

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

View all in this category
Help
Pick an answer below
Hi! I can point you to the right tool or guide. What are you looking for?
Browse all articles