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

Augment Agent Overview 00:20

  • Augment Agent is a tool designed to help navigate and modernize complex legacy codebases using AI.
  • Matt Ball, a solutions architect at Augment, previously worked at Postman and joined Augment two years ago due to excitement about the AI boom.
  • Augment's core feature is a proprietary context engine, developed over two years, which lifts relevant knowledge from codebases to provide high-quality input to AI models, ensuring accurate understanding and outputs.
  • The tool integrates as a plugin into existing IDEs, catering to enterprise users who prefer not to switch development environments.
  • Augment focuses heavily on enterprise-grade security, offering unique features like customer-managed encryption keys and adhering to new AI ISO standards (ISO 420001).
  • Augment offers two main modes: Chat mode for simple back-and-forth Q&A or when more control is desired, and Agent mode for larger, more complex tasks, including remote agents for parallel background execution.

The Apollo 11 Guidance Computer Case Study 03:40

  • The Apollo 11 mission (1969), the first human moon landing, is used as a case study for a legacy codebase.
  • The "fourth astronaut" on the mission was the Apollo Guidance Computer (AGC), which was essential for landing the lunar module.
  • The AGC's source code, famously represented by Margaret Hamilton's large stack of papers, was a giant, monolithic file developed over several years at MIT in the 1960s.
  • It was written in assembly language, making it challenging to understand without specialized knowledge, and is considered the "ultimate legacy codebase," available on GitHub.
  • The objective is to demonstrate how Augment Agent can help understand and navigate this assembly codebase to simulate landing the lunar module.

Understanding Legacy Code with Augment Chat 05:18

  • A specific example involves the 1201 and 1202 program alarms that occurred during the Apollo 11 lunar module's final descent.
  • Augment Chat was used to quickly determine the function of the 1202 program alarm from the AGC's source code.
  • The chat mode identified that the alarm (octal value 122) indicated the AGC executive system running out of available core sets.
  • It also provided external web context, explaining that the error was caused by an external radar system being left on, and the AGC intelligently offloaded low-priority tasks to continue mission-critical components.
  • The summary provided by Augment stated that the 122 alarm meant the computer was trying to do too many things and ran out of memory, but was able to manage.

Modernizing and Automating with Augment Agent 08:06

  • The demonstration moved to code modernization, focusing on the P65 routine (full automatic landing) from the Lunar landing guidance equations file, which was not used by Neil Armstrong (who used P66 for manual override).
  • Augment Agent's "auto mode" was tasked to write the P65 algorithm in Python, run a pre-built simulator (simulator.py), and autonomously land the lunar module.
  • The agent was prompted to "run simulator.py until it succeeds. Do not change simulator.py."
  • The agent analyzed the codebase, determined the missing descent.py file was needed, and then used its context engine to understand the original assembly code.
  • Augment Agent successfully generated descent.py, providing a Python implementation of the P65 vertical descent guidance.
  • After the agent wrote the code, the simulator ran and indicated a successful landing within the expected 0 to 1 meters, showcasing the agent's ability to understand, translate, and execute complex tasks autonomously.

Practical Applications for Legacy Code 12:12

  • The demonstrated capabilities are not merely a "parlor trick" but are directly applicable to real-world legacy codebases.
  • Three key steps for working with legacy code using AI agents are proposed:
    1. Understand: Use the agent to index the codebase and ask questions about its overall function, specific files, and coding conventions.
    2. Test: Employ chat mode to predict expected code behavior, and then use agent mode to write tests that verify this behavior, acknowledging that human input is still needed for nuanced interpretations.
    3. Modernize: Convert small, modular sections of the code to a desired language or style, applying the same tests to ensure the original functionality is maintained.
  • Augment Agent is suitable for large refactoring projects, such as upgrading a Java 8 project to Java 17, and performs these tasks quickly.
  • The tool is also effective at checking for dependencies across large codebases, as shown when it automatically resolved a Python version conflict.
  • The process demonstrated is analogous to Test-Driven Development (TDD), where agents can reason and iterate on their own results, with tests serving as crucial checkpoints.