← All video transcripts

Why Every AI Agent Needs a GitHub Repo (Live Workshop)

Description on YouTube

Free Live Workshops every Tuesday and Thursday 8-30 AM PST / 11-30 AM EST https://www.ability.ai/workshops Trinity Live Workshop #5: Why Every AI Agent Needs a GitHub Repo (Live Workshop) https://github.com/Abilityai/trinity https://github.com/Abilityai/cornelius https://discord.gg/fvxMXyKK Most people think GitHub is where you store code. For autonomous AI agents, it's something much bigger - the source of truth, the versioning system, AND the project manager. All at once. In this workshop, I break down how I actually run autonomous agents on Trinity using GitHub as the backbone for both state management and work tracking. No custom databases. No bespoke task queues. Just issues, commits, and three lifecycle hooks that make the whole thing reliable. In this video, I cover: - Why every agent should have a GitHub repo (and what breaks when it doesn't) - The work loop pattern: how agents pick, execute, and close their own issues - Three lifecycle hooks that guarantee state is saved (session start, pre-compact, session end) - Why hooks beat asking the LLM to "remember to commit" - The Ability plugin marketplace: add-git-sync, add-backlog, create-playbook - Dashboard YAML vs agent-managed websites - and why I'm moving to the latter - Live walkthrough of Cornelius, the Mold Book agent running on Trinity If you're building anything that needs to run autonomously for hours or days, this is the infrastructure piece most people skip - and it's what makes the difference between a demo and a production system. --- TIMESTAMPS: 0:00 - Intro 2:00 - What Trinity is and why it matters 3:00 - Cornelius: a live autonomous agent 4:30 - GitHub as dual-purpose infrastructure 6:00 - The work loop pattern (30-40 min chunks) 8:00 - Backlog, pick-work, close-work skills 10:00 - State management with three lifecycle hooks 13:00 - Installing git-sync and backlog plugins 15:00 - Dashboard YAML walkthrough 17:00 - Agent-managed websites (the better alternative) 19:00 - Q&A --- #AIAgents #AutonomousAgents #Trinity #AgentInfrastructure #GitHub

Full transcript

Source: YouTube auto-captions, language en. 3,778 words. Each timestamp links to that point in the video.

[0:00]Hi everyone. Thank you for joining Alex. Please feel free to jump in with questions. Hi Ryan. If you have ones as we go, I will of course come back to them at the end. Reza, nice to see you. Yeah. Now we actually usually have like 10-15 people here, but I run this thing like twice a week and it's just too much for some folks and and we also just started. I think we're going to have more as we go. Yeah, the trick for me is that I'm actually using this content also for YouTube. So whatever we record here goes to YouTube and then joins the

[0:32]tutorials on Trinity. So it's like double purpose for me. Not just the workshop itself, but also the content out of that. But anyway, let's go. All right, guys, let's get started and again, just to remind some of the basic rules. You can type your questions in the chat. I will respond to them at the end. If you want to join conversation live or have questions live, feel free to request to join and I will drop you in, but you will be on the recording. And the last few times we were talking about a number of things. We started with creating and deploying basic

[1:05]agents. Last time I was showing you our agent system that was running the software development and next time I will show you once I have my limits recovered. My limits are recovering. I will show you the system of these oracles for predictions. But today I have probably quite short, but also quite specific thing I want to address. First of all, let me remind what Trinity is. So Trinity is an orchestration infrastructure tool for running autonomous AI agents and systems with that. Each of these agents that each of

[1:39]these boxes that you see on your screen is a Docker container with a sandbox stateful agent that's basically running and gaining memory expertise and over time as it grows and creating more value as it grows while talking to other agents and systems from within here. And today I want to focus on an example of one particular agent, this Cornelius, which is the mold book agent that is basically running in the agent social media to post various articles over there, do the research and run some projects and stuff like that. And I want

[2:13]to use that as an example of how we leverage Git and GitHub specifically for two things. First of all, it's a state management for agents and second, it's a project management for agents. Like two capabilities that are quite important, if not critical, to the functioning of these agents. I'll start with a couple of images just to remind you that this flow is basically my daily flow of working with with any of the agents that are deployed. I have my local agent running on my Mac just like this in the

