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

Personal Agent #3

Open
0x4007 opened this issue Mar 26, 2024 · 25 comments · May be fixed by EresDevOrg/personal-agent-bridge#2
Open

Personal Agent #3

0x4007 opened this issue Mar 26, 2024 · 25 comments · May be fixed by EresDevOrg/personal-agent-bridge#2

Comments

@0x4007
Copy link
Member

0x4007 commented Mar 26, 2024

Task

  • This will be registered under issues_comment.created
  • This will look for username tags at the beginning of any comment, and relay everything to their self hosted plugin.
  • The rest of the magic happens within their own self hosted plugin so this should be a super simple plugin to build.

Config

The host repository name. For example:

plugins:
  - uses:
    - plugin: ubiquity-os-marketplace/ubiquity-os-agent
      with:
        target: ubiquity-os-agent

Then comments starting with @0x4007 will relay the full issues_comment.created payload to 0x4007/ubiquity-os-agent

Context

This one I'm very excited about. The vision here is that we can make custom user "agents" (i.e. plugins with LLMs) that are hosted by the user's GitHub (so they can modify it) and will automate actions for the user (with their PAT to authorize as them) with the full context of a particular repository/organization.

  • We make a repository that power users are intended to fork, for example @ubiquibot/personal-agent -> @pavlovcik/personal-agent
  • A repository/organization configures personal agents command to be /@<user's name> /@pavlovcik maybe something like that. This should also support arguments, for example a sentence that can be parsed by an LLM /@pavlovcik review my pull #123
    • This technically would allow other users to invoke other user's agents. We can easily see if the invoker is an "authorized" user by checking the event context, and hard coding authorized users (self) in the boilerplate plugin code.
    • I wonder if it would be more useful if we just look for comments that start with a username tag instead, it might be more natural to set up automations for common questions/requests i.e. @pavlovcik can i work on this issue? then my agent, with my PAT, and my custom prompt saying what to do in this situation, would just automatically assign them and explain the /start command.
  • The kernel will invoke a request (and pass all parameters) to that user's plugin/agent (hosted at @username/personal-agent actions)
  • The user can grant access to their PAT from their agent, allowing the agent to act on behalf of the owner inheriting their permissions.

