BI Analytics Platform Overview
Production - Full BI analytics: chat sessions, dashboards, alerts, export, scheduling
The BI Analytics Platform provides conversational data analytics through a multi-agent orchestrator. Users interact through natural language chat sessions, and the system generates SQL, executes queries, performs analysis, and creates visualizations. The platform also includes dashboard management, alerting, scheduling, and data export.
12.4.1AnalyticsOrchestrator
The AnalyticsOrchestrator in data-plane/ai-service/src/bi/agents/orchestrator.py implements a state machine that coordinates five specialized agents:
class AnalyticsOrchestrator:
MAX_AGENT_VISITS = 10 # Prevent infinite loops
def __init__(self, sql_generator, query_executor, llm_client, schema_provider, session_store):
self._router = RouterAgent(llm_client=llm_client)
self._sql_agent = SQLAgent(sql_generator=sql_generator, query_executor=query_executor)
self._analysis_agent = AnalysisAgent(llm_client=llm_client)
self._viz_agent = VisualizationAgent()
self._docs_agent = DocumentationAgent(schema_provider=schema_provider)
self._agents = {
"router": self._router.classify,
"sql": self._sql_agent.generate,
"analysis": self._analysis_agent.analyze,
"visualization": self._viz_agent.generate,
"docs": self._docs_agent.respond,
}Agent Workflow
User Message -> Router Agent (classify intent)
|
+-- QUERY_DATA -> SQL Agent -> Visualization Agent
|
+-- ANALYZE -> SQL Agent -> Analysis Agent -> Visualization Agent
|
+-- VISUALIZE -> Visualization Agent
|
+-- HELP/SCHEMA -> Documentation Agent12.4.2Session Management
Sessions are persisted using Redis-backed storage with automatic fallback:
async def create_session(self, tenant_id, user_id=None, session_id=None):
session = ConversationSession(
session_id=session_id or str(uuid.uuid4()),
tenant_id=tenant_id,
user_id=user_id,
state=AgentState(session_id=session_id, tenant_id=tenant_id),
)
await store.save(session.to_session_data())
return session
async def process_message(self, session_id, message):
session = await self.get_session(session_id)
state = session.state
state.current_question = message
state.next_agent = "router"
state = await self._run_workflow(state)
return {
"success": len(state.errors) == 0,
"response": state.build_response(),
"sql": state.sql_context.sql,
"visualization": state.visualization_context.chart_spec,
"data": state.sql_context.result,
"insights": state.analysis_context.insights,
}12.4.3Section Pages
| Page | Description |
|---|---|
| Chat Sessions | Session creation, messaging, refinement, history |
| Dashboards | Dashboard CRUD, widgets, templates, cloning |
| Alerts | Alert creation, thresholds, notifications |
| Data Export | CSV, Excel, PDF, Parquet export |
| Query Filters | Dynamic filtering, filter management |
| Report Scheduling | Scheduled report delivery |
| Dashboard Sharing | Sharing permissions and access control |
| Visualization | Chart types, configuration, rendering |
| Real-Time Streaming | WebSocket streaming for live updates |