
In this video, I dive into Next Edit by Augment Code, an exciting tool designed to streamline code edits. Starting with a brief overview, I explore how Next Edit simplifies the daunting task of applying changes across a large codebase by using a specially trained model. Unlike other tools, Next Edit offers suggestions based on your recent editing history, enabling efficient edits even in large repositories. I demonstrate how to install and use Augment in VS Code, highlighting the natural language pane and its ability to understand complex codebases. Additionally, I discuss the AI research underpinning Next Edit, including task recognition, efficient processing of large codebases, and how it maintains coding standards. Join me to see how Next Edit can transform your coding workflow! 🚀✨ Link: https://www.augmentcode.com 00:00 Introduction to Next Edit by Augment Code 00:14 Challenges of Manual Code Updates 00:56 How Next Edit Simplifies Code Editing 01:24 Installing and Using Augment in VS Code 02:19 Demonstration of Next Edit Features 04:05 AI Research Behind Next Edit 05:19 Technical Challenges and Solutions 07:45 Efficient and Scalable Code Editing 10:12 Conclusion and Future Developments 10:36 Final Thoughts and Call to Action
--- type: transcript date: 2025-03-06 youtube_id: IF8lhAB2iHE --- # Transcript: Next Edit by Augment Code: The Future of Code Completion is Here in this video I'm going to be showing you next edit by augment codes if you're not familiar with augment code I did recently cover them on the channel if you want a general overview on what augment is I'm going to link this in the description of the video in this video I'm going to be specifically focused on next edit let's imagine you have to add a session ID to your application previously to next edit what you'd have to do is go through a number of manual steps you'd have to update the data class and then you'd have propagating changes that you'll have to go and update all of the direct usages of that data class throughout your codebase this includes modifying function calls adjusting method signatures updating any place when the data class is instantiated or manipulated and updating related components we all know the experience of something like this where just one small change it can be quite daunting for going through and having to update all of the different files that are associated with that change it goes without saying that especially in large applications this can be a very timec consuming task you might be thinking okay this is similar to something like cursor tab or GitHub co-pilot's next edit suggestion but where next edit is different within this relies on a specially trained model that draws from your recent editing history to offer relevant suggestions even in large files across multiple files by contrast other tools often require manual positioning of the cursor to trigger edits whereas next edit allows you with your key binding to go through those changes easily even across files in this video I'm going to show you augment within vs codes you can go and search the extension Marketplace within vs code for augment install it and you'll be Off to the Races one of the key features within augment is you're going to be able to have this natural language pain on the right hand side or the left- hand side wherever you put it and the way that it works is as soon as you put in a new workspace or a new repository it's going to go and index that repository in a way where it really understands whatever that codebase is this could be a model repo that's tens of thousands of files large and that's really the strength of augment they have a really strong method on how they're retrieving all of that relevant context that you need through the different edits that you're going to have within your application once you have augment installed you'll be able to have it within the panel whether it's on the left hand or the right hand side and you'll be able to access the context of everything but the really powerful thing with augment is retrieving the relevant context of what you need within your codebase let's say similar to what we saw within the blog post I want to add in a session ID here as soon as I add that what we'll see at the bottom of the screen here is our next edit and this is an even in the file that we're editing here we can see that the predicted intent for what we're going to do next is to update the find user by session ID function it will open up that file for me and it will have that proposed change I can command semicolon and accept it and it will just continue to go through and you can just stepbystep command semicolon and go through your codebase and see all of the different proposed solutions that it has for whatever you're updating you can see in just a number of seconds it was able to Traverse the different pieces of my codebase with suggestions on where I potentially want to update that this is going to be one of those use cases where it's definitely going to be specific to whatever your application is now just a couple things to note with this as well you can also Force the next edit suggestions on the file what you'll be able to do is within the different files you can click to enable that just to demonstrate again let's say within the task for instance we have a deleted at time where we want to track when an item has been deleted similar to the session ID it will have suggestions for us as we go through and update our code base the other great thing augment can be really great especially if you're onboarding onto a project or just trying to understand a repo or you joined a new company and you're really trying to get a sense on how to get started it will have a really deep and Rich understanding on even very large repositories the other thing that you can do within here is let's say I want to remove the session ID just for demonstration sake what augment will do is it will go through with the request that you have our entire code base and it will give you all of the different suggestions on where you need to update additionally what I wanted to show you is the AI research behind next edit because it is pretty interesting so one of the key aspects of next edit is it goes beyond where your cursor is and where you're currently selected within the file you could be anywhere in that file and it will still give you that next edit suggestion on where it thinks your next intent is within the codebase by having that deep contextual awareness of of your code base it will be able to pick up on the different patterns and files and all of those relevant pieces when you make one edit in one file that could Ripple throughout your codebase just imagine how nice it would be just to go through and command semicolon through all of the different changes when you want to update what a method's returning or the schema of a particular object or whatever it might be I demonstrated with the command semicolon feature of going through within my code editor opening up those different files and then accepting those changes but you can also see the changes at the work level space as you see here adjacent to your terminal or ports or debug console when you change one value within a file you'll be able to see at a glance all of the other files as well as areas within those files where you have potential suggestions that you can use from next edit next I want to go over how they accomplished creating next edit first up what they had to solve was figuring out what tasks the user was trying to accomplish this involved a number of different challenges nonlinear edit history you can think of this as a developer you might be grabbing bits of code pasting them within your code base editing them significantly and then moving on you have to be careful not to create a messy trail of changes as they describe to mislead the model trying to infer the developer true intent also unintended biases naively sampling training data by splitting up the diff chunks into a given task can introduce unintended biases into the model the model might learn by touching parts of the code base that already contain recent changes those areas might be precisely where further edits are needed so what this is inferring is basically that next edit does have that pattern of what you edited and ultimately what you settled on it's not just going to go within a loop and continually give you suggestions about recently edited pieces of code and then also intention hallucination trying to nail down what the intention of the developer is that is a very fine line because if you're too passive it might not give you enough suggestions or be helpful enough on the other side of that if it is too aggressive it will give you noisy and potentially too many suggestions for the change that you're trying to make their solution to this was simulating common editing scenarios what they did is they analyzed commits initial commits and final commit States they developed a sophisticated algorithm to simulate the realistic editing scenario that reflect developers common Behavior they have this proprietary data set that mirrors the complexity of actual coding workflows in addition to that they optimize diff granularity when also as I described the user's recent changes it's not going within a loop of what you had just edited next is figuring out where to make those changes identifying where to make those changes across the entire code base is a Monumental task especially with large mono repos containing tens of thousands of files the issue is scalability speed as well as relevance in terms of the solution unlike prior approaches that relied heavily on large language models to navigate decisions we took a different path first up is fast localization with a trained reviewer the way that they do this is by leveraging their retrieval infrastructure with a retriever model that's specifically designed to identify code location Additionally the model uses the current context to efficiently locate relevant files and code suggestions next up obviously with a solution it has to be efficient as well as highly scalable as you could imagine with a code base of tens of thousands of files it has to be efficient as well as scalable but taking the approach as I described this is able to run on large monor repost that contain tens of thousands of files without the performance being degraded so next up is editing the surrounding codes the code around the user's cursor is always added to the list of candidate locations to be processed first ensuring immediate and contextually relevant suggestions the neat thing with this is if your cursor is within a specific place within the codebase it will still consider that once they figured out what the user is trying to do and where the challenges need to be made the final challenge is determining how to make those edits accurately and efficient existing models are not good at making edits that involve large scale changes Beyond Simple insertion next to the user's cursor because as you might Imagine One function within a 10,000 file codebase that function could be referenced in 25 different places and trying to get the relevant context of where to make that update can be often difficult especially trying to feed it into a language model for processing next up obviously there were latency constraints cuz if it's something that's going to take take 10 or 20 seconds to generate developers just wouldn't use it so it does have to be very fast I've described before the codebase awareness is really key here the suggestions need to match the Project's coding standards conventions and correctly use custom apis requiring the model to be aware of the entire codebase context the way that they overcame this was with a novel diff decoding scheme we taught the model A specialized diff format that is both Compact and unambiguously applicable to the original code this format allows the model to represent complex edits succinctly minimizing the number of tokens generated and enabling efficient processing of large files this reduces the latency from several seconds to hundreds of milliseconds finally we leveraged our powerful retrieval augmented generation infrastructure pre previously used in our completion en chant feature to adding codebase specific context to next edit by retrieving relevant pieces of the codebase the model can make suggestions that align with Project Specific coding standards and correctly interact with customer apis this ensures that the edits are not only aligned with what the user is trying to accomplish but but also consistent with existing apis and coding patterns resulting in suggestions that are both accurate and cohesive with the code base in terms of what's next they're working on scaling up next edit to handle larger scale changes from enhancing the model's ability to understand broader context and dependencies to supporting bulk edits across many files simultaneously we're also exploring deeper Integrations with our chat functionality which could provide add additional context for edit suggestions and enable more interactive problem solving workflows but overall that's pretty much it for this video I encourage you to try out augment code if you haven't already as well as next edit I just wanted to do a quick video pointing you on next edit kudos to the team over at augment for this new release and if you found this video useful please like comment share and subscribe otherwise until the next one
Weekly deep dives on AI agents, coding tools, and building with LLMs - delivered to your inbox.
Free forever. No spam.
Subscribe FreeNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.