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

AI EngineerAbout 4 min readJun 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Augment Agent: An AI-powered tool designed to assist developers in understanding, modernizing, and working with codebases, especially legacy code.
  • Context Engine: A proprietary system within Augment Agent that analyzes codebases to extract relevant knowledge for AI models, improving the quality of outputs.
  • Chat Mode: An interactive mode in Augment Agent for question-and-answer sessions and controlled interactions with AI models.
  • Agent Mode: An autonomous mode in Augment Agent where the AI can execute tasks and make decisions without explicit user intervention.
  • Remote Agents: Agents that can run in the background and in parallel, allowing for more efficient execution of complex tasks.
  • Legacy Code: Older codebases that are often difficult to understand and maintain.
  • Apollo Guidance Computer (AGC): The computer used in the Apollo 11 mission, serving as an example of a complex legacy codebase.
  • P65: A full automatic routine in the Lunar landing guidance equations file.
  • 1201/1202 Program Alarms: Error codes that occurred during the Apollo 11 landing, indicating the computer was overloaded.

Augment Agent Overview

Augment Agent is an AI-powered tool designed to help developers work with codebases, particularly legacy code. It features a context engine that extracts relevant information from the codebase to provide high-quality inputs to AI models. Augment Agent integrates with existing IDEs like IntelliJ and VS Code and offers security features like customer-managed encryption keys and ISO 42001 compliance.

Augment Agent Modes

Augment Agent offers two primary modes:

  • Chat Mode: Suitable for simple question-and-answer interactions and when more control over the models is desired.
  • Agent Mode: Designed for larger, more complex tasks where the AI can autonomously execute code and make decisions. Remote agents allow tasks to run in the background and in parallel.

Apollo 11 Guidance Computer Case Study

The Apollo 11 guidance computer (AGC) serves as a case study for demonstrating Augment Agent's capabilities with legacy code. The AGC's code, written in assembly language, is complex and difficult to understand.

Understanding the 1201/1202 Program Alarms

The 1201 and 1202 program alarms occurred during the Apollo 11 landing. Using Augment Agent in chat mode, the presenter asked, "What does the 1202 program alarm do?" The agent analyzed the codebase and external resources to determine that the alarm indicated the AGC was running out of available core sets (memory) due to an external radar system being left on. The computer was smart enough to offload some low priority tasks so that it could continue executing mission mission critical components. This information was quickly retrieved, demonstrating Augment Agent's ability to rapidly understand complex legacy code.

Automating Lunar Landing with P65

The presenter demonstrated Augment Agent's agent mode by tasking it with writing code to implement the P65 lunar landing routine. A simulator was created in simulator.py, which expected a file named descent.py containing a class called lunar_descent_guidance that implemented the P65 algorithm. The presenter then used the prompt "run simulator.py until it succeeds do not change simulator.py". Augment Agent autonomously:

  1. Recognized that the descent.py file was missing.
  2. Explored the codebase to understand the requirements for the lunar_descent_guidance class.
  3. Created the descent.py file with an implementation of the P65 algorithm in Python.
  4. Ran the simulator and successfully landed the lunar module within the specified parameters.

This demonstrated Augment Agent's ability to not only understand legacy code but also to generate new code that integrates with it.

Applying Augment Agent to Legacy Codebases

The presenter outlined a three-step process for applying Augment Agent to legacy codebases:

  1. Understanding the Codebase: Use Augment Agent in chat mode to ask questions about the codebase, such as "What does this codebase actually do?" or "What does file XYZ do for me?".
  2. Writing Tests: Use chat mode to predict the expected behavior of the code and then use agent mode to write tests that check that behavior.
  3. Modernizing the Code: Convert small portions of the code to the desired language or style, applying the same tests to ensure functionality is preserved.

Conclusion

Augment Agent is a powerful tool for working with legacy codebases. It can help developers quickly understand complex code, write tests, and modernize code in a modular fashion. The Apollo 11 guidance computer case study demonstrates Augment Agent's ability to handle even the most challenging legacy code. The presenter encourages the audience to try Augment Agent for free at augmentode.com.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.