Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’₯ Blast Radius AI

Know what breaks before you merge.

Blast Radius AI is a multi-agent GitHub App that automatically analyzes every pull request and commit to map the full blast radius of any code change β€” which files will break, which functions will degrade, and which areas are safe β€” before a single line reaches production.

The Problem

In a team codebase, a single renamed function, a changed API response shape, or a shifted database field can silently cascade into dozens of broken files. Code reviewers catch the change β€” they rarely catch the downstream impact. Teams ship, something breaks in production, and nobody knew it was coming.

Blast Radius AI solves this at the PR level, before merge.


What It Does

  • Intercepts every PR via a GitHub App webhook the moment it's opened or updated
  • Reads the diff and understands semantically what changed β€” not just line diffs, but what the change means (function renamed, API shape changed, field removed)
  • Scans the entire codebase to find every file that imports, calls, or depends on the changed entity
  • Classifies each impact as HIGH (will break), MEDIUM (may degrade silently), or LOW (minor effect)
  • Posts a blast radius report as a PR comment for the reviewer to see inline
  • Builds persistent agent memory β€” a growing knowledge base of fragile areas, high-risk functions, and past findings, committed to git after every analysis
  • Provides a real-time dashboard β€” a live feed of every analyzed PR, a codebase risk map, and the agent's full memory

Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          GitHub                                     β”‚
β”‚                                                                     β”‚
β”‚   Developer opens PR  ──►  GitHub App Webhook  ──►  FastAPI        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                                                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     LangGraph Pipeline                              β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Agent 1    β”‚    β”‚    Agent 2       β”‚    β”‚    Agent 3       β”‚  β”‚
β”‚  β”‚ Diff Reader │───►│ Impact Scanner   │───►│   Reporter       β”‚  β”‚
β”‚  β”‚             β”‚    β”‚                  β”‚    β”‚                  β”‚  β”‚
β”‚  β”‚ β€’ Fetch PR  β”‚    β”‚ β€’ Read memory    β”‚    β”‚ β€’ Write report   β”‚  β”‚
β”‚  β”‚   diff      β”‚    β”‚ β€’ Clone repo     β”‚    β”‚ β€’ Post PR commentβ”‚  β”‚
β”‚  β”‚ β€’ Identify  β”‚    β”‚ β€’ Search for     β”‚    β”‚ β€’ Update memory  β”‚  β”‚
β”‚  β”‚   semantic  β”‚    β”‚   usages         β”‚    β”‚ β€’ Commit to git  β”‚  β”‚
β”‚  β”‚   change    β”‚    β”‚ β€’ LLM evaluate   β”‚    β”‚                  β”‚  β”‚
β”‚  β”‚ β€’ Extract   β”‚    β”‚   each hit       β”‚    β”‚                  β”‚  β”‚
β”‚  β”‚   search    β”‚    β”‚ β€’ Score severity β”‚    β”‚                  β”‚  β”‚
β”‚  β”‚   terms     β”‚    β”‚                  β”‚    β”‚                  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚                    β”‚                       β”‚              β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                    Shared BlastRadiusState                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       Storage Layer                                 β”‚
β”‚                                                                     β”‚
β”‚   SQLite DB  ──►  Analysis results, impacted files, severity       β”‚
β”‚   Git Repo   ──►  .gitagent/memory/ committed after each PR        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Next.js Dashboard                                β”‚
β”‚                                                                     β”‚
β”‚   PR Analysis Feed  β”‚  Codebase Risk Map  β”‚  Agent Memory Viewer   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Multi-Agent Pipeline (Deep Dive)

The core of Blast Radius AI is a 3-agent LangGraph pipeline. Each agent has a dedicated role, a SOUL.md system prompt, and its own set of tools.

Agent 1 β€” Diff Reader

Role: Understand what semantically changed, not just which lines changed.

  • Fetches the raw unified diff from GitHub
  • Lists all changed files
  • Sends diff + file list to LLaMA 3.3 70B with a structured prompt
  • Returns a JSON object describing the semantic change:
{
  "change_type": "function_signature",
  "entity_name": "processPayment",
  "file": "services/payment.py",
  "before": "processPayment(amount, currency)",
  "after": "processPayment(amount, currency, idempotency_key)",
  "search_terms": ["processPayment", "process_payment"],
  "risk_level": "HIGH",
  "summary": "Added required idempotency_key param to processPayment"
}

Agent 2 β€” Impact Scanner

Role: Find every file in the codebase that will be affected by this change.

  • Reads .gitagent/memory/ to get known fragile areas and high-risk functions
  • Clones the repo locally (cached per session) using the GitHub App installation token
  • Searches the entire codebase for each search_term using pure Python (os.walk + re.compile)
  • For each match found, asks the LLM: "Given this change, will this specific usage break?"
  • Classifies each impacted file as HIGH / MEDIUM / LOW with a reason