[2:47]the terminal that is synchronized with the remote agent running in the Trinity and on a particular instance of Trinity and these agents are synchronized through the GitHub repository as a source of truth, as a versioning system. And the remote and local are also connected through the MCP, which is basically like a nerve center for all the information exchange between Trinity and within Trinity. Of course, the MCP is respectful of all the permissions, which is one of the main value props and offerings over here that you can gradually define which agents have access to what other agents and your MCP

[3:22]and API and the rest UI, of course, will respect that. That means that for this admin view, for example, that I have where I have like I don't know how many, but many different agents. Some of them I created, some of them other users created and this is my view that shows me everything cuz I'm an admin on this particular instance, but other folks would only see their agents unless some other agents are shared with them over here within the system. But as I mentioned, like every every agent is basically a GitHub repo. And if we talk about this Cornelius app, for example, it's also a GitHub repo. It's a private

[3:55]repo that is with the architecture that is based on Cornelius. And as you can see, it has a whole bunch of different files that it's tracking within the brain over here. We can find the entire knowledge base of this thing, which is quite large that it's updating every iteration. And the agent itself, if we go into that, has a ton of different schedules set up for the synchronization of the website because it's it's cool. It's running its own website with you know, the regular updates of the beliefs and concepts that it is storing, but that's not what I'm talking about.

[4:29]It's doing some weekly analysis and meme tracking and then digest of the mold book and then some project work, which is what we're going to be focusing on a little bit today. And things like daily learning synthesis just to combine the learnings and put them into the knowledge base. But most important one I would say is this heartbeat procedure, which is a traditional way to run this type of agents. Like this heartbeat is scheduled to run every other hour if I'm not mistaken and it's basically triggering, waking up and doing work on the mold book itself, analyzing some data, doing

[5:03]some posts, commenting and stuff like that. But when we need to get to the actual project work, the solution that I'm proposing over here and I'm using myself actually with this agent is something like this. So basically I use a standard issues flow on GitHub for managing work of the agents where well, actually it's not me who's managing this work. It's them who are managing their work and creating and updating those issues as they progress on that. And if you remember in the last few workshops, I was talking about this

[5:37]abilities marketplace, which is you know, our our plugin marketplace with a bunch of these tools and you can go ahead and install the same kind of GitHub project management skill set for your agents and start managing it in the same kind of way and I'll show you how to do that, but right now I just want to focus on showing you how that actually functions. So the idea of the flow is like super simple as as we usually do. Like we have item in the to do, we put it in progress and it goes into done, it goes into blocked and resolved. So super simple without any complex SDLCs because

[6:10]agent needs to manage that themselves and they need to do that reliably. So every time that we have a schedule for the work log work queue, it wakes up and it chooses the task based on the priorities and does the work. It saves the work as it's supposed to into GitHub and updates the issue status. Actually right now as in, you know, experimental, I'm figuring out um how big of a work to give it, how big of a work it needs to run. Right now the logic is like I want it to run for about

[6:43]30-40 minutes doing work and if it sees that, you know, it needs more, then it needs to save the work and wait for the next cycle. I don't want it to run for over 40 minutes. I'm thinking maybe I will be measuring that by the number of times as well, which is the guardrail that we already have in Trinity as well. But so far that's the logic basically. Now, when it does like when it looks at these things, it not only resolves the task, but it also creates the task based on the projects that it came up with and

[7:17]what it wants to work upon and basically doing that within the same exact schedule. So if we look back here, there's this project work that calls this work loop playbook. So I will go back to the local version and say something like, let's say, work loop ELI5. That's like explain like I'm 5 years old. So let's see what it takes me and what it tells me. So we're waking up. If nothing to do, we do nothing. If there's a chore, we do the chore. When done, we close it under 40 minutes and if blocked, put a sticking on saying

[7:51]that I'm blocked. So that next next time it wakes up, it does something something like that. Now, in addition to this skill that we have in the package of the work loop, which is like running autonomously, there's a bunch of skills that the agent can call in the context of other skills or I can call them manually. For example, there is a backlog skill, which basically just going to go to GitHub and find what we have on the backlog and give me a list or give agent a list. And again, if we go to GitHub itself, we can see that all the issues are

[8:23]kind of living here. So yeah, it kind of gave me what is in progress, what is what is queued, what is etc. And then we have a couple of other skills, the name of which I forgot, but I need to oh yeah, backlog, pick work, close work. So those are specifically for working with um with particular kind of issues. Like we can try to run pick work and see what happens there. Yeah, so it says I already have work in progress, allowing me one thing in progress. Once I don't have it, it will, you know, kind of do the do the rest of the work and choose

[8:56]it. So again, the idea is like if I rely on the existing kind of solid infrastructure with issue management for agent work management, that it gives me the transparency and visibility that I need to see what this what this guy or whatever it is is working upon and manage it and add the tasks manually and just do it in a super standardized way. So that's all good and well, but the real question here is how do we manage the state? And that's the next thing I want to talk

[9:30]about. Right, so to manage the state, what I traditionally do and you probably would see that in if you're using Trinity in any way, you would see that most of the agents have GitHub repository associated with them. It's basically not a good practice to not use a GitHub repository with your agents. All of them or most of them do. As you can see, there's this line over here indicating that which a is used for for a given agent. And we already have like native push and pull functionality that is supported by

[10:03]Trinity itself. And the same functionality is accessible and available from the standard Trinity sync commands. So basically when I'm running Trinity sync, it synchronizes my local and remote version of the agent. What happens is this loop. It basically you know asks the remote to check the status with the uncommitted work and does the same on local and then finds a strategy. There's a couple of situations obviously where there's a conflict that needs to be resolved, but in most cases it's

[10:36]something that is easy to figure out. So basically the communication channel is used to tell the remote what to do and how to like land on the same version within GitHub. So this operation is already here and I'm I'm using that while working with that. And then I thought like okay, what if why sort of make it a little more straightforward for myself and made sure that actually state is saved correctly every time agent does the work. And that's where I set up this three lifecycle hooks. So if you're not familiar, hooks are basically

[11:10]things that are triggered scripts that are triggered independently of the LLM at some points at some events in the agent lifecycle. For example, in the session start, in the compacting, in the session end and in some other custom hooks that can be defined. The logic is it is guaranteed that this hook is going to be executed and as long as the agent is kind of functioning. It's not the same as you ask the cloud code or or some other agent, I want you to do something and then hope that it does that or control it. You're not sure

[11:43]because it does have some variability in that regard. But if I want to guarantee, I'm using hooks. So what I did over here, I I created this and I'm pretty sure other folks did same thing or the very similar thing as well, so it's not like anything noble over here, but it's very convenient. What happens is that at every session start, we are updating the state of the agent and it's running on remote automatically. And so every time the agent starts working, it starts with the whatever is the most up-to-date version. So I don't actually have to run Trinity sync all the time. I it's enough

[12:18]for me to run if I make changes in the local version, it's enough for me to just push changes into repository and forget about that because next time the remote will start, it will pick up the changes and go from there. The second one is for saving the work in progress in the pre-compact phase, which is one of the kind of dangerous phases as it you know it starts making mistakes after the compaction and it's better to save it at this at this thing. And at the session session end, it's basically committing and pushing all the changes that need to happen

[12:51]there. And so yeah, that's that's the whole logic of this uh of this stuff. And the way to use it is super straightforward. I want to switch to to that part. So I mentioned to you that we have this Abilities plugin marketplace. You can install it in the plugins over here and it has a bunch of uh different things available and among those things few like three are super important for the process. One of them is the create agent plugin which has a whole bunch of scaffolding agents skills. So basically something that

[13:24]allows you to scaffold an agent that is specific to something very quickly. And then we have agent development plugin which is the plugin that includes skills for actually building the agent that does include those two skills that I was talking about just now. And it also includes the playbook building skills the ones that I'm using like all the time and some other useful stuff I would say. And then the Trinity is the one that is focused on deploying and syncing agents to Trinity platform as well as connecting to Trinity platform and requesting access to the instance and things like that. So basically that's

[13:57]the logic. Like here is the one for scaffolding, here is the one for the day-to-day development and here is the one for deploying and maintaining this thing on the remote instance. Now I already have three all three of them installed. If you need some documentation on how to use that, as always go to the docs.ability.ai website, which is where you have all the instructions on how to install those agents, how to deploy agents to how to install marketplace, how to install those plugins and and the rest of the documentation and guides around Trinity system itself. Agent uh

[14:30]Uh-huh, so this is the plugin and then we have a bunch of stuff over here to actually install install. So this is the installation of the backlog, installation of the GitHub sync and of course playbook functionality and the rest of that. So all you need to do to install the hooks is really to just this add git sync call it and it will make it happen. And of course you will need to make sure that it is installed on the remote and that it's running on the remote. Now you can enable and disable them like this git sync enable and git sync disable or I think it's one

