AI Agent Automatically Codes WITH TOOLS - SWE-Agent Tutorial ("Devin Clone")

AI Agent Automatically Codes WITH TOOLS - SWE-Agent Tutorial ("Devin Clone")

New Section

In this section, the speaker introduces a new coding assistant called SWE-Agent developed by a team at Princeton. The tool is designed to assist in software engineering tasks using language models.

Introduction of SWE-Agent

  • The SWE-Agent is a new coding assistant developed by a team at Princeton, focusing on enabling software engineering tasks through language models.
  • The tool performs nearly as well as DevOn and specializes in fixing real-world bugs and issues on GitHub by replicating and fixing problems based on GitHub issue URLs.
  • Performance comparison shows that SWE-Agent using GPT 4 achieves impressive results close to DevOn's performance, showcasing its efficiency in bug fixing.

Key Features of SWE-Agent

This section delves into the key features that make SWE-Agent stand out in assisting with software engineering tasks.

Impressive Features

  • SWE-Agent provides a seamless process for identifying, replicating, and fixing issues reported on GitHub, streamlining the bug-fixing workflow.
  • The project's success lies in designing simple language model-centric commands and feedback formats to enhance browsing repositories, editing code files, and executing commands efficiently.

Installation Guide for SWE-Agent

Here, the speaker provides step-by-step instructions for installing SWE-Agent to leverage its capabilities effectively.

Installation Steps

  • Install Docker by downloading the relevant Docker desktop app for your operating system from docs.deer.com/engineSL/install.
  • Download and install Miniconda based on your operating system to set up the necessary environment for running SWE-Agent.
  • Clone the SWE-Agent repository from GitHub using Git clone command followed by activating the Conda environment specific to SWE-Agent.

Challenges Faced During Installation

This part discusses challenges encountered during installation despite the convenience provided by pre-configured environments like Conda and Docker.

Installation Challenges

New Section

In this section, the speaker discusses switching to a platform called Lightning for ease of use in their project setup.

Switching to Lightning Platform

  • The speaker transitioned to using Lightning for their project.
  • Lightning comes with pre-installed Docker and Conda, simplifying the setup process.
  • Following similar steps as before, the speaker successfully created a Docker image within Lightning.

New Section

This part focuses on creating a keys file with specific environment variables for the project.

Creating Keys File

  • To create a keys file, right-click and add a new file named "keys.CFG."
  • Paste four environment variables into the keys file: GitHub token (required), OpenAI key, Anthropic key, and Together key (optional).

New Section

Here, the speaker explains how to set up GitHub token and OpenAI API key in the keys file.

Setting Up Tokens

  • Obtain a GitHub personal access token following simple instructions found online.
  • Paste the obtained GitHub token and OpenAI API key into the keys file.
  • Ensure both tokens are correctly placed in the keys file before proceeding with the project setup.

New Section

This segment covers running commands to address an issue within the project.

Running Commands

  • Move the keys file to its correct location within the project directory if misplaced.
  • Execute a command (python run.py) with specified parameters like model name and data path to resolve an issue related to base commit.

New Section

The discussion involves addressing an issue by referencing another issue within the same repository.

Referencing Issues

  • Copy an issue from one repository and apply it to solve an issue in another repository.
  • By leveraging existing code snippets from issues, attempt to resolve errors efficiently within projects.

New Section

This part delves into navigating through code files to identify and rectify errors effectively.

Navigating Code Files

  • Locate specific lines of code mentioned in error messages by scrolling through large code files systematically.
  • Use built-in commands like "goto" in software tools for efficient navigation through extensive codebases during debugging processes.

Identifying and Resolving Code Issue

In this section, the transcript discusses identifying a specific function of interest related to an "eval" call, analyzing code for indexing problems in a matrix operation, generating an edit to address the issue, and applying the edit to resolve the problem.

Analyzing Code for Indexing Issues

  • The transcript highlights identifying the "eval" call insert as a particular function of interest.
  • It mentions scrolling down to line 81 to view the function in question.
  • After analyzing the code, a problem with indexing values in a matrix operation is detected.
  • A generated edit is applied between lines 87 through 89 to rectify the indexing issue.

Testing and Submission Evaluation

This part covers running reproduction code after making edits, observing changes in output, confirming resolution of issues, cleaning up workspace by removing files, and submitting what is believed to be the correct solution for evaluation.

Running Reproduction Code and Submission

  • The transcript discusses going back to reproduction code to run it again post-edit application.
  • Observations show that the output now aligns with expected results.
  • Workspace cleanup involves removing unnecessary files.
  • Finally, what is deemed as the correct solution is submitted for evaluation using sbench.
Video description

SWE-Agent is an open-source, fully autonomous coding agent that can solve GitHub issues. It scores almost as high as Devin in the coding benchmark. Here's a full review and tutorial. Be sure to check out Pinecone for all your Vector DB needs: https://www.pinecone.io/ Join My Newsletter for Regular AI Updates πŸ‘‡πŸΌ https://www.matthewberman.com Need AI Consulting? βœ… https://forwardfuture.ai/ My Links πŸ”— πŸ‘‰πŸ» Subscribe: https://www.youtube.com/@matthew_berman πŸ‘‰πŸ» Twitter: https://twitter.com/matthewberman πŸ‘‰πŸ» Discord: https://discord.gg/xxysSXBxFW πŸ‘‰πŸ» Patreon: https://patreon.com/MatthewBerman Rent a GPU (MassedCompute) πŸš€ https://bit.ly/matthew-berman-youtube USE CODE "MatthewBerman" for 50% discount Media/Sponsorship Inquiries πŸ“ˆ https://bit.ly/44TC45V Links: Github: https://github.com/princeton-nlp/SWE-agent Website: https://swe-agent.com/ Chapters: 0:00 - SWE-Agent 3:41 - Tutorial 7:41 - Demo 1 11:20 - Demo 2