• Blog
  • Documentation
  • FAQ
  • Contact
Sign InBook a Demo

Your oncall copilot.

© Copyright 2025 StackPilot. All Rights Reserved.

About
  • Blog
  • Contact
Product
  • Documentation
Legal
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Getting started with StackPilot
    • Initial Setup & Integrations
  • User Management & Teams
    • AI Assistant & Incident Response
  • Tool Integrations

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:

  1. Ingests alert data from your monitoring tools (PagerDuty, Sentry, Datadog)
  2. Correlates with recent changes by analyzing git commits, deployments, and PRs
  3. Analyzes stack traces to identify the specific code causing issues
  4. 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.

  1. How the AI Assistant Works
    1. Real-Time Incident Analysis
    2. Code-Aware Root Cause Analysis
    3. Log Query Generation
    4. Incident Response Workflow
    5. AI Learning & Improvement
    6. Configuration Options