- π Live Hosted Application (Google Cloud Run): https://streamguard-ai-793289044855.us-central1.run.app
- π Source Code Repository: https://github.com/Shrushti72/StreamGuard-AI
StreamGuard AI is an autonomous, agentic AI reliability and continuity supervisor built for cinema, OTT, and live video-streaming platforms.
Built for the Google Cloud Agentic Cinema: The Blockbuster Hackathon (Grafana Labs Track), StreamGuard AI replaces manual dashboard hunting during major movie premieres, live cinema events, or esports streams. It autonomously correlates Grafana Cloud observability telemetry with Confluent Kafka event streams using Google Agent Development Kit (ADK) and Gemini 2.5/3.6 to reason over operational evidence in real time.
Instead of requiring engineers to manually inspect dozens of disconnected dashboards, Loki logs, Prometheus metrics, alerts, and event topics under intense pressure, StreamGuard AI executes a multi-source investigation and delivers an evidence-based operational report.
It answers the critical operational questions:
"What is failing? Where is it failing? What evidence supports the diagnosis? What might be causing it? How many viewers could be affected? And what should the operator investigate next?"
Modern OTT and cinema streaming pipelines involve complex, multi-tier infrastructure:
Ingest Pipeline β Transcoding Clusters β Origin Infrastructure β Regional CDN Egress β Edge Nodes β Viewer Playback
During high-demand movie releases or live broadcasts, infrastructure problems rapidly propagate into viewer-facing incidents (buffering, dropped frames, transcode queue saturation, 5xx gateway errors).
Traditional monitoring tools provide raw data, but SRE teams still have to manually correlate signals across disparate systems under extreme time pressure.
The real operational challenge is not simply:
"Is CPU utilization high?"
It is:
"Is the streaming experience degrading, where is it happening, what evidence explains it, and what exact steps should the SRE team take next?"
βββββββββββββββββββββββββββββββββββββββββββββ
β Operator Request / Autonomous Goal β
β "Investigate current streaming health" β
βββββββββββββββββββββββ¬ββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββ
β StreamGuard AI Root Agent β
β (Google ADK + Gemini) β
βββββββββββββββββββββββ¬ββββββββββββββββββββββ
β
βββββββββββββββββββββ΄ββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β Broadcast Monitoring Agentβ β Event Streaming Agent β
ββββββββββββββ¬βββββββββββββββ ββββββββββββββ¬βββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β Grafana Cloud MCP β β Confluent MCP β
β (grafana/mcp-grafana) β β (Kafka Stream Health) β
ββββββββββββββ¬βββββββββββββββ ββββββββββββββ¬βββββββββββββββ
β β
βββββββββ΄ββββββββ βββββββββ΄ββββββββ
βΌ βΌ βΌ βΌ
Prometheus Metrics Loki Logs Kafka Topics Stream Events
β β β β
βββββββββββββββββ΄ββββββββββββ¬ββββββββββββ΄ββββββββββββββββ
β
βΌ
Multi-Source Correlation
β
βΌ
3-Tier Evidence Engine
(Verified | Derived | Hypotheses)
β
βΌ
Closed-Loop Grafana Write-Back
(Dashboard Event Annotations #ANN)
StreamGuard AI uses specialized Google ADK agents to isolate operational concerns:
- Root Agent: Accepts the operator goal, orchestrates subagent handoffs, synthesizes evidence, and generates final operational reports.
- Broadcast Monitoring Agent: Specializes in Grafana Cloud observability via
grafana/mcp-grafana. - Event Streaming Agent: Specializes in Confluent Kafka event topic discovery and message stream analysis.
Demonstrates active runtime usage of the official Grafana MCP Server:
- PromQL Metrics (
query_prometheus): Queries ingest CPU load, transcode queue depth, CDN egress bandwidth, and viewer buffer ratios. - LogQL Logs (
query_loki_logs): Inspects 5xx HTTP gateway timeouts and transcode drop-frame stack traces. - Incidents API (
list_incidents,create_grafana_incident): Inspects and opens official Grafana incidents.
Inspects the event-streaming layer:
- Discovers Kafka topics (
stream-health,continuity-alerts,broadcast-incidents). - Inspects schema subjects and consumes real-time stream-health events.
- Correlates Kafka stream drops with Grafana telemetry.
Prevents assumptions from being presented as confirmed telemetry by categorizing findings into:
- β
Verified Evidence: Direct telemetry returned by Grafana or Confluent tools (e.g.
Transcode CPU > 94%). - π Derived Observations: Cross-system correlated patterns (e.g.
CPU spikes coincide with dropped frames 2m later). β οΈ Hypotheses: Possible explanations requiring further profiling (e.g.Background job competing for CPU).
Enforces strict tag validation: if telemetry lacks explicit region_id tags, the agent never invents regional claims, explicitly outputting a disclaimer instead.
When operational context is established, StreamGuard AI invokes annotate_grafana_dashboard to place event markers directly onto live Grafana SRE dashboards (#ANN-8924).
Makes the AI agent itself observable, tracking model calls, execution latency, token counts, and estimated cost in real-time.
flowchart TD
classDef operatorStyle fill:#0284c7,color:#fff,stroke:#0369a1,stroke-width:2px;
classDef agentStyle fill:#7c3aed,color:#fff,stroke:#5b21b6,stroke-width:2px;
classDef mcpStyle fill:#0ea5e9,color:#fff,stroke:#0369a1,stroke-width:2px;
classDef dataStyle fill:#d97706,color:#fff,stroke:#92400e,stroke-width:2px;
classDef engineStyle fill:#059669,color:#fff,stroke:#047857,stroke-width:2px;
classDef outputStyle fill:#db2777,color:#fff,stroke:#9d174d,stroke-width:2px;
Op["π€ Streaming Operator / Technical Director"]:::operatorStyle
RootAgent["π§ StreamGuard AI Root Agent"]:::agentStyle
ADK["β‘ Google ADK + Gemini (2.5 Flash / 3.6 Pro)"]:::agentStyle
subgraph AgentLayer ["π€ Multi-Agent Delegation Layer"]
BMAgent["π₯ Broadcast Monitoring Agent\n(Grafana Telemetry & Incidents)"]:::agentStyle
ESAgent["π‘ Event Streaming Agent\n(Kafka Topics & Event Streams)"]:::agentStyle
end
subgraph MCPLayer ["π Model Context Protocol (MCP) Integration"]
GrafanaMCP["π Grafana Cloud MCP Server\n(grafana/mcp-grafana)"]:::mcpStyle
ConfluentMCP["π Confluent Kafka MCP Server"]:::mcpStyle
end
subgraph DataLayer ["ποΈ Multi-System Observability Data"]
subgraph GrafanaCloud ["Grafana Cloud Platform"]
PromData["π Prometheus Metrics\n(CPU, Latency, Buffer Ratio, Frame Drops)"]:::dataStyle
LokiData["π Loki Logs\n(HTTP 502/504, Stack Traces)"]:::dataStyle
AlertData["π¨ Alert Groups & Incidents\n(Active Alerts, Severity)"]:::dataStyle
end
subgraph ConfluentCloud ["Confluent Cloud Kafka"]
KafkaTopics["π¬ Stream-Health Topics\n(stream-health, broadcast-incidents)"]:::dataStyle
KafkaSchema["π Schema Registry & Subjects"]:::dataStyle
KafkaMsgs["βοΈ Real-Time Kafka Event Messages"]:::dataStyle
end
end
subgraph ReasoningEngine ["π§ Evidence Correlation & RCA Engine"]
MultiCorr["π Cross-System Signal Correlation\n(CPU β Latency β Frame Drop β Buffering)"]:::engineStyle
EvidClass["π Evidence Classifier\n(Verified Evidence | Derived Obs | Hypotheses)"]:::engineStyle
RegSafety["π Regional Correlation Safety Evaluator\n(Strict Identifier Check)"]:::engineStyle
ReportGen["π Evidence-Based Operational Report Generator"]:::engineStyle
end
subgraph OutputLayer ["π€ Closed-Loop Actions & Observability"]
WriteBack["βοΈ Grafana Write-Back\n(Dashboard Event Annotations & Incident Logs)"]:::outputStyle
AgentO11y["π Grafana Agent Observability\n(Token Usage, Latency, Cost, Model Traces)"]:::outputStyle
OpReport["π Final Incident Investigation Report\n(Root Cause, Impact, Recommended Actions)"]:::outputStyle
end
Op --> RootAgent
RootAgent --> ADK
ADK --> BMAgent
ADK --> ESAgent
BMAgent --> GrafanaMCP
ESAgent --> ConfluentMCP
GrafanaMCP --> PromData & LokiData & AlertData
ConfluentMCP --> KafkaTopics & KafkaSchema & KafkaMsgs
PromData & LokiData & AlertData --> MultiCorr
KafkaTopics & KafkaMsgs --> MultiCorr
MultiCorr --> EvidClass --> RegSafety --> ReportGen
ReportGen --> OpReport & WriteBack
ADK --> AgentO11y
StreamGuard-AI/
β
βββ backend/ # FastAPI Service Backend & MCP Connectors
β βββ app/
β β βββ agents/ # Google ADK Agent definitions & prompts
β β βββ mcp/ # Grafana Cloud & Confluent MCP integrations
β β βββ simulator/ # Live telemetry anomaly injector
β βββ main.py # Entry point server
β βββ requirements.txt
β
βββ frontend/ # StreamGuard AI Director Console UI
β βββ index.html # Live dashboard interface
β βββ css/
β βββ js/
β
βββ diagrams/ # High-resolution SVG/PNG/PDF architecture diagrams
β βββ StreamGuard_AI_Architecture_Diagrams.pdf
β βββ Architecture_Flowcharts_Interactive.html
β βββ Sequence_Flow_Interactive.html
β βββ StreamGuard_AI_Architecture_Diagram_Clean.png
β
βββ streamguard_agent/ # ADK Web Agent definition package
β βββ agent.py
β
βββ .gcp/ # Google Cloud Run deployment scripts
β βββ deploy.sh
β
βββ Dockerfile # Container build definition
βββ requirements.txt # Python dependencies
βββ README.md # Documentation
βββ LICENSE # MIT License
- Python 3.11+
- Google Cloud Project with Vertex AI / Gemini API enabled
- Grafana Cloud Account + Service Account Token
- Confluent Cloud Account + API Credentials
git clone https://github.com/Shrushti72/StreamGuard-AI.git
cd StreamGuard-AI
pip install -r requirements.txtCreate a .env file or export environment variables:
# Gemini / Vertex AI Credentials
export GEMINI_API_KEY="your-gemini-api-key"
# Grafana Cloud Credentials
export GRAFANA_URL="https://your-instance.grafana.net"
export GRAFANA_SERVICE_ACCOUNT_TOKEN="your-grafana-token"
# Confluent Cloud Credentials
export CONFLUENT_API_KEY="your-confluent-key"
export CONFLUENT_API_SECRET="your-confluent-secret"
# Grafana Agent Observability Credentials
export AGENTO11Y_ENDPOINT="https://otlp-gateway.grafana.net"
export AGENTO11Y_AUTH_TOKEN="your-agent-o11y-token"adk web streamguard_agent \
--host 0.0.0.0 \
--port 8080Open http://localhost:8080 to access the StreamGuard AI Director Console.
Deploy serverless to Google Cloud Run using Google Cloud Secret Manager for credentials:
# Submit build to Google Cloud Artifact Registry
gcloud builds submit --tag gcr.io/$PROJECT_ID/streamguard-ai
# Deploy to Cloud Run with injected secrets
gcloud run deploy streamguard-ai \
--image gcr.io/$PROJECT_ID/streamguard-ai \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--set-secrets="GRAFANA_SERVICE_ACCOUNT_TOKEN=grafana-token:latest,CONFLUENT_API_SECRET=confluent-secret:latest"| Component / Feature | Technology Stack | Status |
|---|---|---|
| Agent Reasoning Engine | Google Gemini 2.5 Flash / 3.6 Pro | β Verified |
| Multi-Agent Orchestration | Google Agent Development Kit (ADK) | β Verified |
| Cloud Hosting | Google Cloud Run (us-central1) |
β Live & Deployed |
| Grafana Metrics (PromQL) | Grafana Cloud MCP (query_prometheus) |
β Verified |
| Grafana Logs (LogQL) | Grafana Cloud MCP (query_loki_logs) |
β Verified |
| Grafana Write-Back | Grafana Cloud MCP (annotate_grafana_dashboard) |
β Verified |
| Kafka Event Streaming | Confluent MCP (consume_kafka_messages) |
β Verified |
| AI Agent Observability | Grafana Agent Observability (OTLP) | β Verified |
| Credential Security | Google Cloud Secret Manager | β Configured |
This project is licensed under the MIT License. See the LICENSE file for details.
Shrushti Wakchaure β Built for the Google Cloud Agentic Cinema: The Blockbuster Hackathon.
Special thanks to Google Cloud and Grafana Labs for providing the ADK framework and official Grafana Cloud MCP Server integrations.