Skip to content

feat: ai assistant with chat window#507

Merged
bluestreak01 merged 108 commits intomainfrom
feat/ai-assistant
Jan 2, 2026
Merged

feat: ai assistant with chat window#507
bluestreak01 merged 108 commits intomainfrom
feat/ai-assistant

Conversation

@emrberk
Copy link
Copy Markdown
Collaborator

@emrberk emrberk commented Dec 5, 2025

Summary

This PR introduces a comprehensive AI Assistant feature with an integrated chat window, enabling users to interact with AI models (Anthropic Claude & OpenAI GPT) directly within the QuestDB Web Console for SQL assistance, query explanations, and error fixing.

Features

AI Chat Window

  • Conversational AI interface in the right sidebar for natural language interactions
  • Chat history with persistent conversations stored in IndexedDB
  • Message streaming with real-time status indicators
  • Conversation compaction using LLM summarization to manage context window limits

Query Assistance

  • Explain Query - Get AI-powered explanations of SQL queries with a single click
  • Fix Query - Automatic error detection and AI-suggested fixes for failed queries
  • Schema Explanation - Explain table schemas with column descriptions and storage details
  • SQL Generation - Generate queries from natural language descriptions

Monaco Editor Integration

  • Glyph margin icons - AI sparkle icons in the editor gutter for quick access to AI features
  • Inline diff view - Review AI-suggested SQL changes before applying
  • Accept/Reject workflow - Easy application of AI suggestions to the editor
  • Query-specific conversations - Conversations are tied to specific queries in buffers

AI Provider Configuration

  • Multi-provider support - Anthropic (Claude) and OpenAI (GPT) models
  • Model selection - Choose from multiple models (Claude Sonnet 4.5, Opus 4.5, GPT-5.1, o3, o4-mini, etc.)
  • Settings and Configuration modals - Configure providers, enable/disable models, set defaults

Status & Feedback

  • AI Status Indicator - Shows current operation status (Processing, Compacting, Tool Use, etc.) when chat window is closed
  • Token usage display - Track input/output tokens per conversation

New Providers

  • AIConversationProvider - Manages conversation state, persistence, and operations
  • AIStatusProvider - Handles AI operation status and abort controls

Dependencies Added

  • @anthropic-ai/sdk - Anthropic Claude API client
  • openai - OpenAI API client
  • js-tiktoken - Token counting for context management
  • fflate - Compression for conversation storage
  • remark-gfm - GitHub-flavored markdown rendering
  • vite-plugin-wasm + vite-plugin-top-level-await - WASM support for tiktoken

Data Persistence

  • Conversation metas and messages are stored in IndexedDB. Messages are compressed
  • Settings stored in localStorage

QuestDB Integration

Testing

  • Comprehensive E2E test suite (aiAssistant.spec.js)

jerrinot and others added 30 commits August 4, 2025 19:45
also: model updated to Sonnet 4
…lection, fix sql query generation, improve error handling
…nts, highlight generated sql, position new sql at the end,
…'t retry requests unless required, remove api key format testing
@bluestreak01 bluestreak01 merged commit 4b5af35 into main Jan 2, 2026
3 checks passed
@bluestreak01 bluestreak01 deleted the feat/ai-assistant branch January 2, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants