back to indexTo the moon! Navigating deep context in legacy code with Augment Agent — Forrest Brazeal, Matt Ball

00:00:22.000 |
about Augment Agent and specifically legacy code, 00:00:25.000 |
how we get the most out of gnarly legacy code bases using an AI agent. 00:00:37.000 |
So he's going to be your best person to come to 00:00:39.000 |
with your most detailed technical questions after the session. 00:00:42.000 |
Matt, anything you want to say about yourself? 00:00:55.000 |
So I've been at Augment for the last two years or so. 00:01:01.000 |
All right, so just a quick roadmap of where we're going. 00:01:03.000 |
We're going to talk a little bit about Augment Agent. 00:01:12.000 |
We're going to talk a little bit about the Apollo 11 guidance computer 00:01:15.000 |
and then we're going to show you some really interesting things 00:01:17.000 |
you can do with that code base and Augment Agent. 00:01:20.000 |
So Augment is the product we're going to be using today. 00:01:24.000 |
You do not need your laptop out to follow along with this session. 00:01:32.000 |
And Matt will tell you a little bit about the most important features of Augment Code. 00:01:40.000 |
So we really identified early on that in order to get high-quality outputs from any of the models, 00:01:49.000 |
Doing that for code bases is not necessarily straightforward. 00:01:55.000 |
So this is something that we've seen in the market. 00:02:00.000 |
A lot of folks think that there's a way to do this. 00:02:03.000 |
We spent two years building a proprietary system that can lift the right knowledge from code base 00:02:09.000 |
And we think that results in high-quality outputs and more accurate understanding. 00:02:16.000 |
We see in a lot of enterprise that if you've got a 10-year-old Java code base, 00:02:20.000 |
you're using IntelliJ, you don't want to have to switch. 00:02:22.000 |
And then from day zero, because we were targeting enterprise, 00:02:26.000 |
we've focused a lot of security capabilities. 00:02:29.000 |
So we have things that are unique to us versus any other vendor, 00:02:34.000 |
We have ISO 42001, which is a new AI ISO standard. 00:02:39.000 |
So we really wanted to laser in on providing security over what is a very important asset in your code base. 00:02:49.000 |
And then we've got a couple of tools we'll be referring to today. 00:02:51.000 |
mainly the chat and agent modes of augment code. 00:02:56.000 |
Yeah, chat is great for kind of simple back-and-forth question-and-answer 00:03:00.000 |
or when you want to leverage a little bit more control over the models 00:03:07.000 |
Obviously, we see that agents can integrate into other tools, 00:03:11.000 |
are much more capable of larger, more complex tasks. 00:03:14.000 |
And then remote agents are great when you actually want to close the lid on your machine 00:03:18.000 |
and allow them to continue to run in the background and in parallel. 00:03:22.000 |
Yes, we did a workshop on Tuesday that involved a contest component. 00:03:26.000 |
And I had someone come up to me afterwards saying, 00:03:28.000 |
I don't understand how the winners were so fast at submitting their solutions 00:03:31.000 |
because we had eight or nine problems we were doing. 00:03:33.000 |
And it's possible some of them were using remote agent to do some of those tasks in parallel. 00:03:39.000 |
All right. So we're going to be talking today about the Apollo 11 mission in 1969. 00:03:45.000 |
I think most of us are familiar with this, the first time humans landed on the moon. 00:03:48.000 |
There were three astronauts in that capsule, Neil Armstrong, Buzz Aldrin, and Michael Collins. 00:03:53.000 |
But sometimes people say there was a fourth astronaut on the Apollo 11 mission. 00:04:00.000 |
Yeah, the Apollo guidance computer or the AGC. 00:04:08.000 |
If you've ever seen that picture of Margaret Hamilton with like that giant stack of papers with the code on it, 00:04:12.000 |
that was the source code for the Apollo guidance computer. 00:04:15.000 |
It was one giant monolithic source file developed over a period of several years at MIT in the 1960s. 00:04:23.000 |
Who here has written assembly at some point in their lives? 00:04:27.000 |
All right. So keep your hand up if it was in production in some capacity. 00:04:32.000 |
All right. So not a lot of us are going to be able to look at assembly code 00:04:35.000 |
and be able to tell you confidently what it does on first glance. 00:04:38.000 |
I certainly can. I haven't written much assembly since I was in computer systems 201. 00:04:42.000 |
All right. So in some ways, this is the ultimate legacy code base. 00:04:46.000 |
It is on GitHub. You can check it out yourself if you want. It's easy to find. 00:04:49.000 |
We are going to try to navigate it well enough to see if we can understand it and land the lunar module ourselves. 00:04:54.000 |
And Augment Agent is going to help us do that. 00:04:57.000 |
So the first thing you want to do anytime you pop open a large legacy code base is you want to see if you can get your head around it, right? 00:05:03.000 |
Someone put a lot of their time and mental energy into putting this code base together, and you've got to catch up with them. 00:05:08.000 |
That historically has been a long process. It's been a fraught process. It's been an imprecise process. 00:05:13.000 |
And AI agents such as Augment Code can help a lot with that. 00:05:16.000 |
So let's look at a specific example, and I'm choosing the 1201 and 1202 program alarms. 00:05:22.000 |
If you're an Apollo 11 history buff, you know about these because during the final descent onto the surface of the moon, 00:05:28.000 |
the astronauts called to Houston and said, "Hey, we're getting this alarm. It's a 1202. Give us a reading on the 1202 program alarm." 00:05:35.000 |
This alarm went off five times as the lunar module, the Eagle, was making its descent onto the lunar surface. 00:05:42.000 |
And there was a question for a moment about whether the landing would need to be aborted. 00:05:45.000 |
And finally, Houston said, "No, you're okay. You can continue." 00:05:48.000 |
So our question is, could we determine that for ourselves, right? 00:05:52.000 |
If you were given the Apollo guidance computer source code, would you be as confident as Houston was to say, 00:05:56.000 |
"No, this is not a problem. It's going to affect the success or stability of the mission." 00:06:00.000 |
So the way I would do this is I'm going to pop open. I've got VS code up here. 00:06:03.000 |
And I've got a slightly modified version of the Apollo 11 code base just to orient you. 00:06:09.000 |
It looks like this, all right? This is their version of assembly code. 00:06:13.000 |
It's truly just a bunch of two-word commands saying, "Move this piece of data into this register." 00:06:21.000 |
And even if you did like a grep and looked for 1201 or 1202, it's not going to tell you what the value of those alarms actually is. 00:06:28.000 |
So I can go to augment chat and I can say, "What does the 1202 program alarm do?" 00:06:37.000 |
And let's see what it tells me. Generating our response. 00:06:42.000 |
All right. And so it's going to take a minute to turn on that. 00:06:45.000 |
And it's going to come back to me with a number of pieces of information, both from the code base itself. 00:06:49.000 |
And it will also be able to call out to the web and it'll be able to look there. 00:06:53.000 |
One of the things I think is interesting about using a chat mode like this is it's kind of similar to calling back to mission control in Houston. 00:07:00.000 |
And if you were to plug in like, you know, some MCP servers to this, right? 00:07:04.000 |
There's a, it gives you an even, an even larger mission control element to work with. 00:07:08.000 |
Okay. So it's, it's actually reading this file for us. 00:07:11.000 |
So the ACG executive scheduler system runs out of available core sets. 00:07:16.000 |
All right. And it shows us where that happens. 00:07:21.000 |
It explains the number of registers there are. 00:07:23.000 |
It explains the, yeah, along with 1201 no vac areas. 00:07:26.000 |
So it pulled both of these and look, it went out to the web and it's giving us the context of what actually caused the error. 00:07:31.000 |
It was an external radar system being left on. 00:07:34.000 |
And the Apollo 11 computer was smart enough then to offload some low priority tasks so that it could continue executing mission control, mission critical components inside the computer. 00:07:49.000 |
1202 means the computer's trying to do two things at once and has run out of memory to track all the concurrent jobs. 00:07:54.000 |
How long would it have taken you to figure that out on your own reading through that code base, right? 00:07:58.000 |
I can tell you would have taken me more than the 30 seconds we've been talking here. 00:08:05.000 |
The second thing I want to do is do a little bit of code modernization here. 00:08:08.000 |
Now, when the lunar module actually landed on the surface, 00:08:11.000 |
Neil Armstrong used a routine in the lunar landing guidance equations file called P65. 00:08:18.000 |
And that was kind of like a manual override mode. 00:08:21.000 |
They didn't really trust the computer enough to let it land the Eagle all by itself. 00:08:25.000 |
Neil Armstrong kind of had a thumb on the controls throughout that process. 00:08:29.000 |
There is also a routine in that file, as I discovered, called P66. 00:08:37.000 |
That's where you just let the lunar module land by itself. 00:08:40.000 |
It turns out that augment agent has a thing called auto mode. 00:08:46.000 |
So you see down on my chat here, I actually was on agent mode before. 00:08:52.000 |
So we could have been in chat mode, but I can also be in agent mode. 00:08:55.000 |
And this is going to, if I ask it to write some code for me or to run some code, 00:09:00.000 |
It's not going to wait and have me click on something. 00:09:03.000 |
I could go get a, you know, a cup of coffee and I could let augment agent land on the moon for me. 00:09:07.000 |
So what I'm going to do, I've added a couple of files to this code base. 00:09:14.000 |
I wrote a little simulator that expects a file to exist called descent. 00:09:19.000 |
And it expects a class to exist in that file called lunar descent guidance that implements the P65 algorithm. 00:09:26.000 |
I'm going to see if augment agent can write that file, run the simulator, and land on the moon without any human assistance whatsoever. 00:09:41.000 |
It's just run simulator.py until it succeeds. 00:10:01.000 |
It's going to run the simulator.py file and work through any issues. 00:10:03.000 |
So, Matt, any comments you want to make about like how augment builds its plan for what it wants to run here? 00:10:09.000 |
So it's going to use code-based knowledge as a starting point to figure out, you know, how it should, what tools it should run, what commands might be important. 00:10:18.000 |
And so from there it can start to understand what might be missing. 00:10:23.000 |
And then typically you'll see the agent start to put together the framework of a plan as to how to solve this. 00:10:28.000 |
So it might go and read individual files and just start to gather a better sense of what it's going to take to complete the task. 00:10:35.000 |
So here it's realizing at this point that the file is missing and then it's going to start exploring the code base more generally with our context engine. 00:10:42.000 |
So it can kind of grok some of that assembly code and start to think about what an implementation would look like. 00:10:49.000 |
That's right and it's actually like it's running little terminal commands for us, right? 00:10:52.000 |
And it's not waiting for us to intervene here. 00:11:07.000 |
So based on the test files, I can understand what the lunar descent guidance class should look like. 00:11:16.000 |
It's an implementation of the P65 vertical descent guidance. 00:11:19.000 |
So Augment has indexed this entire code base. 00:11:22.000 |
So it found, you know, where it is in the original source code. 00:11:25.000 |
And then I got to tell you, it's easier for me to read Python than it is to read assembly code, right? 00:11:32.000 |
So here's where the position and velocity are. 00:11:40.000 |
And it should actually have an algorithm in here called P65 guidance that implements this in Python. 00:11:46.000 |
And so our final position as it ran this here. 00:11:56.000 |
Final position, this number of meters, final vertical and horizontal velocity. 00:12:01.000 |
And you can see that it landed, you know, within our zero to one meters that we would expect for our final simulation values. 00:12:14.000 |
Most of us are not landing on the moon as part of our day job. 00:12:17.000 |
Is there something we can actually learn here? 00:12:19.000 |
So this is what I would take back to a legacy code base of mine based on what we've seen today. 00:12:25.000 |
Number one, anytime you pull this open, you're going to try to use the agent to help you understand on your own what's going on in that code base. 00:12:34.000 |
You're going to be asking questions like, what does this code base actually do, right? 00:12:41.000 |
Are there style or convention things going on here that I should be aware of? 00:12:46.000 |
So sometimes people ask, like, you know, if I am not sure I fully understand this code, am I going to know if the new code that I create is actually correct? 00:12:54.000 |
So I think a blend of agent and chat mode are going to help you out a lot here. 00:12:58.000 |
Use chat mode to predict what you think the code should do. 00:13:01.000 |
So in the case of the P65 algorithm, you know, tell me what I think should happen when I run this lunar descent given these input parameters. 00:13:08.000 |
And then have the agent mode write some tests to check that behavior. 00:13:12.000 |
I had a case where it was working with the scheduler and it couldn't decide for itself whether priority level zero was the highest level or lowest level in the system. 00:13:20.000 |
And you could convince it either way, like it's a classic thing an agent would struggle with. 00:13:24.000 |
So take the time to go, you know, read yourself, right? 00:13:26.000 |
Have it surface those pieces of the code for you. 00:13:33.000 |
Start converting small portions of the code in modular fashion to the desired language or, you know, style that you want. 00:13:39.000 |
And apply those same tests to make sure that you're not getting far afield from what the actual functionality of the code should be. 00:13:46.000 |
And that is not just a strategy for success landing the Apollo 11 guidance computer on the moon, but for working with your code as well. 00:13:55.000 |
Once again, you can try Augment Agent yourself for free at augmentcode.com. 00:13:59.000 |
Bring your gnarliest legacy code bases and refactoring projects. 00:14:02.000 |
I forget how many lines of code are in the Apollo guidance computer repo. 00:14:09.000 |
Yeah, that's pretty small fry when it comes to, like, enterprise projects these days. 00:14:13.000 |
So, you know, the real world equivalent of this kind of thing might be, like, I've got a Java 8 project. 00:14:32.000 |
But the legacy ones, I think, are a little bit more fun. 00:14:37.000 |
What about things like checking for dependencies across, like, a large code base? 00:14:48.000 |
And you actually, in 20 seconds, you actually saw a little bit of that here, right? 00:14:51.000 |
Where it went through and, like, there were some missing files. 00:14:53.000 |
It tried to run Python and said, oops, it's not installed. 00:15:00.000 |
What you showed was test-driven development effectively. 00:15:04.000 |
Could this improve the needle on whether that's a recommended practice or...? 00:15:11.000 |
So any way they can check their own result is very helpful.