Master AI Chat
Master AI Assistant
The Master AI Chat is a centralized, context-aware conversational interface designed to act as a Senior Architect for your eKuiper deployment. Unlike generic chatbots, the Master AI Assistant has a "Global View" of your entire edge computing environment, allowing you to perform complex analysis and troubleshooting using natural language.
Global Context Awareness
The assistant automatically ingests and analyzes the following data points to provide accurate responses:
- System Health: CPU usage, memory consumption, uptime, and versioning.
- Rule Engine State: Complete list of rules, their current execution status, and real-time metrics (messages in/out, error counts).
- Data Schema: Definitions for all Streams and Tables, including field types and source configurations.
- Infrastructure: Available source/sink templates, shared connections, and service configurations.
- Live Trace Data: Deep analysis of recent rule traces, including specific attribute values (e.g., detecting specific sensor values within JSON payloads).
Key Capabilities
1. System-Wide Troubleshooting
The assistant can identify why rules are failing or underperforming by correlating metrics across multiple components.
- Example Prompt: "Why are all my MQTT-based rules showing exceptions right now?"
- AI Action: The assistant checks shared connections and source configurations to see if a specific broker is unreachable.
2. Natural Language Rule Generation
Create complex stream processing logic without writing manual SQL.
- Example Prompt: "Create a rule that monitors the 'factory_temp' stream. If the temperature exceeds 80 degrees for more than 3 consecutive readings, send an alert to the 'maintenance' MQTT topic."
- AI Action: Generates the SQL, suggests a
ruleId, and configures the appropriate MQTT sink.
3. Deep Metric & Log Analysis
The assistant can parse stringified JSON within rule traces to find specific values.
- Example Prompt: "Scan the latest logs for Rule 'AlertSystem' and tell me the highest 'active_power' value recorded."
- AI Action: Parses trace attributes, extracts the metric, and provides a summary.
4. Performance Optimization
Identify bottlenecks and suggest efficient alternatives for your queries.
- Example Prompt: "Analyze my active rules and tell me which ones are dropping the most messages and how to fix them."
Using the Master Chat
To interact with the Master AI, navigate to the AI Assistant section in the sidebar.
Supported Models
The manager leverages OpenRouter to provide access to cutting-edge LLMs. You can toggle between models based on your needs:
- Google Gemini 1.5 Flash: Recommended for fast, efficient analysis of logs and metrics.
- Meta Llama 3.3: Excellent for complex architectural advice and rule generation.
- Mistral/Qwen: Specialized models for coding and SQL optimization.
Integration API
If you are extending the manager or interacting via API, the Master Chat endpoint expects a structured context:
// POST /api/ai/master-chat
{
"messages": [
{ "role": "user", "content": "Analyze the health of my eKuiper node." }
],
"modelName": "google/gemini-flash-1.5",
"context": {
"systemInfo": { ... },
"streams": [ ... ],
"rules": [ ... ],
"traceData": [ ... ]
}
}
Response Format: The assistant returns a JSON object containing markdown-formatted analysis:
{
"message": "## System Analysis\nYour system is currently healthy, but Rule **'HighTempFilter'** has a 15% drop rate..."
}
Security & Privacy
- Local Processing: While the UI is open-source, the AI processing happens via OpenRouter. Ensure your OpenRouter API key is configured in your environment variables.
- Data Masking: The assistant analyzes metadata and metrics. It is recommended not to include sensitive credentials in your Stream/Rule descriptions, as these are passed to the LLM context for better troubleshooting.