AI Assistant & Incident Response
Learn how StackPilot's AI assistant analyzes incidents and generates automated responses.
StackPilot's AI assistant is the core of the platform, designed to accelerate incident response through intelligent analysis and automation.
How the AI Assistant Works
Real-Time Incident Analysis
When an incident occurs, StackPilot's AI immediately:
- Ingests alert data from your monitoring tools (PagerDuty, Sentry, Datadog)
- Correlates with recent changes by analyzing git commits, deployments, and PRs
- Analyzes stack traces to identify the specific code causing issues
- Suggests investigation paths based on similar past incidents
Code-Aware Root Cause Analysis
// Example: StackPilot identifies this pattern interface IncidentAnalysis { suspectCommit: { hash: string; author: string; timestamp: Date; changedFiles: string[]; prNumber: number; }; errorPattern: { stackTrace: string; errorType: "NullPointerException" | "TimeoutError" | "ConnectionError"; frequency: number; affectedUsers: number; }; suggestedQueries: string[]; confidence: number; // 0-100% }
Log Query Generation
StackPilot automatically generates relevant log queries based on:
- Error patterns in stack traces
- Timing correlations with deployments
- User impact metrics from your monitoring tools
- Historical patterns from similar incidents
Example auto-generated queries:
# Datadog query for timeout errors service:api status:error "TimeoutException" @timestamp:[now-1h TO now] # Sentry query for specific error release:v3.8.1 error.type:"NullPointerException" environment:production # Custom log query for user impact level:ERROR user_id:abc123 OR user_id:def456 "ImageProcessor.optimize"
Incident Response Workflow
1. First Response (< 30 seconds)
- StackPilot joins incident Slack channel
- Posts initial analysis with suspect commits and error context
- Suggests immediate investigation steps
2. Interactive Investigation
- Engineers can ask StackPilot natural language questions:
- "Show me logs for affected users"
- "What changed in the image processing code?"
- "How many users are impacted?"
- AI suggests next investigation steps based on findings
3. Timeline Generation
- Automatically builds incident timeline
- Tracks all engineer actions and findings
- Correlates events across multiple tools
- Updates in real-time as investigation progresses
4. Fix Generation (Pro Feature)
When confident about root cause, StackPilot can:
- Analyze the faulty code patterns
- Generate a proposed fix based on best practices
- Create a pull request with detailed explanation
- Include relevant test updates
AI Learning & Improvement
Team-Specific Learning
- Pattern Recognition: Learns your codebase's common failure modes
- Investigation Preferences: Adapts to your team's investigation style
- Tool Integration: Optimizes queries for your specific monitoring setup
Feedback Integration
- Fix Success Rate: Tracks whether generated fixes resolve incidents
- Investigation Efficiency: Measures time-to-resolution improvements
- False Positive Reduction: Learns from incorrect correlations
Privacy & Security
- Data Retention: Incident data is retained per your team's policy
- Code Analysis: Only analyzes public repository data and connected tools
- Sensitive Data: Automatically redacts credentials and personal information
Configuration Options
AI Sensitivity Settings
interface AIConfig { autoJoinChannels: boolean; // Auto-join incident Slack channels confidenceThreshold: number; // Minimum confidence for suggestions (0-100) maxSuggestions: number; // Number of queries/actions to suggest learningMode: 'aggressive' | 'conservative' | 'disabled'; }
Integration Behavior
- Slack Notifications: Configure when and how AI posts updates
- GitHub PR Creation: Set automatic vs. manual PR generation
- Log Retention: Configure how long investigation data is stored
- Team Mentions: Configure which team members to alert for different incident types
The AI assistant learns continuously from your team's incident response patterns, becoming more accurate and helpful over time while maintaining full transparency about its analysis and suggestions.