Inspiration

Production incidents are one of the most stressful and expensive events in software engineering. Every minute of downtime costs money, and on-call engineers are routinely woken at 3 AM to manually correlate logs, metrics, deployment history, database health, and Kubernetes events — a context-switching nightmare that can take 30–60 minutes just to identify the root cause.

We asked: what if an AI agent could do in 90 seconds what takes a senior SRE 30 minutes? DevSentinel Agent was born from that question.

What it does

DevSentinel Agent is a fully autonomous production incident response system. When a service alert fires (via webhook or Cloud Monitoring), DevSentinel:

  1. Fans out to 8 observability sources in parallel — Cloud Monitoring metrics, Cloud Logging, Error Reporting, Kubernetes events, GitHub deployment history, Cloud SQL metrics, upstream dependency health, and BigQuery incident history — all queried simultaneously via asyncio.gather().
  2. Correlates all signals with Gemini — a structured SRE prompt feeds all 8 signal blobs to Gemini, which returns a JSON-typed RootCauseAnalysis with root cause, confidence score, blast radius, timeline, and recommended action — all in one inference call.
  3. Generates a step-by-step runbook automatically, ready for the on-call engineer to execute.
  4. Streams live updates to a React dashboard via Server-Sent Events, so the team watches the investigation unfold in real time.
  5. Auto-generates a post-mortem after resolution, capturing the full timeline and lessons learned.

The result: wall-clock investigation time drops from ~30 minutes to ~90 seconds.

How we built it

Backend: FastAPI (Python 3.12) orchestrates the parallel fan-out using asyncio.gather(), ensuring all 8 tool calls run concurrently — wall-clock time equals the slowest single tool, not their sum. Google Gemini (via the google-generativeai SDK) handles signal correlation with response_mime_type="application/json" and temperature=0.2 for deterministic, structured output. Server-Sent Events (SSE) push live investigation progress to the frontend.

Frontend: React 18 + TypeScript with Tailwind CSS renders a real-time incident dashboard. A custom FlameGraph component (built with D3 + Recharts) visualizes the 8-tool parallel execution timeline, making the agent's work transparent and auditable. Framer Motion animates state transitions.

AI Architecture: The core insight is that Gemini's role is correlation, not retrieval. Each specialized tool handles one data domain; Gemini receives all 8 structured signal blobs and reasons across them holistically — the same way a senior SRE would, but in milliseconds.

Infrastructure: Docker Compose for full-stack local deployment (backend on port 8000, frontend via nginx on port 3000). Designed for Cloud Run deployment with Firestore as the incident store.

Challenges we ran into

  • Structured JSON output from Gemini — getting reliable, schema-conforming JSON from an LLM at temperature=0.2 required careful prompt engineering. We used response_mime_type="application/json" and explicit Pydantic schema injection into the prompt to minimize hallucinated fields.
  • Async fan-out timing — coordinating 8 concurrent async tool calls with varied latencies, then reliably aggregating results before the Gemini call, required careful use of asyncio.gather() with proper error boundaries so one failing tool doesn't abort the whole investigation.
  • Demo reliability without live GCP — we needed the agent to demo convincingly without live GCP credentials. Building a high-fidelity deterministic mock layer (realistic payloads + simulated latency distributions) that falls back automatically when GEMINI_API_KEY is unset was critical for a smooth demo.
  • Real-time UI state management — SSE-driven live updates with React required careful state diffing on the backend to avoid sending redundant events, and debounced rendering on the frontend to prevent UI thrash during rapid state changes.

Accomplishments that we're proud of

  • 90-second end-to-end investigation from alert receipt to structured root-cause report with runbook — a genuine 20x speedup over manual investigation.
  • Zero-latency correlation: by parallelizing all 8 tool calls, total tool time is bounded by the slowest single call (~1.6s), not their sum (~7s). The architectural decision to use asyncio.gather() rather than sequential calls was central to this.
  • Full-stack real-time UX — the FlameGraph component gives engineers an auditable, visual record of exactly what the agent investigated and when, building trust in AI-generated root cause reports.
  • Graceful degradation — the system is fully demo-able with zero API keys or cloud credentials, falling back to a deterministic, high-quality mock pipeline automatically.

What we learned

  • Gemini excels at cross-domain reasoning — given rich, structured context from multiple sources, it produces SRE-quality analysis that would take a human engineer many minutes to synthesize manually.
  • The hardest part of agentic systems isn't the AI — it's building reliable, fast data retrieval pipelines that give the AI something worth reasoning about. The 8-tool parallel fan-out architecture was as much engineering work as the Gemini integration.
  • Structured output (response_mime_type="application/json") dramatically improves downstream reliability over regex-parsing free-form LLM text, especially in production systems where malformed output can cascade into failures.
  • SSE is underrated for AI agent observability — streaming live investigation state to a dashboard transforms a "black box" agent into a transparent, auditable system that engineers can trust.

What's next for DevSentinel Agent

  • Real GCP integrations — replace the current high-fidelity mocks with live Cloud Monitoring, Cloud Logging, Cloud SQL, and BigQuery API calls.
  • Gemini 2.5 Flash upgrade — leverage the extended context window and improved reasoning for multi-service incident correlation.
  • Firestore incident store — swap the in-memory store for Firestore, enabling persistent incident history and cross-session analytics.
  • Cloud Run deployment — one-click deploy with Cloud Run + Cloud Build CI/CD.
  • Slack integration — post root-cause summaries and runbook steps directly to the incident Slack channel with one-click action buttons.
  • Proactive anomaly detection — instead of waiting for alerts, continuously query Cloud Monitoring and trigger investigations when Gemini detects pre-incident patterns.

Built With

Share this project:

Updates

Submission history