Agent 3 β€” Reporter

Role: Format findings, communicate them, and persist learned knowledge.

  • Builds a structured markdown blast radius report
  • Posts it as a PR comment on GitHub so reviewers see it inline
  • Updates .gitagent/memory/high_risk_functions.md and fragile_areas.md
  • Appends a timestamped entry to past_findings.md
  • Commits all memory updates to git β€” giving a full audit trail

State Machine (LangGraph)

START
  β”‚
  β–Ό
node_diff_reader
  β”‚  Outputs: diff_content, semantic_change
  β–Ό
node_impact_scanner
  β”‚  Outputs: impacted_files[]
  β–Ό
node_reporter
  β”‚  Outputs: report, severity, impact_count
  β–Ό
node_save  ──►  SQLite  ──►  Dashboard
  β”‚
END

GitAgent Integration

This project is built on the GitAgent protocol β€” a standard for git-native AI agents where behavior, memory, and tools live inside the repository itself.

backend/
└── .gitagent/
    β”œβ”€β”€ agent1/
    β”‚   β”œβ”€β”€ SOUL.md      ← System prompt: "You are a code change analyst..."
    β”‚   β”œβ”€β”€ SKILL.md     ← Tool descriptions: fetch_diff, list_pr_files
    β”‚   └── agent.yaml   ← Model config: llama-3.3-70b-versatile, temp=0
    β”œβ”€β”€ agent2/
    β”‚   β”œβ”€β”€ SOUL.md      ← System prompt: "You are a dependency detective..."
    β”‚   β”œβ”€β”€ SKILL.md     ← Tool descriptions: search_codebase, read_memory
    β”‚   └── agent.yaml
    β”œβ”€β”€ agent3/
    β”‚   β”œβ”€β”€ SOUL.md      ← System prompt: "You are a technical communicator..."
    β”‚   β”œβ”€β”€ SKILL.md     ← Tool descriptions: post_pr_comment, update_memory
    β”‚   └── agent.yaml
    └── memory/
        └── {repo_owner}_{repo_name}/
            β”œβ”€β”€ high_risk_functions.md   ← Grows with every PR
            β”œβ”€β”€ fragile_areas.md
            └── past_findings.md

Why this matters: The agent's memory is not stored in a database β€” it lives inside the git repository as markdown files. Every time the agent learns something new about a codebase, it commits that knowledge. You get a full history of what the agent learned and when, just by running git log .gitagent/memory/.


Tech Stack

Layer Technology Purpose
LLM Groq β€” LLaMA 3.3 70B Versatile All three agent reasoning tasks
Agent Framework LangGraph + LangChain Multi-agent state machine, tool calling
Backend FastAPI + Python Webhook handler, REST API, async pipeline
GitHub Integration GitHub App (JWT + Installation Tokens) Webhook events, diff fetch, PR comments
Agent Protocol GitAgent (SOUL.md / SKILL.md / agent.yaml) Git-native agent identity and memory
Codebase Search Pure Python (os.walk + re.compile) Cross-platform file search, no grep needed
Database SQLite Analysis result persistence
Frontend Next.js 15 (App Router) Real-time dashboard with 5s polling
Deployment Railway (backend) + Vercel (frontend) Cloud hosting

Project Structure

BlastRadius/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                  # FastAPI app, webhook handler, scan endpoints
β”‚   β”œβ”€β”€ pipeline.py              # LangGraph StateGraph β€” 4-node pipeline
β”‚   β”œβ”€β”€ database.py              # SQLite init, save/query analysis results
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ diff_reader.py       # Agent 1
β”‚   β”‚   β”œβ”€β”€ impact_scanner.py    # Agent 2
β”‚   β”‚   └── reporter.py          # Agent 3
β”‚   β”œβ”€β”€ tools/
β”‚   β”‚   β”œβ”€β”€ github_tools.py      # fetch_diff, post_pr_comment, list_pr_files
β”‚   β”‚   β”œβ”€β”€ search_tools.py      # Codebase cloning + file search
β”‚   β”‚   └── memory_tools.py      # Read/write/commit .gitagent/memory/
β”‚   β”œβ”€β”€ .gitagent/
β”‚   β”‚   β”œβ”€β”€ agent1/SOUL.md
β”‚   β”‚   β”œβ”€β”€ agent2/SOUL.md
β”‚   β”‚   β”œβ”€β”€ agent3/SOUL.md
β”‚   β”‚   └── memory/              # Committed after every PR analysis
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── .env                     # Local only β€” never committed
β”‚
└── frontend/
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ layout.tsx            # Root layout + sticky nav
    β”‚   β”œβ”€β”€ NavBar.tsx            # Client component nav with active state
    β”‚   β”œβ”€β”€ page.tsx              # PR Analysis Feed
    β”‚   β”œβ”€β”€ globals.css           # Design system (CSS custom properties)
    β”‚   β”œβ”€β”€ risk-map/
    β”‚   β”‚   └── page.tsx          # Codebase risk map by file
    β”‚   └── memory/
    β”‚       └── page.tsx          # Agent memory viewer
    β”œβ”€β”€ package.json
    └── .env.local                # Local only β€” never committed

