microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
32.11k stars 4.68k forks source link

Feature: aider coding assistant agent #528

Closed itlackey closed 4 months ago

itlackey commented 11 months ago

It would be great to see a coding agent that could leverage the aider coding assistant tool to implement changes. The aider tool's features such as git integration could be an interesting and powerful addition to this framework.

codeninja commented 11 months ago

For what it's worth, I've been using Aider to prompt code my autogen agents. It works fantastically and will often generate proper code the first shot.

I created my Typescript coder with 5 agents in different folder structures and the example pipeline in a single prompt.

10000% worth adding Aider here. The way they've solved for the full repository context has been working really great.

joshkyh commented 11 months ago

AutoGen requires "openai~=1.2" which conflicts with Aider until this aider issue is resolved. https://github.com/paul-gauthier/aider/issues/351

joshuavial commented 10 months ago

I love aider and have been looking for an excuse to work with autogen. I'm assuming that a new custom agent would live in https://github.com/microsoft/autogen/tree/main/autogen/agentchat/contrib ? Or is there a different protocol for managing extensions and customised agents?

Would the main use case look like having something like https://github.com/microsoft/autogen/blob/main/test/agentchat/contrib/chat_with_teachable_agent.py in the root dir of a code base which loads in the aider agent and and any other agents you want to interact with?

joshkyh commented 10 months ago

I love aider and have been looking for an excuse to work with autogen. I'm assuming that a new custom agent would live in https://github.com/microsoft/autogen/tree/main/autogen/agentchat/contrib ? Or is there a different protocol for managing extensions and customised agents?

Would the main use case look like having something like https://github.com/microsoft/autogen/blob/main/test/agentchat/contrib/chat_with_teachable_agent.py in the root dir of a code base which loads in the aider agent and and any other agents you want to interact with?

It would be awesome if one agent could be responsible for one different repo each; I'd imagine that the integration opportunities are huge. :)

codeninja commented 10 months ago

That is an implementation detail best left to the developer. The secret sauce of aider is its full repository context via its source map and its ability to add, track, and intelligently pull in context from working files.

I find the write logic problematic at times. It often gets the diff wrong, and is usually just whitespace when that happens.

It's also missing a critic agent and would benefit from the ability to customize the instructions.

We already have agents who can logic, learn, critique, and eval code. What autogen would benefit from most is full repository context, reliable file editing, and working memory context.

On Mon, Nov 27, 2023, 7:23 PM Joshua Kim @.***> wrote:

I love aider and have been looking for an excuse to work with autogen. I'm assuming that a new custom agent would live in https://github.com/microsoft/autogen/tree/main/autogen/agentchat/contrib ? Or is there a different protocol for managing extensions and customised agents?

Would the main use case look like having something like https://github.com/microsoft/autogen/blob/main/test/agentchat/contrib/chat_with_teachable_agent.py in the root dir of a code base which loads in the aider agent and and any other agents you want to interact with?

It would be awesome if one agent could be responsible for one repo each; I'd imagine that the integration opportunities are huge. :)

— Reply to this email directly, view it on GitHub https://github.com/microsoft/autogen/issues/528#issuecomment-1828912117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADUQXK2YB4W4SYFEIOGDTYGU4JBAVCNFSM6AAAAAA63YPDCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYHEYTEMJRG4 . You are receiving this because you commented.Message ID: @.***>

itlackey commented 10 months ago

I agree with @codeninja it would be best to leave the implementation flexible. My original idea was an easy way to drop aider into a group chat. Then have an Assitant Agent check the aider commit and issue a rollback or update if necessary as a simple example. Overall, as @codeninja said, the primary benefit is the repo context and existing git integration out of the box. This prevents the need to reimplement this in autogen or each app.

codeninja commented 10 months ago

I believe you can do that through function calls... you would want to give the agent info on the aider commands, and then give the user access to run those commands through aider passing the agent output as the command. returning aider response as the user's message to the agent completes the cycle.

