Web Chatbot User Guide¶
Overview¶
The Datus Web Chatbot provides a user-friendly web interface for interacting with the Datus AI assistant. Built on Streamlit, it offers an intuitive chat experience for natural language to SQL conversion without requiring command-line knowledge.
Quick Start¶
Launch the Web Interface¶
With Namespace:
With Custom Configuration:
Custom Port and Host:
The web interface will automatically open in your browser at http://localhost:8501
(or your specified port).
Main Features¶
1. Interactive Chat Interface¶
Natural Language Queries:
Simply type your question in plain language, and the AI will generate SQL and execute it.
Example:
The assistant will:
- Understand your question
- Generate the appropriate SQL query
- Display the SQL with syntax highlighting
- Show the AI's explanation
2. Subagent Support¶
Access specialized subagents for different tasks directly from the web interface.
Available Subagents (shown in expandable section):
gen_semantic_model
: Generate semantic models from database tablesgen_metrics
: Convert SQL queries to MetricFlow metricsgen_sql_summary
: Analyze and classify SQL queries
How to Use:
- Click "🔧 Access Specialized Subagents" on the main page
- Select the subagent you need
- Click "🚀 Use [subagent_name]"
- Chat with the specialized assistant
Direct URL Access:
You can bookmark subagent URLs for quick access:
3. Session Management¶
View Session History:
The sidebar shows your recent chat sessions with:
- Session ID (shortened)
- Creation time
- Message count
- Latest user message preview
Load Previous Sessions:
- Find the session in the sidebar
- Click "🔗 Load Session"
- View the conversation in read-only mode
Session Sharing:
Each session has a unique URL that can be shared:
4. Success Story Tracking¶
Mark Successful Queries:
When the AI generates a SQL query that works well:
- Review the generated SQL
- Click the "👍 Success" button
- The query is saved to
~/.datus/benchmark/[subagent]/success_story.csv
CSV Format:
session_link,session_id,subagent_name,user_message,sql,timestamp
http://localhost:8501?session=...,abc123...,chatbot,"Show revenue by category",SELECT ...,2025-01-15 10:30:00
This helps track effective queries for benchmarking and improvement.
5. Report Issues¶
Share Problems Easily:
- Click "🐛 Report Issue" in the sidebar
- Session link is automatically copied to clipboard
- Paste the link when reporting issues to developers
The session link includes full conversation context, making debugging easier.
Summary¶
The Datus Web Chatbot provides:
- User-Friendly Interface: No command-line knowledge needed
- Subagent Access: Specialized assistants for different tasks
- Session Management: Save, load, and share conversations
- Success Tracking: Mark and collect effective queries
- Easy Sharing: One-click session link copying
- Visual Execution: See step-by-step query generation
- Multi-Namespace Support: Switch between databases easily