๐Ÿš€ Inspiration

Every developer has faced this problem: you make a small change, but youโ€™re not sure what it might break.

In modern applications, even a tiny change can affect multiple modules due to hidden dependencies. Current code review processes rely heavily on manual effort and intuition, which often leads to missed risks and production bugs.

We wanted to solve this "uncertainty problem" by building an AI agent that can automatically understand code changes and predict their real impact before merging.


๐Ÿ’ก What it does

AI Merge Risk Advisor is an AI-powered agent that analyzes code changes and predicts their impact across the system.

It automatically:

  • Detects changed files using Git
  • Builds a dependency graph
  • Extracts actual code differences (git diff)
  • Uses AI to analyze the change
  • Identifies affected modules
  • Generates risk level and impact score
  • Suggests relevant tests
  • Recommends whether the change is safe to merge

It simulates a GitLab Merge Request workflow where the system acts as an intelligent reviewer.


โš™๏ธ How we built it

We built the system using a combination of backend logic, graph analysis, and AI reasoning:

  • FastAPI (Python) for backend API and workflow orchestration
  • Git integration to detect changed files and extract diffs
  • NetworkX to build and analyze dependency graphs
  • OpenRouter (Step-3.5 Flash model) for AI-powered reasoning
  • React (Vite) for frontend dashboard visualization

The pipeline works as follows:

  1. Detect changed files from latest commit
  2. Extract git diff
  3. Build dependency graph
  4. Find affected modules
  5. Send structured context to AI
  6. Generate:
    • Risk level
    • Impact score
    • Suggested tests
    • Merge recommendation

โš ๏ธ Challenges we ran into

  • Handling Git-based change detection reliably
  • Extracting meaningful context from raw git diff
  • Ensuring AI returns structured JSON responses consistently
  • Managing dependency graph traversal efficiently
  • Integrating frontend and backend smoothly
  • Avoiding crashes due to missing data or edge cases
  • Designing a system that feels like a real GitLab workflow

๐Ÿ† Accomplishments that we're proud of

  • Built a complete end-to-end AI agent workflow
  • Successfully combined dependency graph + AI reasoning
  • Generated meaningful and actionable merge recommendations
  • Created a working frontend to visualize results
  • Simulated real-world merge request analysis
  • Delivered a clean and scalable architecture

๐Ÿง  What we learned

  • How to integrate AI into real development workflows
  • Importance of dependency analysis in large systems
  • Handling real-world code diffs and edge cases
  • Designing AI prompts for structured outputs
  • Building full-stack systems quickly under constraints
  • Thinking beyond static analysis to predictive systems

๐Ÿ”ฎ What's next for AI Merge Risk Advisor

  • Real GitLab integration (auto-trigger on merge requests)
  • Support for multi-file and large-scale repositories
  • CI/CD pipeline integration
  • Security vulnerability detection
  • Smarter AI explanations with deeper context
  • Team-level analytics and insights
  • Performance optimization for large dependency graphs

Built With

Share this project:

Updates