Github Custom Agent for Creating Neo4j Python Clients
21views
Github Custom Agent for Creating Neo4j Python Clients
Ryan Knight
Github Custom Agent for Creating Neo4j Python Clients
Ryan Knight
Transcript
00:00
Hello, this is Ryan Knight.
00:01
I work for Neo4j as a senior partner architect focused on the GitHub and Azure partnership.
00:07
What I want to show today is how I set up a project to use the new custom agents for GitHub Copilot to create a specialized agent that creates a Python client library for your Neo4J database.
00:20
And the way I'm going to do this is to leverage the Neo 4J MCP server that has three basic tools.
00:27
Two of those are to query the database and execute read and write cipher queries.
00:32
And the third tool is a schema tool that allows you to introspect the database and get the schema which contains a list of all the nodes and relationships in the database.
00:41
And to start this off, I've already created an instance of Neo 4J aura, and loaded it up with a, knowledge graph of aviation data.
00:50
And that contains all the operational maintenance aspects of an aviation fleet to capture aircraft, flights, airports, system sensors.
00:57
So for example, for this aircraft we can see all of its related information, such as maintenance events, flights, et cetera.
01:05
And so now that I have this database set up, what I need to do to create the agent is because they're leveraging SAP server capabilities, the agents have to be created at the organization level.
01:17
So inside of the Neo4j partner organization, I've created a special repo called GitHub, Private.
01:24
Inside that repo, GitHub, it's going to create the agents that will be available across the entire organization.
01:29
I have two agents that run the MCP server.
01:32
One uses Python to run the server and the other runs the MCP server in a Docker container.
01:36
And we'll just look at the docker one.
01:38
We go and look at the markdown for this.
01:41
At the top of the markdown I'm defining the MCP server and how to run it.
01:45
And so all it's saying is run this MCP server in Docker and pull the image from this location MCP Neo 4J Cypher latest and set up the environment using these environment variables.
01:57
And one key thing is the environment variables have to be named copilotmcp, underscore and then I tell what this agent does.
02:06
So I'm saying it's a Python client generator.
02:09
I give it the core mission to create a basic, well structured Python client.
02:13
I tell it the FCP server capabilities, then I tell it the process for generating the workflow, I give it the requirement analysis phase, a client generation phase, and tell it the structure of the client that you should generate, File by file guidelines.
02:27
And then I have a quality assurance phase to be sure that it's followed the best practices, and ensures that it has proper security and tell it what to include and what not to include.
02:36
Now that I've created those custom agents at the organization level, to leverage those, all I have to do is create a repository in that organization, and then go to Settings and add the necessary environment variables.
02:50
So the MCP server knows how to connect to the Neo4j server.
02:56
And then the rest of these files are just sample files that show how I set up the agent at the organization level.
03:02
And to use that custom agent, you can use it in two ways.
03:05
One is by going to the agents panel and describe the coding task and then I can select a custom agent and I can select one of the two agents I have.
03:15
One is the docker, the other one is the one that runs the MCP server with Python.
03:21
and the other way you can trigger this agent is by creating an issue.
03:25
And once we create the issue, we can assign to copilot.
03:29
And when you assign to Copilot, you can select the agent to work on this issue.
03:34
So I'm going to select the Neo 4J Docker client generator agent and, and assign that to Copilot.
03:41
And then I'm going to go ahead and create this issue.
03:44
And this is going to create the issue.
03:45
And then we'll see the copilot says it's looking at the issue and we'll see that it fires off and creates a pull request.
03:53
And then I can open up the pull request.
03:54
And we can see that in here Copilot has started to work on this issue.
03:58
if we go to the agents page in GitHub, we, can see the work that Copilot is doing on that issue.
04:07
And so what we'll see is it's spinning up the environment and then starting to work on it.
04:11
Then others will take about 10 to 15 minutes.
04:14
So I'm going to show you one that I created previously.
04:16
Let me go to this one.
04:18
So this is one I previously created.
04:20
what we see that does is it first it sets up the environment.
04:23
Most importantly, it starts up the MCP server and loads the MCP server and inspects and gets the tools available, which are the get the schema, read and read, write, cipher.
04:33
And then we see that it's beginning the custom agent, the Neo 4J Docker.
04:36
And then we can see the steps it goes through.
04:39
It inspects the repository, inspects the environment.
04:41
And then most importantly, it calls to get the Neo4J schema.
04:45
And when it gets the schema it returns that as JSON.
04:47
So now that it has the Neo4J schema in JSON, it's going to use that to create a client and as well as the associated, you know, models and repository and tests for that client and then at the very end we'll see that, you know it gives a summary of the steps it took and the documentation it created, the key features that it implemented and then we can go and look at that pull request that it's created and it gives us an overview of the package structure it created, the repositories created, how to use the client, the security the files added, some warnings of issues it faced.
05:23
We look at the files that it created, it created an example usage file, a model file based on the schema repository files and tests.
05:32
So we can see this custom agent has made it really easy to create a basic Python client to get started working with Neo4J database.
05:39
Let me know what custom agents you end up creating and what unique ways you find to leverage the Neo 4J MCP server.
05:47
Thank you for watching.
Comments
Comments
No comments yet
Github Custom Agent for Creating Neo4j Python Clients — Tella