There are some ways we can make the template code which will be forked:

  1. simple starting point would be just template/boilerplate that doesn't do anything
  2. code makes a call to an LLM (we could even run a small model locally on the GitHub Action runner potentially in order to make dealing with credentials/API keys more hands off, at the tradeoff of it being dumber than ChatGPT etc but decentralization/free is cool)
    1. this LLM has a big prompt in the template that explains the context (you're running in a github action runner and a user invoked you from this repo...) and its capabilities (we can provide some local functions from our SDK that it can invoke to perform specific tasks by using an authenticated octokit instance using the person's PAT. It also receives all of the context of the event invocation (which user called the function, what repository and organization is it coming in from? possibly even scraping all the linked issues and pull requests for more context)
      2. If we can reliably get the LLM to write working code with Octokit (or just raw CURLs with the PAT) then we can have a context aware and english language input to any function a user can perform on GitHub (limited to the PAT permissions) which is quite interesting.
      3. The user can "fine-tune" their LLM by adding extra details and preferences to their prompt in their forked code. I imagine that I would continue to add new sections as I see repetitive questions/queries.

Assuming that the org config enables support for personal agents, technically we can extend personal agent capabilities beyond GitHub. Generic telegram example: @pavlovcik send me the credentials on Telegram @username with the right code in my personal agent, the GitHub Action can send information to their Telegram. All invoked from the GitHub Action runner!

This could make plugin development a lot more exciting and rapid. If the team all works on their own agents, and tests them in production, we could extract useful bits from eachothers' and release "official" plugins which may normally have slower r&d cycles.

In the further future, our kernel can support webhooks coming in from other services (like Telegram) and invoke user agents which can be a very powerful architecture for platform composability. For example, a bot call (can be "inline" in a dm to someone as well) that will pass along the conversation context to our kernel, then to a user's personal agent (github action) back to kernel and then back to Telegram

Notes for @pavlovcik/personal-agent

  • I want to make use of the XP system (as an admin) to soft incentivize/disincentivize behaviors.
    • Prompt follow ups: there are situations where I tag team members for input and they take days to reply. I think if they take longer than 24 hours to reply, I would want to dock XP, and include an automated follow up (perhaps even on Telegram dm!) High performing team members generally reply promptly. XP can be used as a heartbeat for how actively engaged the contributor is, and how well they are performing, which is important for performance evaluations regarding base pay.
    • On the other end of the spectrum: unnecessary tags1. If I make it clear to team members that I am around to help but more for emergencies, I would appreciate not being pinged on things unless its essential. Would be interesting to make a personal agent that will automatically reply (like an away message) explaining this, while also scrubbing out the tag from their message. Assuming it is during my awake/working hours, I would still receive a push notification on my device from the original tag.

Planned Capabilities

Comment rewrites:

From my phone sometimes writing comments can be arduous with the custom vocabulary we use and the autocorrect. A simple agent that will save me from a lot of frustration is to edit my comments posted, and correct any typos when I post from my phone.

Review and follow up:

Sometimes a pull request will be 99% of the way there. It will be something like "just make sure CI passes" or "fix merge conflicts"

Ideally the personal agent should monitor pulls that I approved and are still opened. If I said something like this, and if those conditions are met, it should merge the pull.

Similar 2

Footnotes

  1. Although it is not clear to me how we can capture the event from this. I suppose I would need to manually add in the org/repo config for issue_comment.created.

  2. 2025 Plugins Wishlist 84%

@0x4007
Copy link
Member Author

0x4007 commented Sep 30, 2024

@gentlementlegen how would this look from a plugin config standpoint? Perhaps we make a special adapter? For example, we attach an issues_comment.created plugin that will route the request to one's "personal agent"?

@gentlementlegen
Copy link
Member

If you do like other plugins and hook it to the issue_comment.created you will already get the full payload for that event, how would this differ?

@0x4007
Copy link
Member Author

0x4007 commented Sep 30, 2024

I take that as a yes. Then we can make the only config option to be the host repository name. For example:

   - with:
       name: ubiquity-os-agent

Then it will relay the payload to 0x4007/ubiquity-os-agent

@gentlementlegen
Copy link
Member

As long as you have the bot installed in your organization, you can hook any plugin from your organization you want to see running so

plugins:
  - uses: 0x4007/ubiquity-os-agent

would run your agent.

This comment was marked as outdated.

@0x4007
Copy link
Member Author

0x4007 commented Oct 1, 2024

This issue seems to be similar to the following issue(s):

@sshivaditya2019 this is becoming recursive so I don't think its working correctly. It just keeps stacking more every time I create a new issue.

Copy link

ubiquity-os-beta bot commented Oct 3, 2024

Note

The following contributors may be suitable for this task:

sshivaditya2019

77% Match ubiquity-os-marketplace/generate-vector-embeddings#25

@EresDev
Copy link

EresDev commented Nov 27, 2024

/start

@EresDev
Copy link

EresDev commented Nov 27, 2024

We make a repository that power users are intended to fork, for example @ubiquibot/personal-agent -> @pavlovcik/personal-agent

Who is a power user here? Are we restricting it to specific contributors or parters? It looks like anyone can host the personal-agent plugin.

We can't have this in the configs.

plugins:
  - uses: 0x4007/ubiquity-os-agent

The reason is if we are all going to use it, are we going to edit configs for all contributors and contributors joining us in future.

plugins:
  - uses: 0x4007/ubiquity-os-agent
  - uses: EresDev/ubiquity-os-agent
  - uses: gentlementlegen/ubiquity-os-agent
  and so on....

So, if I am right here. We have two solutions.

  1. Let the kernel call to this personal agent plugin dynamically by looking at the comment. However, it adds to the responsibility of kernel, and we should not do that.
  2. A second plugin, personal-agent-bridge that accepts event from kernel and calls the specific personal-agent plugin.

So, solution 2 seems right to me. Please let me know what you think.

As I understand, the deliverables of this issue are one or two plugins (depending on which solution we choose), and provide and show successful communication between them on correct preconditions (the /@EresDev mention).

@0x4007
Copy link
Member Author

0x4007 commented Nov 27, 2024

  1. The bridge makes sense. This was basically my suggestion here.

Copy link

Passed the deadline and no activity is detected, removing assignees: @EresDev.

@EresDev
Copy link

EresDev commented Dec 2, 2024

/start

Copy link

! EresDev you were previously unassigned from this task. You cannot be reassigned.

@EresDev
Copy link

EresDev commented Dec 2, 2024

! EresDev you were previously unassigned from this task. You cannot be reassigned.

What to do about this now?

I am working on it in these repos.
https://github.com/EresDevOrg/personal-agent-bridge
https://github.com/EresDevOrg/personal-agent

@0x4007
Copy link
Member Author

0x4007 commented Dec 2, 2024

Normally you're supposed to open a pull on your own repository and link it here so that we can keep track of progress. You should do that now to maintain your assignment.

@EresDev
Copy link

EresDev commented Dec 2, 2024

I think the issue hasn't picked up the PR as it doesn't show it in May be fixed by... section. I don't see the options to modify the Development section of the issue either. Let's see if mentioning it here helps it to pick up the PR EresDevOrg/personal-agent-bridge#1

Edit:
The current active PR for this issue is EresDevOrg/personal-agent-bridge#2. The above PR was closed as incomplete as it was not targeting default branch.

@gentlementlegen
Copy link
Member

I think it didn't pick up the pull-request because you do not target this repository / organization.

@0x4007
Copy link
Member Author

0x4007 commented Dec 3, 2024

Actually it only works if you target the default branch, development

@EresDev
Copy link

EresDev commented Dec 5, 2024

I am looking into a way to authorize the communication between the bridge and the personal agent. The problems is, you can't run workflow on personal agent from the bridge. The reason is, bridge is going to be hosted by our organization, but the personal agent is going to be hosted by the user's account. You can't run the workflow of personal agent plugin fork from the bridge with some kind of authorization/authentication.

One way that works smoothly is, UbiquityOS is also installed by user on the personal agent repository fork. But do we have some other concerns here? Like UbiquityOS responding to other commands in their personal agent fork?

Other way I have in mind is to ask personal agent fork user to store their encrypted PAT in some config file in the repository that the bridge can fetch, decrypt, and use. Bridge needs this only to run the personal agents workflow, and this approach looks like an overkill to me.

Do you have any other suggestions? I would appreciate it.

@0x4007
Copy link
Member Author

0x4007 commented Dec 5, 2024

I am looking into a way to authorize the communication between the bridge and the personal agent. The problems is, you can't run workflow on personal agent from the bridge. The reason is, bridge is going to be hosted by our organization, but the personal agent is going to be hosted by the user's account. You can't run the workflow of personal agent plugin fork from the bridge with some kind of authorization/authentication.

One way that works smoothly is, UbiquityOS is also installed by user on the personal agent repository fork.

This is perfectly acceptable.

But do we have some other concerns here? Like UbiquityOS responding to other commands in their personal agent fork?

It must be configured to do so with the yml file so this shouldn't happen unintentionally

Other way I have in mind is to ask personal agent fork user to store their encrypted PAT in some config file in the repository that the bridge can fetch, decrypt, and use.

We have our built in encryption with the X25519 key so we can do the same if necessary.

Bridge needs this only to run the personal agents workflow, and this approach looks like an overkill to me.

Do you have any other suggestions? I would appreciate it.

@EresDev
Copy link

EresDev commented Dec 6, 2024

I am looking into a way to authorize the communication between the bridge and the personal agent. The problems is, you can't run workflow on personal agent from the bridge. The reason is, bridge is going to be hosted by our organization, but the personal agent is going to be hosted by the user's account. You can't run the workflow of personal agent plugin fork from the bridge with some kind of authorization/authentication.
One way that works smoothly is, UbiquityOS is also installed by user on the personal agent repository fork.

This is perfectly acceptable.

I wanted to do it like this. It would have made the usage very simple, fork the personal agent and it starts working. But I have sen that the kind of auth token kernel provides doesn't trigger workflows of personal agent forks on other github accounts. Because of this, I am going with Github PAT with X25519 encryption mechanism.

Copy link

@EresDev, this task has been idle for a while. Please provide an update.

@EresDev
Copy link

EresDev commented Dec 12, 2024

@EresDev, this task has been idle for a while. Please provide an update.

Hoping to be back to this soon.

Copy link

@EresDev, this task has been idle for a while. Please provide an update.

@EresDev
Copy link

EresDev commented Dec 16, 2024

@EresDev, this task has been idle for a while. Please provide an update.

Working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants