MATIH Platform is in active MVP development. Documentation reflects current implementation status.
15. Workbench Architecture
BI Assistant

BI Assistant

The BI Assistant at frontend/bi-workbench/src/components/BIAssistant/ provides an AI-powered chat interface for natural language data exploration, chart suggestions, and query generation within the BI Workbench context.


BIAssistant

File: frontend/bi-workbench/src/components/BIAssistant/index.tsx

An AI chat interface integrated with the AI Service that understands the current dashboard context, semantic model, and data sources.

Features:

  • Natural language query to SQL generation
  • Chart type suggestions based on data shape
  • Dashboard modification suggestions
  • Contextual awareness of active filters and selected entities
  • Message history with SQL preview
  • Integration with AIApiClient for chat sessions
  • Streaming responses via SSE

Integration with AI Service

The BI Assistant uses the AIApiClient to:

  1. Create a chat session scoped to the current dashboard context
  2. Send messages with context about active filters, selected entities, and visible widgets
  3. Receive responses that may include:
    • Natural language explanations
    • Generated SQL queries
    • Visualization recommendations
    • Dashboard modification suggestions
const response = await clients.ai.chat({
  conversationId: sessionId,
  message: userMessage,
  context: {
    dashboardId: currentDashboard.id,
    activeFilters: filterState,
    selectedEntity: crossWorkbenchStore.selectedEntity,
  },
});