[Feature Request] AI chatbot component with MCP database access
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, postgresql, sql, typescript
- Lĩnh vực
- ai, backend-api-design
Hướng nghiên cứu
The proposal describes a new external component in a separate sqlpage/sqlpage-chat repository, modeled on sqlpage-spreadsheet; no implementation files or tests are named. Start by reading the spreadsheet component and the SQLPage component integration documentation. Done would mean a design and implementation for the requested chat UI, API connectivity, conversation history, streaming, error handling, and optional MCP database access.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi @lovasoa
What are you building with SQLPage?
I'm building internal data dashboards and admin tools where business users need to ask natural-language questions about the underlying data — things like "what were the top products last month?" or "why did revenue drop on Tuesday?" SQLPage is a perfect fit for the UI layer, but users still need a conversational interface to explore data without writing SQL themselves.
What is your problem?
There's no native way to embed an interactive AI chatbot into a SQLPage app. Users who want a natural-language interface over their data have to leave the SQLPage paradigm entirely and build a custom frontend. This breaks the core promise of SQLPage — that you can build a full, useful web app with only SQL.
What are you currently doing?
Workarounds currently require:
- Writing a custom Typescript node widget outside of SQLPage's component system
- Setting up a separate backend proxy to forward messages to an AI API (to avoid exposing API keys in the browser)
- Manually managing conversation history in Typescript
- Wiring it all together with the
fetchcomponent or raw<script>tags in a shell component
This is brittle, hard to maintain, and out of reach for the non-developer audience SQLPage is designed for.
Describe the solution you'd like
An official external component — sqlpage-chat — modeled after sqlpage-spreadsheet, that renders a full chat UI and connects to any OpenAI-compatible HTTP API. Usage would be fully declarative via SQL:
SELECT 'sqlpage-chat' AS component,
'https://api.openai.com/v1/chat/completions' AS api_url,
'Bearer ' || $OPENAI_API_KEY AS authorization_header,
'gpt-4o' AS model,
'You are a helpful assistant for this sales dashboard.' AS system_prompt,
'Ask me anything about your data...' AS placeholder;
For richer use cases, it would be nice to support MCP (Model Context Protocol) so the AI can autonomously query the live database — rather than requiring the developer to pre-inject static context into the system prompt:
SELECT 'sqlpage-chat' AS component,
'https://api.anthropic.com/v1/messages' AS api_url,
'Bearer ' || $ANTHROPIC_API_KEY AS authorization_header,
'claude-sonnet-4-5' AS model,
'postgresql://user:pass@localhost/mydb' AS mcp_database_url,
'You are a SQL analyst. Use your tools to answer questions accurately.' AS system_prompt;
Key capabilities: streaming responses (stdio support initially), conversation history, error handling, and a clean chat bubble UI that inherits the SQLPage/Tabler theme.
Describe alternatives you've considered
- Injecting DB context into the system prompt via SQL subquery — works for small datasets but breaks on large schemas, gives the model stale data, and bloats the prompt on every turn.
- Using the
fetchcomponent — not interactive; it fires once on page load and doesn't support streaming or back-and-forth conversation. - Embedding an iframe — fully disconnects from SQLPage's auth, theme, and data layer; defeats the purpose.
- Building a standalone chatbot app separately — loses the tight integration with the SQLPage data layer and forces users to maintain two separate apps.
Additional context
- This would live in its own repo (
sqlpage/sqlpage-chat) as a CDN-hosted JS/TS bundle, following thesqlpage-spreadsheetpattern. - The component targets any OpenAI-compatible endpoint, making it provider-agnostic (OpenAI, Anthropic, Ollama, LM Studio, etc.).
- MCP is an open standard by Anthropic (https://modelcontextprotocol.io) now widely supported across AI providers and tools — it's the cleanest way to give the model live, structured access to the SQLPage database without custom tooling.
- API calls default to client-side for simplicity; a server-side proxy mode could be added for environments where API keys must stay server-side.
- Ngôn ngữ chính
- Rust
- Star
- 2.6k
- Fork
- 175
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sqlpage/SQLPage
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
sqlpage/SQLPage#1218 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
There is no convenient way to reproduce issuesCó thể đã có người làm @81reap đã nhận 26 ngày trước. Đang mởenhancement
sqlpage/SQLPage#1566 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Confusing sort interfaceCó thể đã có người làm @lovasoa đã nhận 74 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
sqlpage/SQLPage#1442 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Mutation Testing Results :: Dead Code + Missing TestsCó thể làm lại được @81reap đã nhận 61 ngày trước và không có pull request nào đang mở. Đang mở
sqlpage/SQLPage#1396 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sqlpage/SQLPage
Issue tương tự
-
CI/CD ignore-for-release
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
eclipse-ankaios/ankaios#844 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
symposium-dev/symposium#530 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày