Skip to content

bringing ai with tweaks to db:studio#97

Open
Mahmoudgalalz wants to merge 4 commits intohusamql3:stagefrom
Mahmoudgalalz:feat/ai
Open

bringing ai with tweaks to db:studio#97
Mahmoudgalalz wants to merge 4 commits intohusamql3:stagefrom
Mahmoudgalalz:feat/ai

Conversation

@Mahmoudgalalz
Copy link
Contributor

@Mahmoudgalalz Mahmoudgalalz commented Jan 30, 2026

  • feat: Database introspection, AI context & BYOC settings
    Adds database introspection as context for AI chat, optional BYOK (Bring Your Own Key) proxy URL, a Settings UI for AI options, and context-aware “Generate with AI” + “Insert into editor” in the query tab.≈

Architecture diagram (high level)

image

Implementation

  1. Personal AI provider credentials and model selection
  2. Suggest faster ways to write queries and show how much quicker they’ll run
  3. Ask questions in normal English and get instant answers
  4. Spot errors in failed queries and suggest quick fixes
  5. Run queries in sandbox [ Very Important move ]
  • Add sandbox query execution (POST /query/sandbox, transaction + rollback)
  • Add suggest-fix for failed queries (structured errors, POST /chat/suggest-fix, UI)
  • Support OpenAI/Anthropic/Gemini in settings and chat (provider, model, optional API keys)
  • Auto-run chat SQL in sandbox and show result inline
  • Add query analyze (EXPLAIN) and suggest-optimization with timing comparison in runner
  • Fix proxy adapter calls (createOpenaiChat/createAnthropicChat model, apiKey order)
  • Fix query route chaining, ApiErrorType 400|500, ExecuteQueryResult types

@Mahmoudgalalz
Copy link
Contributor Author

@husamql3, your AI roadmap is done, smart boy

I suggest more enhancements on it using RAG and more context awareness, but this does the job for now, and it could be easily enhanced in the future.

@husamql3 husamql3 changed the base branch from main to stage January 30, 2026 06:18
@husamql3
Copy link
Owner

Thanks a lot for the contribution, I can see a huge progress here ❤️

It's kinda a big one so it's taking a bit to merge, I'm on it

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.

2 participants