Building uReview, Uber’s Multi-Agent Code Review Engine — Will Bond & Ameya Ketkar, Uber https://www.youtube.com/watch?v=EL123UNokkI AI Engineer · 15 min · 143 sentences · sentence-level transcript from YouTube's caption track; each line begins at the time shown [00:01] [music] [00:12] All right, hello everyone. [00:14] My name is Will and uh I'm here to talk to you about automated code review. [00:20] Uh my teammate Amir and I work at Uber and we're going to be walking through U Review, a system that Uber has built uh to help increase the velocity [00:30] of our software engineering teams. [00:33] Um for a little bit of context about what software engineering org at Uber looks like, we have thousands of software engineers who work across hundreds of teams uh located across 12 different sites [00:46] and uh they work in primarily one of six language-specific monorepos. [00:51] As many of you have probably noticed over the past 24 months, the volume of PRs, the size of PRs has been growing. [00:58] One of the ways that that's been exposed to us has been through uh the metric that we track of the first time to review. [01:05] Back in 2024, we were seeing that engineers would get their first review within 3 hours. [01:11] Now in 2026, that has grown to 9 hours uh in addition to all of the volume changes. [01:16] So, in short, code review is now the bottleneck that we are running into. [01:21] Um specifically around automated code review, uh there are there are various options available in the industry, uh but Uber spent the time to invest in building an in-house solution due to some of the constraints that we have. [01:34] One of those is uh we currently use Fabricator and have for a long time and are in the process of migrating to GitHub. [01:41] Uh most of the solutions do not provide support for Fabricator. [01:45] Um in addition, if you were at the previous talk, you saw Uday and Adam talking about the agentic SDLC. [01:52] A big part of what we want to do is bring a consistent code review experience to the inner loop so that our agents are getting the same code review, [02:00] the same rules, everything applied as our humans do. [02:04] With hundreds of teams across the company, we can't have centralized management of our code reviews, our customizations, and our rules, and even the knowledge that goes into those code reviews. [02:15] We need to distribute that. [02:16] So, we have a need for plugging into existing team ownership system rather than trying to replicate that externally. [02:25] Uh finally, with the volume of code reviews that we perform, we need the ability to take factors like the risk profile and the complexity of a code change and factor that in when deciding [02:38] how we're going to run a code review. [02:40] Not all code gets the exact same review. [02:43] And then finally, consistency. [02:44] We need to make sure that we have security and compliance reviews run across everything. [02:48] We can't rely on teams hoping to run the skill the code review skill that happens. [02:54] We need reliability there. [02:57] With all that said, I wanted to give you an overview of the architecture of what you review looks like. [03:02] We'll talk about a couple of the big pieces, and then we're going to dive into a few focus areas. [03:07] At the top, you'll notice that we have our code review surface areas, GitHub, Fabricator, and the agent loop. [03:14] These all feed into you review service. [03:18] These This takes in requests for reviews. [03:21] It brings in feedback from users, and it routes it. [03:25] We have a number of different generators. [03:27] Now, these generators are tuned for different performance and cost avenues. [03:33] There are We also have the ability to plug into third-party code review systems so that we can compare ourselves to what's available more broadly. [03:43] Finally, with all these different generators, we might be might be duplicating comments, and we can actually create quite a high volume of comments. [03:51] If you've ever used AI to to run a code review, you've probably seen that. [03:55] So, we run through a number of steps in the post-processing where we both rate, categorize, filter, and deduplicate comments so that our engineers get only the highest confidence comments [04:08] that are actionable for them to work on. [04:10] You'll also notice along the bottom we talk a little bit about feedback in our evaluation. [04:15] But, with this context of the overall system, I'm now going to hand it off to Ameya to dive into our first focus area. [04:24] Hello. [04:25] Hello, everyone. [04:26] So, I will be talking about how we evolve U review with observability and evaluation. [04:33] So, U review had a very humble beginning. [04:35] Basically, it was a single prompt that you should do logic checks per file, a simple agent which used to do thorough review. [04:42] And we had a dispatcher to decide whether to go which generator to choose. [04:48] Even what we used to collect as observability was very surface-level. [04:51] We used to collect cost. [04:53] We used to run an NPS survey, have Google Forms being filled, Slack support. [04:57] And with all of this, we saw that our quality to cost ratio was like all over the place. [05:03] Like, our goal is to be in the second quadrant, that is the top left quadrant, but you can see we were all over the place. [05:11] Then what we did is that we started collecting more data. [05:15] So, we started collecting the sentiments of the replies that were made to the U review that the U review uh call you know, the U review agent got from the developers. [05:28] So, we categorized them into positive, negative. [05:30] We classified them into various categories, and we found a bunch a lot of classes of bugs and issues that we could actually solve. [05:39] And with that, we improved the system, and we were able to move a large number of PRs to a high quality to cost ratio. [05:47] Um but, we still felt that this was not enough. [05:51] We need to know more of how the review is done. [05:54] So we started tracking things like address rate. [05:57] So basically when a U review comment is made, does the developer go and actually address the comment? [06:03] We started tracking that. [06:05] And then we also started doing more like a runtime profile, which is like the agent trajectory, which told us why the agent is doing what it what it did. [06:16] We get to know what tools calls it made. [06:19] We get to know what thinking process it had. [06:22] And then with that insight, we were able to actually tune our runtime, tune our performance such that the agent could very quickly give us high-quality results at a low cost. [06:35] One of the biggest learnings in this process was like the model doesn't know that it's wrong. [06:40] It always confidently says 100% sure that yeah, this is the review for your code. [06:45] Go ahead. [06:45] But we saw that no, it actually needs a lot of guidance from the teams because each team has its own style guide, its own patterns or like anti-patterns that they want to look for. [06:57] So that all should be like baked into the agent. [07:00] And we also realized that we need to have guardrails for the agent. [07:04] So we need to tell the agent what not to waste turns doing. [07:07] Like code review is something that has to happen in like a specific time span. [07:12] And then if it starts spending time doing things that it should not be doing, uh leads to a bad quality code review. [07:20] Uh second focus area for U review has been nations. [07:26] We We went very deep on team customizations because as we'll presented that we have hundreds of teams and everyone has like their own way or their own thing for code review. [07:37] So our review stack is pretty straightforward. [07:39] We have single-file reviewers and multi-file reviewers. [07:43] Uh, we basically do a general purpose "Hey, find me all logic bugs per file" uh, kind of a review. [07:49] And uh, then we also do a deep review because we have like six mono repos. [07:54] So, all these mono repos have their own anti-pattern style guides and all baked into this agent review which does have a nice multi-file review. [08:02] But, then we extended it further uh, basically to AI linters. [08:06] These are basically few shot uh, AI problem uh, or like a few shots uh, system where uh, developers can basically kind of deterministically get more context and then run rules [08:20] with that context and like a file and find some uh, systematic and mechanical issues. [08:26] And finally uh, the most powerful thing is the custom agent uh, where the teams could basically define their own custom agent, link it to like a knowledge base, uh, link it to their past PRs, [08:38] have like a skill to do the review, and so on. [08:41] But, uh, all of this was not simple because we had to actually uh, piggyback on our uh, ownership model which is at Uber uh, so that we can like very logically roll out to all the teams. [08:54] Uh, we had to basically do a uh, what do you say? [08:57] Co-locate the customizations next to where the developers write their code so that they can like quickly uh, keep updating these customizations. [09:05] We had to implement a smart deterministic uh, routing so that we could route which team gets what kind of review with which model, what kind of generators, and so on. [09:16] And finally uh, the hard thing was like we had to actually surface all of this observability that I talked before, like the agent trajectory, addressal rate, uh, sentiment analysis back to the teams. [09:28] So, so that the teams could actually understand that "Oh, I wrote this rule, but maybe not a lot of developers are liking it in my team, so let me go and update it." [09:37] And then we had to give Bubble up that kind of observability to all the people who are contributing to the platform. [09:43] Uh one thing that we learned is that actually writing the skill was very easy. [09:49] Like teams just very quickly wrote a skill by asking Claude to write one, go over my previous PR reviews and write me a skill. [09:58] But the hard part was how to run these skills at scale with consistent quality and low cost. [10:04] And that required a lot of iterations not only from the U-Review team side, but also like for each team who was trying to write these rules. [10:12] Uh in results, we basically uh see that, you know, uh U-Review does like around 25,000 comments a week. [10:20] And uh we get 10% of them actually get some feedback. [10:24] And only 4% of the PRs actually get some negative feedback. [10:28] Uh we also saw that um the overall addressal rate was uh around 67% and almost three quarters of the high severity issues uh were usually addressed by the developers, which shows that U-Review actually [10:43] adds some value to the entire development life cycle. [10:46] And then uh with all the observability and uh evals that I showed that I went through, we saw that against like a very naive implementation, our costs were down by 60% [10:57] and our quality and our accuracy was up by uh around 70%. [11:02] Uh for a last focus area, I'll give the mic back to Will and he will go over the inner versus outer loop. [11:11] Awesome. [11:11] So, now that we've talked about uh some of the details of actually implementing high-quality reviews, it kind of brings us to the last area, which is where we start talking about [11:24] where things are going, right? [11:25] With moving to the Agentech SDLC, we're moving software into a model where engineers are interacting with the code less. [11:35] They're often times not as involved in authoring the code. [11:38] Uh currently, we still have uh humans approving the code, uh but we see a a short path in the near future to a percentage of our code landing automatically, having automatic approvals, [11:52] right? [11:53] The various parts of the industry are already moving there. [11:56] Um Part of the way along the process was figuring out by having our single code review platform, what did we need to tune for the various audiences that are actually getting these code reviews? [12:10] Um you know, the interface, that's one area that's sort of intuitive there. [12:14] Uh one thing that might be less intuitive is around accuracy. [12:18] Uh with the inner loop, our accuracy needs actually need to go up, or else we can result in uh dealing with cavitation of an agent where it fixes something, goes back, gets another code review, and has to kind of like fix backwards because the quality of the comment [12:33] was low. [12:35] Um The one of the other interesting things is agents are more than happy to go through and fix 100 nits on a pull request where your engineers really get frustrated in situations like that. [12:47] Um but probably the most interesting aspect of this transition is the feedback. [12:53] As you can see, quite a bit of what went into getting high-quality code reviews at Uber was bringing the human feedback into the system and using that to figure out how to tune our prompts, how to tune our agents. [13:08] Uh and so as we move to a model where humans are less in the loop, where software engineering is moving to an agentic model, we're effectively going to a place where we're starting to talk about [13:22] are we going to kill the outer loop? [13:24] Is the human engineer not going to be involved in the code review. [13:29] Some people are already here. [13:31] Now, with the feedback taken into consideration, you start wondering, all right, what could this result in, right? [13:39] I'll let your imagination go there in terms of quality degradation, slop, and so forth. [13:43] But, rather than killing the outer loop, I think that we believe and the industry has just started to really kind of coalesce on this idea that we're really expanding [13:54] the outer loop. [13:55] Rather than removing humans from the code review process, we are moving their responsibilities up a layer. [14:03] Rather than them dealing with the details of the implementation, the agent is great at writing the software. [14:09] The agent is getting much, much better at reviewing the software as a human would. [14:14] But now, as software engineers, we still are going to have an outer loop. [14:17] It's just going to look a little different. [14:19] Instead of you worrying about the optimization of the performance and the API compatibility, you're going to be thinking more about architecture in your code reviews. [14:28] You're going to have time to focus on the domain expertise that you have and product thinking. [14:34] So, we believe that as we adopt this automated uh code review, this is going to be the result of how our engineers are interacting with the system and guiding it. [14:47] And that's it. [14:48] Thank you so much for coming. [14:49] Thanks.