Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 2.97 KB

File metadata and controls

48 lines (39 loc) · 2.97 KB

Product Requirements Document: SQL Agent Studio

1. Vision & Purpose

SQL Agent Studio is an "Agent-First" IDE fork of VS Code OSS, engineered to modernize SQL Server database management. It moves beyond traditional "chat sidebars" by placing an autonomous AI agent at the center of the development experience via a "Mission Control" workspace.

2. Target Personas

2.1 Non-Technical Mode (Product/Business)

  • Profile: Product Managers, Operations Lead, Founders.
  • Experience: No-code/Natural Language interaction. Changes are presented as "Action Cards" with plain-English impact summaries.
  • Goal: Safe data exploration and business-logic updates without requiring T-SQL mastery.

2.2 Technical Mode (DBA/Engineer)

  • Profile: Database Administrators, Backend Engineers.
  • Experience: Pro-code interaction. Full script visibility, execution plan analysis, and performance telemetry.
  • Goal: Automation of complex migrations, performance tuning, and schema refactoring.

3. The "Mission Control" Workspace (Core UI)

The Mission Control is the primary full-screen tab of the IDE.

  • Reasoning Graph: A live node-based visualization (React Flow) showing the Agent's thought process (e.g., Analyzing Constraints -> Checking Buffer Pool -> Validating Migration).
  • Context Pinboard: A side-panel allowing users to drag-and-drop specific tables/views into the Agent’s "High-Priority Memory."
  • Artifacts Panel: A dedicated space for reviewing and commenting on generated "Implementation Plans."

4. Functional Requirements

4.1 The Clarification Loop (State Machine)

  • Certainty Threshold: The Agent must pause if intent certainty is below 90%.
  • Ambiguity Detection: Mandatory prompts for clarification on Table Subject, Action Type, or WHERE clause scope.

4.2 The 5-Step Implementation Plan

No write operation can execute without a plan containing:

  1. Summary: Business and technical goal.
  2. Prerequisites: Dependencies, permissions, and backup status.
  3. Implementation: The actual T-SQL scripts.
  4. Validation: Automated "post-check" queries to verify success.
  5. Rollback: A "one-click" script to revert all changes.

4.3 Agent Connectivity (MCP)

  • The IDE utilizes the Model Context Protocol (MCP) to expose SQL Server capabilities (DDL, Query Exec, Plan Analysis) to the LLM.

5. Technical Architecture

  • Shell: VS Code OSS distribution (custom fork).
  • SQL Service: Bundled vscode-mssql extension.
  • Orchestration: Gemini 3 Flash (Primary) / Gemini 3 Pro (High-Reasoning Escalation).
  • Data Auth: Support for Local SQL Express (Windows Auth) and Azure SQL (Microsoft Entra ID).

6. Safety & Security

  • Transaction Wrapping: All AI-generated scripts must run within a BEGIN TRANSACTION block.
  • Shadow Branching: Ability to create a Database Snapshot for plan verification before production execution.
  • Data Masking: Automatic detection and masking of PII in Agent responses for Non-Technical users.