[15:04]skill actually. No, it's two. To turn this functionality on and off because sometimes it's necessary, sometimes it's unnecessary, but when my agent is reliably and for a long time running on remote, I definitely set this to enabled because the like if they're in the autonomous mode, I need this stuff to work as expected. And the same goes for the skills related to project management, which is I think this one. Yeah, the GitHub backlog. Yeah, that's the right one. So basically what it what this one is going to do is install those four skills that I mentioned to you that run the management of the issues within

[15:39]GitHub for your agent as the work backlog. Now again, none of that is necessary to do or required to do, it's just the conveniences that I find when I'm working with uh um autonomous agents like the ones that I've just shown you. So that's that and maybe one other thing while we have time that I would like to show you is the dashboard. So you may have noticed that some of these agents have dashboards, others don't have dashboards and obviously dashboards do not go there by default. That's something that

[16:12]needs to be built for each agent individually because each individual agent has its own sort of functionality and needs to display its own numbers. What Trinity does however is it renders those dashboards in a dynamic state. It saves the snapshots of the dashboard data and keeps it updated. So you can see these little charts and in this case nothing changes, so charts are basically flat, but if there's something changing in the last couple of days, you would see a dynamic on the chart and and the updated numbers. Now in order for you to

[16:47]uh add a dashboard to any of your agents, what you need to do is you need to also install the plugin marketplace because this skill Trinity create dashboard, it's there. So what this one will do is it will create a YAML file in the repository of an agent. And this YAML file will include Actually, let me show you. GitHub. This YAML file is a format that is accepted by Trinity with some metrics over here. You can see that

[17:20]that's exactly the values that we see over here. I just rendered differently. So this dashboard YAML is like a snapshot and those snapshots are snapshots are saved into Trinity database. So it does know how the values have been changing and migrating. So when you do the create dashboard, it will create this initial dashboard YAML file, but more importantly, it will create a custom tailored custom-made update dashboard skill. And this update dashboard skill is something that you would need to call in order to update

[17:53]the file going forward. And in some agents I'm just setting it on the schedules and just saying like okay, go update your dashboard every uh I don't know couple of days or couple of hours, whatever the agent is doing. But yeah, the logic is like when you need to keep it updated, you keep it updated by calling the skill and this way agent have has a say in what is displayed on the on the dashboard. Hello again. What I found more useful recently is with the website creation agents that we have over here like this one, Ability website

[18:27]for example, is running our entire website. And you can also do that through plugins because it's already this create website functionality is already here. It's actually creating you an agent that is running a given website that you describe after you go through some Q&A and quizzes and stuff like that. And so I found that it easier for me to create a complete website for an agent that will represent its state including some dashboard functionality and some some other things. Where did all my stuff go? Okay. Um let me show

[19:03]you. So this one is for Cornelius that I was just showing you. Again, this whole website with all the like little pages and informational things and whatever it is is managed by an agent deployed to Vercel hosted on Vercel and GitHub and yeah, fully managed by the agent. So the actual Cornelius agent has itself update website script or skill that updates the actual website agent and skill. So that's one example and another example which is more kind of dashboardy is the Oracle system that runs this seven or

[19:40]eight different agents that are basically like constitute the self-improving prediction system. And this one is a lot more kind of numeric. It has a lot of data, a a of numbers over here, some charts, and stuff like that. Uh even though these particular charts are just uh images, but still they are updated and managed by um an agent managing the website. So, yeah, what I was saying here is that I I kind of lean more to those like website managed by agents with these other agents controlling them rather than just

[20:12]using dashboard cuz dashboard is still kind of limited in what it can do over here. So, I think that's it for today. Uh it's going to be a short one. So, I will go through questions quickly. Which agent uh were you just taken to? Was it Cornelius? How do you pick it? Right. So, yes, that was Cornelius that I was showing during this presentation, but it was a special version of Cornelius that is a Cornelius uh moldbook uh that is working on moldbook. Basically, it uses the principles of Cornelius uh knowledge base, but for the purpose of, you know,

[20:46]running on this uh social media platform. So, yeah, the answer is yes. So, yeah, uh there you go. Thank you so much for your time, and looking forward to seeing you next time. Bye-bye.