Quick Start (Local)

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • A Groq API key
  • A GitHub App (see setup below)
  • ngrok for local webhook testing

1. Clone and install

git clone https://github.com/your-username/blast-radius-ai.git
cd blast-radius-ai

# Backend
cd backend
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Frontend
cd ../frontend
npm install

2. Configure environment

# backend/.env
GITHUB_APP_ID=your_app_id
GITHUB_PRIVATE_KEY_PATH=./your-key.pem
GITHUB_WEBHOOK_SECRET=your_webhook_secret
GROQ_API_KEY=your_groq_key

# frontend/.env.local
NEXT_PUBLIC_API_URL=http://localhost:8000

3. Create a GitHub App

  1. Go to GitHub Settings β†’ Developer Settings β†’ GitHub Apps β†’ New GitHub App
  2. Set permissions: Pull requests (Read & Write), Contents (Read)
  3. Subscribe to events: Pull request, Installation
  4. Set webhook URL to your ngrok URL + /webhook
  5. Download the private key .pem file and place it in backend/

4. Run everything

# Terminal 1 β€” expose localhost to GitHub
ngrok http 8000

# Terminal 2 β€” backend
cd backend
uvicorn main:app --reload --port 8000

# Terminal 3 β€” frontend
cd frontend
npm run dev

Open http://localhost:3000 β€” the dashboard is live.

5. Test it

Install your GitHub App on any repo, then either:

  • Open a pull request β†’ analysis runs automatically
  • Use the "Scan Existing Repo" button on the dashboard β†’ analyzes recent commits/PRs retroactively

Environment Variables

Variable Where Description
GITHUB_APP_ID backend Your GitHub App's numeric ID
GITHUB_PRIVATE_KEY backend (cloud) Full contents of the .pem file
GITHUB_PRIVATE_KEY_PATH backend (local) Path to the .pem file
GITHUB_WEBHOOK_SECRET backend Secret set in GitHub App settings
GROQ_API_KEY backend From console.groq.com
NEXT_PUBLIC_API_URL frontend URL of the deployed backend

API Reference

Method Endpoint Description
POST /webhook GitHub App webhook receiver
GET /api/analyses All PR analyses (used by dashboard feed)
GET /api/analyses/{owner}/{repo}/{pr} Single PR analysis
GET /api/risk-map/{owner}/{repo} File risk scores for a repo
GET /api/memory/{owner}/{repo} Agent memory files for a repo
POST /api/scan Trigger retroactive scan { repo_name, limit }

Deployment

Backend β†’ Railway

  1. New Project β†’ Deploy from GitHub β†’ root directory: backend
  2. Set all env vars in Railway dashboard (use GITHUB_PRIVATE_KEY with full .pem contents)
  3. Copy the Railway URL

Frontend β†’ Vercel

  1. New Project β†’ Import repo β†’ root directory: frontend
  2. Add NEXT_PUBLIC_API_URL = your Railway URL
  3. Deploy

Update GitHub App webhook

Go to your GitHub App settings and update the Webhook URL from your ngrok address to:

https://your-railway-app.up.railway.app/webhook

How the Dashboard Works

The Next.js frontend polls the backend every 5 seconds β€” no WebSocket setup needed. As soon as the agent pipeline completes for a PR, the result appears automatically in the feed.

Three views:

  • PR Analysis Feed β€” every analyzed PR with severity, impact count, semantic summary, and a drill-down modal showing the full breakdown by file
  • Codebase Risk Map β€” all files in a repo ranked by cumulative blast radius score across all PRs. Files that appear repeatedly in impacts rise to the top
  • Agent Memory β€” the live contents of .gitagent/memory/, showing what the agent has learned about fragile areas, high-risk functions, and past findings

Built With GitAgent

This project implements the GitAgent protocol β€” a standard for building AI agents whose identity, instructions, and memory live natively in git.

Each agent in this system has:

  • A SOUL.md β€” the system prompt defining who the agent is and how it thinks
  • A SKILL.md β€” descriptions of the tools the agent can use
  • An agent.yaml β€” model configuration (model name, temperature, max tokens)

The agent memory is stored in .gitagent/memory/ and committed to the repository after every PR analysis, making the agent's learned knowledge versioned, auditable, and portable.


Built for the GitAgent Builder Challenge.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages