Inspiration
Project Story: MR Triage Agent
Engineering teams spend a surprising amount of time trying to understand merge requests. What changed. What broke. Who should review. These questions slow down delivery and reduce review quality.
This project started from a simple observation. Most merge requests lack structured context. Reviewers must manually inspect diffs, trace dependencies, and guess intent. This leads to delays, shallow reviews, and repeated back and forth comments.
The goal was to build an intelligent assistant that removes this friction. The MR Triage Agent automatically analyzes merge requests and provides a clear, structured summary. It highlights risks, suggests reviewers, and drives action.
Inspiration
The idea came from real developer workflows. In fast moving teams, engineers often ask the same questions:
- What is this change doing
- Is anything risky here
- Who owns this area
These questions should not require manual effort every time. The system already has the data. It just needs to be interpreted and presented clearly.
We wanted to build something that behaves like a strong tech lead. Quick. Context aware. Focused on signal.
What We Built
We built an event driven system that integrates directly with GitLab merge requests.
Core capabilities include:
- Automatic trigger on merge request creation or update
- Diff analysis to extract intent and impacted areas
- Risk detection using rule based heuristics
- Reviewer recommendation based on file ownership patterns
- Structured summary comment posted directly on the MR
- Auto labeling and follow up issue creation
The system ensures that every merge request starts with high quality context.
How We Built It
The system is designed around a simple and reliable architecture.
Webhook Layer GitLab webhooks trigger the system when a merge request is created or updated.
Processing Layer A backend service fetches MR data, diffs, pipeline status, and test reports. A queue worker handles asynchronous processing to avoid timeouts.
Intelligence Layer We started with deterministic rules:
- File based risk scoring
- Missing test detection
- Change size thresholds
Then we added optional LLM based summarization for improved readability.
Action Layer The system posts comments, applies labels, assigns reviewers, and creates issues using GitLab APIs.
Optional Flow Mode A planner agent generates a high level summary. A reviewer agent refines it and suggests actions. This creates a multi step reasoning pipeline.
What We Learned
- Deterministic logic is critical for trust. Pure LLM output is not enough.
- Event driven systems require careful handling of retries and idempotency.
- Developer experience matters. Setup time must be minimal.
- Good summaries are short and structured, not verbose.
Challenges We Faced
Noisy Summaries Early versions produced too much information. We solved this by enforcing a strict schema and limiting output size.
Diff Complexity Large diffs are hard to interpret. We introduced heuristics to focus only on high impact files.
Reviewer Recommendation Mapping files to the right reviewers required analyzing historical patterns. We implemented a simple ownership model based on commit history.
API Reliability Handling rate limits and failures required retries and caching strategies.
Outcome
The MR Triage Agent reduces the time to understand a merge request from minutes to seconds.
It improves review quality by providing context upfront. It reduces unnecessary back and forth comments. It helps teams move faster without sacrificing code quality.
This project demonstrates how intelligent automation can improve developer workflows in a practical and measurable way.
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for MR Triage Agent, Smart Merge Review Assistant
Built With
- fastapi
- javascript
- next.js
- python
- typescript
- webhook
Log in or sign up for Devpost to join the conversation.