You would also want some file LS methods to give the agent info about the repo, or implement, tap into, the repomap from aider.

I'm following this pattern for other implementations and it's working well.

On Mon, Nov 27, 2023, 8:29 PM IT Lackey @.***> wrote:

I agree with @codeninja https://github.com/codeninja it would be best to leave the implementation flexible. My original idea was an easy way to drop aider into a group chat. Then have an Assitant Agent check the aider commit and issue a rollback or update if necessary as a simple example. Overall, as @codeninja https://github.com/codeninja said, the primary benefit is the repo context and existing git integration out of the box. This prevents the need to reimplement this in autogen or each app.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/autogen/issues/528#issuecomment-1828961548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADUQRNRWTNVLPPUFF5AYDYGVD7NAVCNFSM6AAAAAA63YPDCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYHE3DCNJUHA . You are receiving this because you were mentioned.Message ID: @.***>

itlackey commented 10 months ago

That makes sense. I may give it a try in apersonal project.

However, I'm still somewhat of a python novice. So I may not be the best option for a PR to this repo. I'm happy to collaborate on a fork or at least help test if anyone wants to lead the charge.

codeninja commented 10 months ago

Be warned, I don't think Aider is compatible with the latest openai library.

On Mon, Nov 27, 2023, 9:03 PM IT Lackey @.***> wrote:

That makes sense. I may give it a try in apersonal project.

However, I'm still somewhat of a python novice. So I may not be the best option for a PR to this repo. I'm happy to collaborate on a fork or at least help test if anyone wants to lead the charge.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/autogen/issues/528#issuecomment-1828992802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADUQUPXI3KGNE6AQNNTIDYGVH73AVCNFSM6AAAAAA63YPDCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYHE4TEOBQGI . You are receiving this because you were mentioned.Message ID: @.***>

itlackey commented 10 months ago

Yeah it's a bit of a showstopper at the moment, but openai has gone 5 days without a release so hopefully aider updates to 1.3.5 before open ai drops another release. 😉

franciscoabenza commented 10 months ago

👀

itlackey commented 10 months ago

A PR has been submitted to update aider to openai 1.3+

https://github.com/paul-gauthier/aider/pull/391

I am testing the changes this morning and it's going pretty well so far. Hopefully this will be merged soon. If anyone can help test please feel free to jump in and help get it pushed forward.

itlackey commented 10 months ago

The PR has been merged to main. This should unblock this feature. 🥳

itlackey commented 10 months ago

I believe you can do that through function calls... you would want to give the agent info on the aider commands, and then give the user access to run those commands through aider passing the agent output as the command. returning aider response as the user's message to the agent completes the cycle. You would also want some file LS methods to give the agent info about the repo, or implement, tap into, the repomap from aider. I'm following this pattern for other implementations and it's working well. … On Mon, Nov 27, 2023, 8:29 PM IT Lackey @.> wrote: I agree with @codeninja https://github.com/codeninja it would be best to leave the implementation flexible. My original idea was an easy way to drop aider into a group chat. Then have an Assitant Agent check the aider commit and issue a rollback or update if necessary as a simple example. Overall, as @codeninja https://github.com/codeninja said, the primary benefit is the repo context and existing git integration out of the box. This prevents the need to reimplement this in autogen or each app. — Reply to this email directly, view it on GitHub <#528 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADUQRNRWTNVLPPUFF5AYDYGVD7NAVCNFSM6AAAAAA63YPDCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYHE3DCNJUHA . You are receiving this because you were mentioned.Message ID: @.>

@codeninja would you be willing to share an example of what you have been doing?

sidhujag commented 10 months ago

I'm almost done mine as well it uses functions and the Coder object directly.. will share my code soon as I test that it works

itlackey commented 10 months ago

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

sidhujag commented 10 months ago

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

This is the front-end change I did: https://github.com/sidhujag/autogen/commit/6e3fce27238dcd9ac020a14f1ab068bdefbbb072

