AI agents can be super useful with GitHub Copilot.
It's the most powerful mode it offers and it's the mode you'll
probably use the most when working with this chat feature.
Now, I already mentioned that you can configure which tools
And here, for the agent mode, for example, you see it has all the
tools. And I'll get back to MCP and extension tools,
but there are also other things you can do and
configure. For example, you get this Settings button
here. If you click it, you can configure your custom
agents. So you could build your custom agents,
You can choose a location where it should be stored locally or
globally. Here, I'll choose locally.
Name it Research, maybe, and then you can
define what this agent should do. So you would give it a
description. So for example here, I could say that I wanna build a research
assistant agent that explores docks and finds relevant information, and
then add a meaningful description here.
And this is, in the end, a prompt that will be fed to the AI
so that it does its task. So this should be treated as a
prompt here, and you can control which tools are available to this
agent. And for example here, you can click Configure Tools and then
say that this agent should be able to, let's say, read files to
understand the code base. It should be able to search through my
code base to gather all the relevant knowledge, and it should
definitely have web search available.
And in my case, I'll also give it this
context7-mcp-server, which is a tool that helps with finding
relevant documentation. Again, I'll get back to MCP later.
And now, I could submit this with OK, save this file, and
now we have this new research agent here, which we can use.
We can now use that to explore how does
the Faker library work? It sees that
we're using this because it can read my files and search my files, and it can
perform web search. So if I use this research
agent, it now can go ahead and, for example, use this
context7-mcp-server to gather the relevant information.
And here, we see another example for it asking for
though I allowed it to use this server, it does
allow for the individual things it wants to do with that MCP server.
So for example here, that it looks for documentation.
And this is a safety mechanism you'll see a lot to make sure
that these agents don't start destroying your code base or
your overall computer. So here, it does more and more research.
And since I don't wanna click Allow manually all the time, I'll allow it
entirely in this workspace. I could also allow
all tools in general from this MCP in this session or workspace,
and I'll actually do that. So you have fine-grained permission
And with that, I get some results here
the official documentation and should therefore be of high quality.
And now we could continue to chat here, switch to a different agent and
say, "Evaluate the code and
see if it's in line with the
official Faker best practices as
per their docs." Something like this.
And we could do this in ask mode actually since we wanna get an
evaluation and not necessarily change something.
And that is how you can build custom agents and have different
agents work together. Here, for example, it sees one
potential improvement, and therefore I could switch to
agent mode and say, "Fix that issue you
identified." Or actually it's multiple,
so I guess it's these issues. And now, since it's agent mode, it
can edit the file and you see where I'm going.
This is how you can work with these AI agents, build custom agents and
combine multiple agents to do tasks and write
code.