princeton-nlp / SWE-agent

SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It solves 12.47% of bugs in the SWE-bench evaluation set and takes just 1 minute to run.
https://princeton-nlp.github.io/SWE-agent/
MIT License
11.88k stars 1.19k forks source link

Support for Retrieval-Augmented Generation (RAG) in SWE Agent #575

Closed zixuanzhang226 closed 1 week ago

zixuanzhang226 commented 2 weeks ago

Describe the issue

Hello,

Does the SWE agent community have any plans to support Retrieval-Augmented Generation (RAG)? Our team is interested in implementing RAG functionality. We would like to know if you have any suggestions on where we could add the documents so that questions and documents can be processed by the generator to craft a response.

Thank you!

Optional: Relevant documentation page

No response

ofirpress commented 2 weeks ago

The agent has 3 different search functions in it already. You could just add additional ones and test if they improve performance on the dev set. Does that answer your q?

zixuanzhang226 commented 2 weeks ago

Thank you for your response! Would you please show me where the 3 different search functions are? Thank you very much!

ofirpress commented 2 weeks ago
image
zixuanzhang226 commented 2 weeks ago

I think the RAG functionality that we want to implement is different from the 3 different search functions already in there. We want to make it able to retrieve documents to generate responses. Here is how I approach it:

Screenshot 2024-06-17 at 4 07 21 PM

I may also need to make changes to the INSTRUCTIONS and IMPORTANT TIPS. Do you think it’s the correct way to implement it? Thank you!

ofirpress commented 2 weeks ago

yes add a command and add an instruction and/or tip. if you add it to the demonstration trajectory that would also be helpful

klieret commented 2 weeks ago

We're definitely happy to add more commands to SWE-agent. In order to make them available to the default config, we'd need a study to show that it actually helps performance, but this is not needed to add the functionality as an option.