and backend: https://github.com/sidhujag/autogen-backend/commit/de0e6f411e2456454a24e95d32702c7dffc1b980

Should give you some idea!

schacki commented 10 months ago

Is there any working prototype available yet?

sidhujag commented 10 months ago

Is there any working prototype available yet?

it is working in my fork against remote github repos as well! But it should be easy now that aider upgraded OAI to hook into base autogen.. in my repo I added agents in groups to manage repository and assistant objects themselves along with discovery and persistent of those objects when using coding assistance.

schacki commented 10 months ago

@sidhujag but there is no pr for commits yet?

heijligers commented 9 months ago

It would be great to see a coding agent that could leverage the aider coding assistant tool to implement changes. The aider tool's features such as git integration could be an interesting and powerful addition to this framework.

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

This is the front-end change I did: sidhujag@6e3fce2

and backend: sidhujag/autogen-backend@de0e6f4

Should give you some idea!

I'm currently working on something similar. Would love to colaborate

sidhujag commented 9 months ago

It would be great to see a coding agent that could leverage the aider coding assistant tool to implement changes. The aider tool's features such as git integration could be an interesting and powerful addition to this framework.

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

This is the front-end change I did: sidhujag@6e3fce2 and backend: sidhujag/autogen-backend@de0e6f4 Should give you some idea!

I'm currently working on something similar. Would love to colaborate

Sure yes I took some vacation but back now. I am basically in testing mode against aider and remote github repo. It seems to be working, I would like to add a few more groups and then I think its ready to either be a stand alone fork of Autogen but with automated agent framework on top or try to merge into autogen as contrib.

Let me know your intuitions on design to know if we can benefit from each others design choices.

berkeleymalagon commented 8 months ago

It would be great to see a coding agent that could leverage the aider coding assistant tool to implement changes. The aider tool's features such as git integration could be an interesting and powerful addition to this framework.

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

This is the front-end change I did: sidhujag@6e3fce2

and backend: sidhujag/autogen-backend@de0e6f4

Should give you some idea!

I'm currently working on something similar. Would love to colaborate

Sure yes I took some vacation but back now. I am basically in testing mode against aider and remote github repo. It seems to be working, I would like to add a few more groups and then I think its ready to either be a stand alone fork of Autogen but with automated agent framework on top or try to merge into autogen as contrib.

Let me know your intuitions on design to know if we can benefit from each others design choices.

Curious if you've continued this work. Would love to play with it and help if I can.

sidhujag commented 8 months ago

It would be great to see a coding agent that could leverage the aider coding assistant tool to implement changes. The aider tool's features such as git integration could be an interesting and powerful addition to this framework.

Awesome, thank you @sidhujag! I've started hacking at it but still learning autogen. So I'm excited to see how you approach it.

This is the front-end change I did: sidhujag@6e3fce2

and backend: sidhujag/autogen-backend@de0e6f4

Should give you some idea!

I'm currently working on something similar. Would love to colaborate

Sure yes I took some vacation but back now. I am basically in testing mode against aider and remote github repo. It seems to be working, I would like to add a few more groups and then I think its ready to either be a stand alone fork of Autogen but with automated agent framework on top or try to merge into autogen as contrib. Let me know your intuitions on design to know if we can benefit from each others design choices.

Curious if you've continued this work. Would love to play with it and help if I can.

Yes it is functional, you should run my autogenstudio here to try it out: I made a skill for it and will make a workflow for it: https://github.com/sidhujag/autogen/tree/main/samples/apps/autogen-studio

thinkall commented 4 months ago

We are closing this issue due to inactivity; please reopen if the problem persists.

heijligers commented 1 month ago

@sidhujag Hi there. I'm looking at the link you've provided, but I can't find any references to using aider within autogen-studio. Can you elaborate? Thanks!

usmanovbf commented 2 weeks ago

Is there any update, please? Since this idea is really groundbreaking

@sidhujag btw, it would be helpful if you can answer the question from @heijligers