From Your Laptop to the Pipeline: Scaling Custom Agents with GitHub Copilot
AI Engineer · 19 min · 220 sentences · from YouTube's caption track
Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.
- 00:01[music]
- 00:12Hey everybody, thanks for coming.
- 00:14My name's Jose Palafox.
- 00:15I've been at GitHub for 6 and 1/2 years.
- 00:18So, I joined the team right after the Microsoft acquisition of GitHub and then shortly after GitHub acquired a tool called Semmel.
- 00:26We made an acquisition of a security company.
- 00:28And so, my role at GitHub really has been growing our security business for the last five or six years.
- 00:34In the last year, I really kind of focused on AI, but my role is to work in the field working with customers on how do they adopt our technology, how to think about scaling our technology inside of their organization.
- 00:45So, today what we're going to talk about is really just like an introduction to agents on the platform and there's sort of two different modes that I like to think of agents in.
- 00:55There's like autonomous agents that I have off running in the pipeline and then I have local agents that I'm using to do various bits of work.
- 01:02So, I'm going to kind of walk you through sort of how to build those, how to think about them, how to think about scaling them, and think about different workflows that are possible using agents.
- 01:11This talk is going to be fairly high-level.
- 01:13So, if you have additional questions afterwards, you want to chat, feel free to grab me.
- 01:17I'll kind of hang out right after the talk in the back of the room.
- 01:20You can feel free to come by and chat with me afterwards.
- 01:22We can talk a little bit deeper about your use cases.
- 01:25This is a quick preview of just kind of things that are available on the platform.
- 01:28Just getting us started, I always like to baseline with sort of the overall data flow of how Copilot works on the platform because a lot of people aren't familiar with how
- 01:38Copilot works under the hood and and maybe aren't familiar with all of our different interfaces.
- 01:42So, just to give you a quick preview of what the product has, you've got a handful of different interfaces that you can use to interact with the coding agent.
- 01:51You've got the IDE, you've got the GitHub CLI, which is sort of a lightweight interface that sits on your desktop.
- 01:56You can take any session from the CLI and you can stream it.
- 02:00So, if you want to you know, close your laptop or walk away from your laptop for a period of time, you can either delegate the agent to github.com and have it go run in the background
- 02:10or you can stream it using a command {slash} remote and it'll let you log in through your mobile device and actually steer the agent from your mobile device.
- 02:18You've also got the SDK.
- 02:20So, if you want to create agents that live inside of Slack or inside of Teams, I'm exposed some individual functionality to a set of team members that maybe don't have a GitHub license,
- 02:30you can do that pretty easily through the through the SDK.
- 02:33So, you can build applications using the CLI or the SDK.
- 02:37Regardless of what door you go through on the top, you're going to hit this blue box here and this is what we call Cappy or the Copilot API service and
- 02:46this is also referred to as like the harness, right?
- 02:48This is the thing that does all the difficult engineering tasks taking your input and chunking them and sending them to the models making sure that you're not repeating any content from open source providers,
- 03:00dealing with authentication for you, dealing with metrics logging, dealing with audit logging, all of the kind of like to-dos of the infrastructure of the platform.
- 03:08And then of course, once you send a message in, we take that and we pass it to the model providers.
- 03:12So, regardless of which door you go into, you hit the harness and then we take your output and we send it to the model providers.
- 03:20Once we get the output back, we filter it and then display that back to you.
- 03:24So, that's sort of under the hood how the product works just so you kind of have like a high-level understanding of the different doors you can go through and and where you can touch it.
- 03:33Now, if you're starting in the CLI for example, you have a handful of embedded agents and I think it's useful to kind of look at the embedded agents just to understand
- 03:42what agents do because there's like a lot of different you know, potential ways that you could implement whether it's an agent or a skill or you know, it all just ends up being marked down at the end of the day.
- 03:52So, it's useful to kind of see how um we're implementing agents in the platform in a way that uh you can utilize.
- 03:58So, I just type {slash} agents, and all this does is drop up the um the default agents that are part of the CLI harness here.
- 04:05You can see I have a handful of them, right?
- 04:07So, if I want to explore a code base, for example, I don't necessarily want to use the biggest model possible uh in order to do that.
- 04:14So, we have a specialized research agent, which is our explorer agent, um that you can call or invoke uh through a keyword or actually invoking like the {slash} command
- 04:24um in in in the CLI, and it'll spin up, you know, a small model using Haiku, um and go and investigate a code base, right?
- 04:31If you um you know, have a plan that you've done, right?
- 04:35And you've written out a planning document, and you want a different model provider to come and audit the plan because it has different training data and different model weighting,
- 04:43uh then fine, you can do that.
- 04:44Rubber duck is like a embedded agent that will validate a plan that we know was written by Opus with, you know, a pass from GPT or something like that.
- 04:52Um you can see in all of these models they specify or in all of these agents they specify the model, and that's one of the options that you have when you're building custom agents.
- 05:00You can always control the model that you're using, and then you control the instructions that you're giving it.
- 05:05So, if these model or these um agents aren't doing, you know, something that you need done, right?
- 05:10If you have a specific task or a review or you have a compliance or um regulatory requirement that you have to meet, and maybe you have a tool that you want to run or um a series of checks that you want to have that are custom to you.
- 05:22May maybe you want to write an agent.
- 05:24And you know, if you uh want, you can you can just use the agent command here, and it will um set you through like a a work uh a workflow to add an agent into your your CLI environment.
- 05:36So, here I'm getting to pick, you know, do I want this on the project level like in the Git project that I'm working on, or do I want this as like a um an agent that's available regardless of which project I'm working on at the user level, right?
- 05:48Um so, maybe I'll say I'm out of that at the at the org level or at my my my individual user level.
- 05:54And then I go ahead and create this with Copilot.
- 05:56Copilot will do all the scaffolding for me.
- 05:58So, um if I uh want, I can generate an agent that maybe uh you know, looks at the GitHub change log and it um you know, will summarize all of the latest features or something that that Copilot did.
- 06:10So, I did that earlier today and just generated a sample agent, you know, using this uh agent builder that's built into the platform, right?
- 06:17And this is available in all of the interfaces.
- 06:20Um you know, if you have the IDE, you have an agents interface there as well that will do the same kind of build build process with you.
- 06:25But, what's nice is it scaffolds everything out.
- 06:28So, from like a basic one-line prompt that just says, "Hey, I want to go to the change log and summarize all the changes."
- 06:33It'll write the description for me.
- 06:34It'll format all the front matter.
- 06:36It will um structure success criteria.
- 06:38It'll take an attempt at structuring methodology.
- 06:41Like, it kind of knows how to write these files.
- 06:43So, you get to be uh you know, somewhat lazy with it, right?
- 06:46You you you just write a general description of what you want to get done.
- 06:49We'll fill in all the specifics for you.
- 06:51You can of course come in here and edit all of this, right?
- 06:53So, if you don't like uh the order that it's um picking, you know, sources in this case, um we could change that, right?
- 07:00Like, this one wants to start with, you know, use the GitHub roadmap, but maybe you want it just to jump straight to the change log, so you're not getting roadmap items.
- 07:07You know, you can just edit it here, right?
- 07:08There's no no big deal.
- 07:09But, this does all the scaffolding work for you.
- 07:12What's nice now is you've created like an agent that works in the harness.
- 07:16So, if you have repeat tasks that you have to do, you can call this agent to do those tasks for you, right?
- 07:21Um that that's kind of step one.
- 07:23Uh but, once you do that, you're kind of like, "What's the next thing that I got to go do?"
- 07:27And I think um you know, the next thing is how do I share this agent, right?
- 07:31How do other people uh take advantage of it?
- 07:33And the easiest way to do that inside of Copilot is to do that um by making a marketplace.
- 07:39So, a marketplace is just a repository with a little bit of extra uh JSON in one of the directories that says, "Hey, this is a marketplace."
- 07:47And what it does is it gives you some light package management capabilities inside the repo.
- 07:51So, if I subscribe to a marketplace, then I can update all the agents simultaneously.
- 07:57I can version them, things like that.
- 07:58I can notify people of security vulnerabilities.
- 08:00You know, there's features built in that allow me to communicate with the users that are downstream for me.
- 08:05So, creating a marketplace is oftentimes one of the first things that I work with companies on when I go in and try to talk with them about how to scale
- 08:12Copilot adoption inside their organization.
- 08:15A lot of times there's not a central repository for teams to even contribute agents or skills to.
- 08:19So, if you don't have a central location, you should generate one, right?
- 08:23And there is a capability basically to sync those with the the local client device and then pushing and out different agents.
- 08:31You can also use a specific directory inside of your organization or specific repo.
- 08:38So, if you're inside of GitHub, I'm at the org level here, and then I went into a repository, and it has to be named GitHub private, right?
- 08:45This is a naming convention that we've used, but if you have a GitHub private repository, you'll be able to expose agent files.
- 08:52So, in this case, I have three agents here, and you can see from the cloud agent, I'm actually able to call that specific agent on the platform.
- 09:01So, I showed you earlier in the diagram, you know, you can you can interact with all of these from different surface areas.
- 09:06This is the cloud interaction, right?
- 09:08If I want to delegate to a cloud agent that's hosted on the platform, I can do that here.
- 09:12But what's nice is this compliance bot that I'm showing you here in the the drop-down is the same compliance bot that's in the repository, right?
- 09:19So, this is a way of distributing agents out to the team, right?
- 09:23So, if I write a handy agent that checks the change log for me, then I can publish it here, and I can share that with everybody else, right?
- 09:30So, this will push to everyone's IDE environment or push to their CLI environment for them, and then they can just call the same agent that I'm working on.
- 09:37So, now I have some reuse, right?
- 09:39Like I can publish them in a marketplace, I can publish them directly as um assets inside of my business that anybody can call, right?
- 09:47And this is what's allowing me to do standardization, right?
- 09:50If you look at the cost model for all of these products, the cheapest way to use them is to get cash hits, right?
- 09:55You want exact matches between turns on common data.
- 09:59And having reusable components will drive up your cash rate, right?
- 10:02So, if cost is a concern, um building reusable agents and making sure that people are solving problems in the same way, uh rather than reinventing the wheel every time, is a good way to drive down your your overall bill, drive up your cash rate.
- 10:16So, again, this um dot GitHub private directory, this is how you would share an agent internally to everyone inside the org, right?
- 10:23So, you can make a marketplace that will work across organizations, that could even work, you know, externally, right?
- 10:29So, we have a repository called awesome co-pilot that has a bunch of um you know, example agents and things.
- 10:34You could register that as a marketplace.
- 10:36This is purely internal, right?
- 10:37And this is like an admin can push this out.
- 10:41The last thing that I want to do sometimes um when I'm working uh with an agent is I want to be able to use um agents across repositories.
- 10:50And the biggest challenge with these uh compliance agents, for example, is that they're always starting in the repo where the agent lives.
- 10:58So, if I have agents living in this repository, um they maybe can't take action in other repositories, right?
- 11:05I need to start the agent in the other repo so that it has permissions in that repository.
- 11:10Um inside of the co-pilot app, there's a command called orchestrate.
- 11:14Um and orchestrate is our horizontal scaling for across repo.
- 11:19Uh so, this will allow you to set a series of GitHub issues as uh goals for the agent, and then spin up sub agents to address all of those tasks.
- 11:28But, what's nice is that it will spin up agents in the repository that it's supposed to be working in.
- 11:33So, if you want to take a task inside of a microservice where you're like modifying an API and then you have to make a change somewhere downstream because of that, Orchestrate will allow you to set up several agents that are going to make
- 11:44cross-repo changes simultaneously.
- 11:46So, I can use the the pre-canned agents, right?
- 11:49If they're available to me in those other marketplaces or being pushed to me by my org admin, I can kind of summon them here to go do work in individual repositories
- 11:58and keep them sort of on task using this this Orchestrate tool.
- 12:01And that's really like three layers of how do I use agents locally, right?
- 12:06Like in in using agents locally has a lot of utility, right?
- 12:11But sometimes I don't want to run an agent locally.
- 12:13I actually want the agent to be run as a part of the repository and certain agents maybe are going to be performing like maintenance tasks in the repo.
- 12:22And so, I want to run them in the repo on that repo's budget, not on my budget, right?
- 12:28Or I want to run it using the repo identity, not my identity, right?
- 12:32Not every agent needs to be me taking an action.
- 12:35You know, it's it's maybe a maintenance task that has to be done on behalf of of the project.
- 12:40When we're working in that model, we have a framework that you can use called agentic workflows.
- 12:45And agentic workflows is a pretty simple concept like the Copilot CLI can be used in a headless mode.
- 12:52So, I can call the Copilot CLI, I can use the dash P command and basically pass it a single prompt one-shot prompt for it to go do.
- 13:00And then if I take that and I run that inside of a GitHub Actions runner or in some CI system, then I have an agent that's running in a pipeline for me, right?
- 13:08So, I can trigger it on events that are happening in the repo.
- 13:11Like on a release, I want to update I want to update documentation.
- 13:15Or every week, I want to update my context files.
- 13:18Or, you know, in maybe a model like this, I have various maintenance tasks that I want to go do.
- 13:23Like one of the biggest problems today that's happening in repositories where a lot of agentic development is happening is there's lots of spaghetti code getting added, lots of duplicate code.
- 13:31Like the agents are lazy about implementing, you know, functions and they're really lazy about namespacing.
- 13:38So, they'll just like create constant duplication inside the code base.
- 13:41So, maybe you want an agent that looks inside the code base, identifies opportunities for deduplication of code, and then creates a series of issues for you.
- 13:52And if you use this framework, this agentic workflows framework, what's nice is we'll we'll build in human in the loop triggers for you so that you can review and decide when you're actually going to spend money on side of the next phase of the flow.
- 14:05So, in this flow here, you see I have the first agent maybe running on a cron schedule.
- 14:09It's looking in the repo.
- 14:10It identifies, you know, three items where there's opportunity for me to make improvement in the code base.
- 14:15Okay, great.
- 14:16The developer reads that and then makes a decision about whether or not those things are worth fixing.
- 14:21And they express that through a slash command that they can make as an issue comment, right?
- 14:26So, they they go to the issue and they say, "Okay, advance this issue to the next phase of the process, right?"
- 14:31For us, that's maybe a planning phase, right?
- 14:33So, maybe I'm going to call another pipeline agent, right?
- 14:36Which is the PRD generating product manager agent, right?
- 14:39That's going to scope the feature for me.
- 14:41It generates a plan.
- 14:43It hands it off to co-pilot in the platform for implementation.
- 14:46And then the developer comes back in the loop maybe at an acceptance phase, right?
- 14:49Let's look at the code and evaluate whether or not we actually want to take it in the project.
- 14:53Now I've got pipeline agents.
- 14:55And what's really cool about the pipeline agents is how they scale.
- 15:00You know, the the the the challenge with working locally is you're on like a single session or you're on your device.
- 15:06If your device goes down or you lose network activity, you know, your your workflow is interrupted.
- 15:11These are running in the platform, so they're running autonomously from you.
- 15:15If you want to see like a maximalist approach to how this works, the GitHub AW project itself, like the thing that is the framework for building all these agents,
- 15:23it is built entirely by agents.
- 15:26And this team has sort of an internal goal that they're only going to do their development on their mobile devices because they interact entirely with this application through those slash commands, right?
- 15:36So just to give you a feel of like what a fully, you know, agent-led development project looks like, this is this is our our our framework, right?
- 15:43And it has I don't know, 200 agents in here that are all running different parts of the pipeline, right?
- 15:51And all of these follow a similar workflow that we just showed on that on that slide, right?
- 15:57That architecture is reusable.
- 15:59So let me see if I can just pick one of these.
- 16:02I'm a little bit picking at random here, but let's see what this one does, right?
- 16:06So this is checking daily reports on other agents, right?
- 16:11So this is a meta agent that's looking on things.
- 16:13It's running on a daily schedule and it has, you know, its agent.md file that's working away here, right?
- 16:19So every time this thing runs, it's generating some markdown report or some action or input for another agent, and then we're just continuing to trigger it.
- 16:28You can feel free to take a look through here.
- 16:30There's hundreds of these that are creating this project.
- 16:33GetHub also has a bunch of them that we've bundled up.
- 16:37So inside of our GetHub next organization, there's this project called Agentics.
- 16:41Agentics has 30 or so different pipeline agents that you may be interested in just pulling off the shelf and running in your project.
- 16:48Some of these will do the code deduplication that we talked about.
- 16:51Some of them are different types of reviewers, so if you need a QA reviewer or, you know, you want one that's funny and just makes jokes, like there's all kinds of
- 16:59different sample agents here that you can pull and drop into the pipeline.
- 17:02But what's nice about this is it gets the workload off of your machine.
- 17:06And I think when we shift back to thinking about cost, getting the workload off of your machine is key for optimizing cost, right?
- 17:14If I'm having everyone in my organization work with AI and I'm telling them to go use it, but I can't see how they're actually working with the tool.
- 17:22I don't have any opportunity to optimize, right?
- 17:24I can't actually see whether or not the agents that they're using are too verbose or are even achieving the task.
- 17:31I can't tell when tool calls are happening if they're successful or unsuccessful.
- 17:36I I I can't tell if they're using agent reasoning for all types of things or if they're you know correctly building little bash scripts to actually go and do uh different search functions and things like that.
- 17:47Like there's lots of optimization opportunities for me, but if I can't see it, I can't do any of that optimization.
- 17:52So, by getting the workload off of the laptop and moving it into CI, I get to see what's happening, right?
- 17:58I have every single agent running and it's instrumented with hotel.
- 18:02So, I can go to a SIM or some kind of logging platform and look, does my code duplication agent agent, how does it run across repositories?
- 18:11How much does it cost me, right?
- 18:12I can pivot on average token use.
- 18:15I can also do things like say, "Hey, every time that an agent exceeds its P90 for what I expect it to cost me to run, go investigate why it exceeded its its threshold, right?
- 18:25I want it to tell me what debugging information I can I can take to evaluate it further or to improve it, right?
- 18:33Or if I see that a tool call's failing over and over, maybe I want to AB test different front matter or maybe I want to AB test different models and see if they produce like the the right output for me so I can pick a cheaper model at some point, right?
- 18:45All of this stuff is possible once I get the agents into the pipeline.
- 18:50Anyhow, so this was a quick and dirty kind of tour of agents in the platform, right?
- 18:55We talked through building an agent locally, sharing agents through the platform, and then eventually moving those agents into the pipeline.
- 19:02If you want to talk more about any part of that, I'll be in the back.
- 19:05Feel free to come up and grab me or you can add me on LinkedIn and ping me.
- 19:09I'm happy to continue the conversation.
- 19:11Um, I work at GitHub in a field capacity, so if you know your GitHub AE and you want to chat with me, uh, feel free to reach out with them.
- 19:17Uh, we we can get in touch and and have a quick conversation as well.
- 19:20Thanks so much for your time today.