Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Auto Reply Agent for issues and discussions #5104

Open
ekzhu opened this issue Jan 18, 2025 · 6 comments
Open

GitHub Auto Reply Agent for issues and discussions #5104

ekzhu opened this issue Jan 18, 2025 · 6 comments
Labels
example-app work which include a runnable example
Milestone

Comments

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 18, 2025

An long running agent or multi agent workflow that monitors new discussions and issues on a GitHub repo, and automatically generate a response. It supports posting the response once user edits and approves it.

Interface can be a Teams bot, or something more general.

Try this on the AutoGen repo.

Components:

  • Basic connection to GitHub, authorization
  • UI: Teams Bot
  • Memory: search index over existing replies
  • Learning: learn user edits, preferences, and triaging routines over time, filter learning sources by users

Discussions and issues moved to https://github.com/microsoft/gh-gitgen

@ekzhu ekzhu added example-app work which include a runnable example and removed needs-triage labels Jan 18, 2025
@ekzhu ekzhu added this to the 0.4.x milestone Jan 18, 2025
@gagb
Copy link
Collaborator

gagb commented Jan 18, 2025

What if we first focused on an AutoGen powered agentic CLI that complements the gh CLI?
https://cli.github.com

bot issue 1234 draft-reply
bot pr 43 draft-reply
bot issue 999 find-duplicates

The bot instance (including its memory) will be tied to the repo.

@ekzhu
Copy link
Collaborator Author

ekzhu commented Jan 18, 2025

https://cli.github.com/

This is lovely.

It supports creating your own extension, which is just an executable script.

In its basic form, the agent can be a script that runs through the open github issues that the users have not responded to and suggest a response.

@gagb
Copy link
Collaborator

gagb commented Jan 19, 2025

Extension sounds right. Here's a template of gh autogen extension that calls the AutoGen hello world python example. We can replace it with a GH agent with access to repo name and GH API key and equip it with simple tools that access specific issues and PRs. And can generate well thought responses. We could use multi-agent reflection to ensure drafted responses fit maintainer's expectations. We can add tool calls that update maintainers expectations.

Structure

  • Bash Entry Point: gh-autogen – Calls the Python script.
  • Python Script: autogen.py – Contains the specified Python code.
  • Metadata: gh-autogen.yml – Describes the extension.

Code

  • gh-autogen:

    #!/bin/bash
    python3 "$(dirname "$0")/autogen.py"
  • autogen.py:

    import asyncio
    from autogen_agentchat.agents import AssistantAgent
    from autogen_ext.models.openai import OpenAIChatCompletionClient
    
    async def main() -> None:
        agent = AssistantAgent("assistant", OpenAIChatCompletionClient(model="gpt-4o"))
        print(await agent.run(task="Say 'Hello World from gpt 4o!'"))
    
    asyncio.run(main())
  • gh-autogen.yml:

    name: "gh-autogen"
    description: "A Python-powered GH CLI extension to run AutoGen tasks."

Usage

  1. Install:

    gh extension install .
  2. Run:

    gh autogen

    Output:

    Hello World from GPT-4o!
    

@gagb
Copy link
Collaborator

gagb commented Jan 20, 2025

Ive made significant progress. Update soon.

@gagb
Copy link
Collaborator

gagb commented Jan 20, 2025

I've started the development of a light weight sample code here: https://github.com/microsoft/gh-gitgen

@ekzhu
Copy link
Collaborator Author

ekzhu commented Jan 20, 2025

Alright lets use https://github.com/microsoft/gh-gitgen for further discussions and issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example-app work which include a runnable example
Projects
None yet
Development

No branches or pull requests

2 participants