DBWhisper - AI-powered database intelligence assistant
DBWhisper is an AI-powered Database Intelligence Assistant for Visual Studio Code.
It is not intended to be another database explorer. The goal is to help developers understand what a database does, how its tables relate, and how to work with SQL using natural language, documentation, diagrams, and editor assistance.
Vision
DBWhisper is being built for questions developers ask when they inherit or work inside unfamiliar databases:
- What does this database do?
- Which tables store customer, invoice, payroll, or audit information?
- How are these tables related?
- What does this SQL query mean?
- How can this query be optimized?
- What SQL should I write for this business question?
- What documentation can be generated from this schema?
- Which relationships exist even when foreign keys are missing?
The product direction is database intelligence first, database browsing second.
Current Status
DBWhisper now ships with a working AI chat experience, provider management, and database-aware context:
- AI Chat panel with Markdown rendering, syntax highlighting, Mermaid diagrams, streaming responses, copy buttons, retry, stop generation, and theme-aware UI
- Chat sessions with AI-generated titles, edit previous prompt, and regenerate response
- Chat history sidebar grouped by Today / Yesterday / Last 7 Days / Last Month / Pinned / Archived with search
- SQLite-based persistence for sessions, messages, and attachments — no chat history is lost on restart
- Provider management with secure API key storage in VS Code SecretStorage
- Real AI providers: Ollama (local) and OpenAI (cloud) with streaming and cancellation
- Provider settings webview for adding, editing, deleting, testing, enabling, and defaulting providers
- Database context: attach SQLite databases, introspect schema, and automatically inject relevant schema details into AI prompts
- Token-budget-aware context trimming for long conversations
- File attachments (SQL, Markdown, CSV, schema, execution plans, diagrams, logs)
- Slash commands (
/help, /schema, /tables, /sql, /optimize, /explain, /docs, /history, /provider, /model, /export, /clear)
- Keyboard shortcut:
Ctrl+L to open chat
Also includes the production foundation:
- Extension activation and lifecycle wiring
- Strict TypeScript project setup
- esbuild bundling
- ESLint and Prettier configuration
- Dependency injection container
- Typed configuration service
- Output logging
- Status bar security-mode indicator
- 49 passing unit tests
Features
AI Chat
The chat panel is the central experience. It supports:
- Modern message bubbles with role indicators
- Markdown rendering with SQL syntax highlighting
- Mermaid diagram rendering
- Streaming responses with typing indicators
- Copy and Copy SQL buttons
- Retry last prompt
- Stop generation mid-stream
- Edit previous prompt (truncates subsequent messages and regenerates)
- Regenerate assistant response
- Token usage and response time display
- Collapsible reasoning section
- File attachments with remove buttons
Chat Sessions
Every conversation stores:
- Unique ID, title, created and updated dates
- Active provider, connected database, and model
- Tags and message count
- Pinned, favorite, and archived flags
Session titles are automatically generated by AI after the first prompt.
Provider Management
Providers are managed through a dedicated settings webview:
- Add, edit, delete, and test provider connections
- Set default provider
- Enable or disable individual providers
- API keys stored securely in VS Code SecretStorage — never in
settings.json
Supported providers (configured and ready to use):
- Ollama (local) — Llama 3.1, Code Llama, Qwen 2.5
- OpenAI (cloud) — GPT-5, GPT-5 Mini
- Azure OpenAI (cloud) — with API version support
Additional providers planned: Anthropic Claude, Google Gemini, OpenRouter, LM Studio, DeepSeek.
Database Context
Attach a SQLite database to any chat session to give the AI schema-aware context:
- Introspects tables, columns, primary keys, foreign keys, and indexes
- Automatically selects relevant tables based on the user prompt
- Injects a formatted schema summary into the AI prompt without sending the entire schema
- Switch or detach databases mid-conversation via the database dropdown
Commands for managing database connections:
DBWhisper: Add Database Connection — select a SQLite file to register
DBWhisper: Connect to Database
DBWhisper: Disconnect from Database
DBWhisper: Delete Database Connection
Context Management
DBWhisper does not send the entire conversation on every request:
- Token-budget-aware context trimming keeps the most recent messages
- Schema context is built from only the relevant tables for the current prompt
- Attachments are formatted and included with size limits (512 KB max)
Commands
Current commands:
DBWhisper: Show Output
DBWhisper: Open Settings
DBWhisper: Show Security Mode
DBWhisper: Open AI Chat
DBWhisper: New Chat
DBWhisper: Rename Chat Session
DBWhisper: Delete Chat Session
DBWhisper: Toggle Pin Chat Session
DBWhisper: Clear Chat Session
DBWhisper: Open AI Provider Settings
DBWhisper: Add Database Connection
DBWhisper: Delete Database Connection
DBWhisper: Connect to Database
DBWhisper: Disconnect from Database
Configuration
The extension exposes these settings:
dbwhisper.security.mode: private, local, or cloud
dbwhisper.security.requireSchemaUploadApproval
dbwhisper.security.maskSensitiveNames
dbwhisper.ai.provider
dbwhisper.ai.model
dbwhisper.cache.enabled
dbwhisper.cache.maxSchemaAgeMinutes
dbwhisper.telemetry.enabled
dbwhisper.logging.level
Database Roadmap
Implemented:
- SQLite (read-only introspection, schema context)
Planned:
- PostgreSQL
- MySQL
- SQL Server
- Oracle
The architecture is designed to allow future adapters for Snowflake, Redshift, BigQuery, ClickHouse, and DuckDB.
Security Posture
DBWhisper is designed around a conservative default:
- It should not upload database data automatically.
- Schema upload should require explicit approval unless enterprise policy allows otherwise.
- Local-only mode should restrict AI work to local providers.
- Cloud mode should still pass through approval and masking gates.
- Sensitive object names should be maskable before provider calls.
- Query execution should be treated as a separate high-trust capability, not an implicit side effect of SQL generation.
Planned Capabilities
Features still on the roadmap:
- Full-text search across conversations (title, message, SQL, tables, provider, database, tags)
- Export conversations as Markdown, HTML, JSON, and PDF
- Prompt library with built-in and custom reusable prompts
- AI actions per response (Insert into Editor, Execute SQL, Explain, Optimize, Create Diagram, Save as Documentation)
- Additional keyboard shortcuts and command palette integration
- Editor Hover and CodeLens providers
- Security policy engine with approval gates and masking
License
Apache License
| |