TalksAWS re:Invent 2025 - Build autonomous code improvement agents with Amazon Nova 2 Lite (AIM429)
AWS re:Invent 2025 - Build autonomous code improvement agents with Amazon Nova 2 Lite (AIM429)
Building Autonomous Code Improvement Agents with Amazon Nova 2 Lite
Overview
This session covered the development of autonomous coding agents using Amazon Nova 2 Lite, a large context window reasoning model.
The goal was to build an agent that can analyze a GitHub issue, explore the codebase, and provide an implementation plan to address the issue.
The presenters, Pat and Jean, walked through the process of building and optimizing this agent using the Strands framework.
Key Considerations for Coding Agents
Context Management: Effectively managing the context provided to the model is critical for performance and cost optimization.
Providing the entire codebase upfront can degrade model performance and quality, despite the large context window.
Instead, the presenters recommended using file paths and repository structure to provide targeted context to the model.
Tool Selection and Usage: Agents have access to a wide range of tools (e.g., GitHub MCP, file system operations), but too many tools can overwhelm the model.
The presenters suggested being intentional about the tools provided and grouping them into sub-agents for better context management.
They also emphasized the importance of specifying tool usage guidelines in the agent prompt to ensure proper and secure usage.
Multi-Agent Architectures: For complex coding tasks, a single agent may not be sufficient. The presenters proposed a multi-agent approach with specialized roles:
A planning agent responsible for analyzing the issue, exploring the codebase, and generating an implementation plan.
An execution agent responsible for actually making the code changes and validating the results.
Local Execution Environment: To ensure the agent can safely execute code and test changes, the presenters demonstrated the use of a Docker-based local execution environment.
This allows the agent to clone the repository, install dependencies, and run the code without risking uncontrolled access to external resources.
The presenters highlighted the importance of security considerations, such as limiting network access and vetting dependencies.
Technical Details
The presenters used the Strands framework, which provides built-in support for AWS services and tools, to build the coding agent.
They leveraged the capabilities of the Amazon Nova 2 Lite model, which has a 1 million token context window and 64,000 token output.
The agent used the GitHub MCP (Model Context Protocol) server to interact with the GitHub repository, but the presenters also demonstrated the use of local file system tools for more targeted context management.
The multi-agent architecture was implemented using Strands' graph-based approach, with a planning agent and an execution agent.
The local execution environment was set up using a Docker container, with the agent's workspace and dependencies managed within the container.
Business Impact and Use Cases
Autonomous coding agents can significantly improve developer productivity and efficiency by automating repetitive tasks, such as bug fixes and feature implementations.
These agents can be particularly valuable in large, complex codebases where manual exploration and changes can be time-consuming and error-prone.
The presenters mentioned that some Amazon SaaS teams are already using similar approaches to manage their repositories, demonstrating the real-world applicability of this technology.
While the focus was on addressing GitHub issues, the presenters suggested that the same approach could be applied to other use cases, such as automated code reviews for pull requests.
Examples and Results
The presenters walked through several examples of the agent's performance, starting with a basic prompt and gradually optimizing the context management and tool selection.
The initial agent, with no context provided, was able to generate a reasonable implementation plan, but lacked the necessary details to make specific code changes.
By providing the file paths and repository structure, the agent was able to generate a higher-quality plan with targeted code changes.
The multi-agent architecture further improved the agent's performance, with the planning agent generating a detailed implementation plan and the execution agent handling the actual code changes.
Throughout the examples, the presenters highlighted the importance of balancing context, tool usage, and reasoning budget to optimize the agent's performance and cost-effectiveness.
In summary, the session provided a comprehensive overview of the key considerations and best practices for building autonomous coding agents using Amazon Nova 2 Lite and the Strands framework. The presenters demonstrated how to effectively manage context, tools, and agent architectures to create powerful and efficient coding agents with real-world business impact.
These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.
If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.