First Query
The First Query page provides an interactive, guided demonstration of the MATIH conversational analytics experience. Users compose their first natural language question, see the AI generate SQL, visualize results, and experience the full query lifecycle in a supported environment.
Page Layout
The First Query page (FirstQueryPage.tsx) is divided into two panels:
| Panel | Content |
|---|---|
| Left (guidance) | Step-by-step instructions, suggested queries, tips |
| Right (interactive) | Chat interface with embedded results panel |
Guided Experience
The page walks users through the query lifecycle in four stages:
Stage 1: Ask a Question
The user types a natural language question in the chat input. Suggested queries are provided based on the connected schema or sample dataset:
| Persona | Suggested Queries |
|---|---|
| Data Analyst | "What were our top 10 products by revenue last month?" |
| Data Engineer | "Show me tables with the most null values" |
| ML Engineer | "What features are most correlated with customer churn?" |
| Executive | "How does this quarter compare to last quarter?" |
| Developer | "List all API endpoints and their response times" |
Stage 2: Watch the AI Work
The interface shows the agent pipeline processing the query in real-time:
| Step | Display |
|---|---|
| Intent classification | "Understanding your question..." |
| Schema retrieval | "Finding relevant tables..." |
| SQL generation | "Writing SQL query..." with syntax highlighting |
| Execution | "Running query..." with progress indicator |
| Visualization | "Creating visualization..." |
Stage 3: Explore Results
Results are displayed with interactive elements:
interface QueryResult {
sql: string;
data: {
columns: string[];
rows: any[][];
};
visualization: {
type: string;
config: object;
};
insights: string[];
explanation: string;
}| Element | Interaction |
|---|---|
| SQL query | Expandable code block with copy button |
| Data table | Sortable columns, pagination |
| Chart | Interactive chart with hover tooltips |
| Insights | AI-generated observations about the data |
Stage 4: Refine and Follow Up
Users are encouraged to try refinement actions:
| Action | Example |
|---|---|
| Modify filter | "Show only US customers" |
| Change chart | Click to switch between bar, line, pie |
| Drill down | "Break this down by region" |
| Export | Download results as CSV or PNG |
Sample Dataset
For users who skipped the connection setup, a sample dataset is provided:
| Table | Rows | Description |
|---|---|---|
sample.orders | 10,000 | E-commerce order data |
sample.customers | 1,000 | Customer demographics |
sample.products | 200 | Product catalog |
sample.regions | 50 | Geographic regions |
Progress Indicators
Visual cues guide the user through the experience:
| Indicator | Purpose |
|---|---|
| Step counter | Shows current step (1 of 4) |
| Checkmarks | Completed steps are marked |
| Highlight pulse | Draws attention to the next interactive element |
| Tooltip hints | Contextual help on hover |
Completion
After completing the first query, the user sees a summary:
- Congratulations message
- Recap of what they accomplished
- Quick links to the main workbench, dashboard builder, and documentation
- Option to try more queries or proceed to the platform
Analytics
| Event | Description |
|---|---|
onboarding.first_query.view | User reached the first query page |
onboarding.first_query.suggested | User selected a suggested query |
onboarding.first_query.custom | User typed a custom query |
onboarding.first_query.complete | User completed the first query |
onboarding.first_query.refine | User tried a follow-up refinement |