Skip to content

Commit f396070

Browse files
authored
update neo4j guide and knowledge graph agent tutorial (#185)
1 parent 9c42442 commit f396070

17 files changed

+83
-151
lines changed

agents/connections/neo4j.mdx

Lines changed: 41 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@ Hypermode agent to Neo4j.
2727

2828
## Prerequisites
2929

30-
Before connecting Neo4j to Hypermode, you'll need:
30+
Before connecting Neo4j to Hypermode Agents, you'll need:
3131

32-
1. A [Neo4j account](https://neo4j.com/)
33-
2. A Neo4j instance (we'll use Neo4j Sandbox for this guide)
34-
3. A [Hypermode workspace](https://hypermode.com/)
32+
1. A Neo4j database instance (free options include
33+
[Neo4j Sandbox](https://sandbox.neo4j.com) and Neo4j Aura free tier)
34+
2. A [Hypermode Agents](https://agents.hypermode.com) account
35+
36+
<Note>
37+
This guide will walk you through the steps of connecting to Neo4j using the
38+
free Neo4j Sandbox, but you can also use Neo4j Aura or a self-hosted instance.
39+
</Note>
3540

3641
## Setting up Neo4j
3742

3843
### Step 1: Create a Neo4j Sandbox
3944

40-
First, you need to go to https://sandbox.neo4j.com/ and create an account. When
41-
you get to making a database, select a blank sandbox.
45+
First, navigate to https://sandbox.neo4j.com/ and create an account. Choose
46+
"Blank Sandbox" from the list of available options.
4247

4348
![Create blank sandbox](/images/connections/neo4j/blank-sandbox.png)
4449

@@ -47,89 +52,58 @@ you get to making a database, select a blank sandbox.
4752
production use, consider Neo4j Aura or a self-hosted instance.
4853
</Note>
4954

50-
### Step 2: Get your connection details
51-
52-
Once created (it may take a moment), you can navigate to the HTTP tab and grab
53-
the URL. Note you will have to modify this to use the Neo4j HTTP v2 endpoint:
54-
55-
- Remove `/db/neo4j/tx/commit`
56-
- Replace it with `/db/neo4j/query/v2`
57-
58-
For example:
55+
### Step 2: Note your connection details
5956

60-
- Original: `http://52.54.53.148:7474/db/neo4j/tx/commit`
61-
- Modified: `http://52.54.53.148:7474/db/neo4j/query/v2`
57+
Once your Neo4j sandbox instance is created (it may take a moment), you can
58+
navigate to the "Connection details" tab to view the connection credentials for
59+
your Neo4j sandbox instance.
6260

63-
![http tab](/images/connections/neo4j/neo4j-http-connection.png)
64-
65-
### Step 3: Get authentication credentials
66-
67-
Save this URL and then move to the connection details to grab the username and
68-
password.
69-
70-
![Connection details](/images/connections/neo4j/neo4j-user-password.png)
71-
72-
Now we've got the URL, username, and password we can create a new agent in
73-
Hypermode.
61+
Note the username, password, and Bolt URL - you'll use these in the next step to
62+
create a Neo4j connection in Hypermode Agents.
63+
![Connection details](/images/connections/neo4j/sandbox-credentials.png)
7464

7565
## Creating your Neo4j agent
7666

7767
### Step 1: Create a new agent
7868

79-
From the Hypermode interface, create a new agent:
80-
81-
1. Click the agent dropdown menu
82-
2. Select "Create new Agent"
69+
From the Hypermode Agents dashboard, create a new agent:
8370

84-
![Navigate to create agent](/images/connections/neo4j/navigate-create-agent.png)
85-
86-
### Step 2: Configure agent settings
87-
88-
Use these recommended settings for your Neo4j agent:
89-
90-
- **Agent Name**: GraphExplorer
91-
- **Agent Title**: Neo4j Graph Analysis Agent
92-
- **Description**: Analyzes graph relationships and patterns in Neo4j
93-
- **Instructions**: You have a connection to a Neo4j graph database. You can
94-
create nodes with any labels and properties, create relationships of any type,
95-
and run Cypher queries. Neo4j is schemaless, so you can dynamically add data
96-
without predefined structures.
97-
- **Model**: GPT-4.1
71+
1. Select the "Create agent" button
72+
2. Describe your agent in a few sentences, we'll use "The agent is a Neo4j
73+
expert"
9874

9975
![Create agent modal](/images/connections/neo4j/create-agent-modal.png)
10076

10177
### Step 3: View your agent profile
10278

103-
Once created, navigate to your agent's settings page:
79+
Once created, navigate to your agent's details page. Here you can view and edit
80+
the agent instructions that were created from your initial agent description
81+
preceding the agent creation process.
10482

10583
![Agent profile](/images/connections/neo4j/agent-profile.png)
10684

85+
You can update the agent instructions at any time to help align the agent's
86+
background and skills with your use case.
87+
10788
## Connecting to Neo4j
10889

10990
### Step 1: Add the Neo4j connection
11091

111-
Navigate to the **Connections** tab and add Neo4j:
92+
Navigate to the **Connections** tab in Hypermode Agents and add Neo4j:
11293

11394
1. Click "Add connection"
114-
2. Search for "Neo4j" in the available connections
95+
2. Select the "Connect" button next to Neo4j in the list of available
96+
connections
11597

11698
![Add Neo4j connection](/images/connections/neo4j/add-neo4j-connection.png)
11799

118100
### Step 2: Configure credentials
119101

120-
Enter your Neo4j credentials:
121-
122-
- **URL**: Your modified HTTP v2 endpoint
123-
(`http://52.54.53.148:7474/db/neo4j/query/v2`)
124-
- **Username**: Your Neo4j username (usually `neo4j`)
125-
- **Password**: Your Neo4j password
102+
Enter your Neo4j credentials from the Neo4j Sandbox details page.
126103

127104
![Neo4j connection modal](/images/connections/neo4j/neo4j-connection-modal.png)
128105

129-
<Warning>
130-
Ensure you're using the HTTP v2 endpoint format. The connection will fail with
131-
the default transaction endpoint.
132-
</Warning>
106+
<Warning>Ensure you're using the Bolt URL endpoint format.</Warning>
133107

134108
## Understanding Neo4j's schemaless nature
135109

@@ -150,6 +124,8 @@ This flexibility makes Neo4j perfect for:
150124
- Complex, heterogeneous datasets
151125
- Real-world relationship modeling
152126

127+
![Neo4j Graph Model](/images/connections/neo4j/what-data.png)
128+
153129
## Example graph model
154130

155131
Here's a simple example of how nodes and relationships work in Neo4j:
@@ -189,8 +165,6 @@ Create these relationships:
189165
- GraphApp is BY_COMPANY TechCorp
190166
```
191167

192-
![Create relationships result](/images/connections/neo4j/create-relationships-result.png)
193-
194168
### Test 3: Visualize in Neo4j Browser
195169

196170
After your agent creates the data, switch to Neo4j Browser to see the results:
@@ -212,7 +186,7 @@ Back in your agent thread, use Cypher to explore your data:
212186
Run a Cypher query to find all products made by people who work at TechCorp, showing the full relationship path.
213187
```
214188

215-
![Query result](/images/connections/neo4j/cypher-query-result.png)
189+
![Query result](/images/connections/neo4j/query-your-graph.png)
216190

217191
## Example: Building a dynamic knowledge graph
218192

@@ -228,13 +202,17 @@ Let's expand our graph with more data:
228202
5. Add a COMPETES_WITH relationship between the two companies
229203
```
230204

205+
![Graph with more data](/images/connections/neo4j/dynamic-graph-query-agent.png)
206+
231207
Your agent can dynamically add:
232208

233209
- New node types as you discover them
234210
- Properties specific to each entity
235211
- Relationships that make sense in context
236212
- No need to predefine any structure!
237213

214+
![Graph with more data](/images/connections/neo4j/dynamic-graph-query-results.png)
215+
238216
## What you can do
239217

240218
With your Neo4j connection and its three core tools, your agent can:
@@ -254,7 +232,6 @@ With your Neo4j connection and its three core tools, your agent can:
254232

255233
#### Connection refused error
256234

257-
- Verify you're using the HTTP v2 endpoint format
258235
- Check if your sandbox is still active (they expire after 3 days)
259236
- Ensure the URL includes the correct port (usually 7474)
260237

@@ -264,17 +241,8 @@ With your Neo4j connection and its three core tools, your agent can:
264241
- Sandbox passwords are auto-generated - copy carefully
265242
- Try resetting the password in the sandbox console
266243

267-
#### Tool execution errors
268-
269-
- Check the
270-
[MCP Neo4j documentation](https://mcp.pipedream.com/app/neo4j_auradb) for
271-
correct parameter formats
272-
- Ensure node IDs exist before creating relationships
273-
- Verify Cypher syntax in your queries
274-
275244
## Learn more
276245

277246
- [Neo4j Documentation](https://neo4j.com/docs/)
278247
- [Cypher Query Language](https://neo4j.com/docs/cypher-manual/current/)
279-
- [MCP Neo4j AuraDB Server](https://mcp.pipedream.com/app/neo4j_auradb)
280-
- [Graph Data Science Library](https://neo4j.com/docs/graph-data-science/current/)
248+
- [Tutorial: Using Hypermode Agents to extract and build knowledge graphs](/agents/knowledge-graph-extraction)

agents/knowledge-graph-extraction.mdx

Lines changed: 42 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ interact with external services, and perform complex tasks on your behalf.
4242
Unlike traditional chatbots, Hypermode Agents can actually take actions—like
4343
scraping websites, querying databases, and transforming data.
4444

45-
![Screenshot of Hypermode Agents interface showing an Agent card with connections](/images/tutorials/knowledge-graph-extraction/agent-profile.png)
46-
4745
### Key features for this tutorial
4846

4947
- **Natural Language Understanding**: Give instructions in plain English
@@ -88,6 +86,12 @@ By extracting Product Hunt data into Neo4j, you can:
8886

8987
## Step 1: Set up Neo4j Sandbox
9088

89+
<Note>
90+
Refer to the [Hypermode Agents Neo4j connection
91+
guide](/agents/connections/neo4j) for more details on how to connect your
92+
agent to Neo4j.
93+
</Note>
94+
9195
### Create a Neo4j Sandbox
9296

9397
First, you need to go to https://sandbox.neo4j.com/ and create an account. When
@@ -100,55 +104,41 @@ you get to making a database, select a blank sandbox.
100104
production use, consider Neo4j Aura or a self-hosted instance.
101105
</Note>
102106

103-
### Get your connection details
104-
105-
Once created (it may take a moment), you can navigate to the HTTP tab and grab
106-
the URL. Note you will have to modify this to use the Neo4j HTTP v2 endpoint
107-
when adding the Neo4j connection in Hypermode Agents.
107+
### Note your connection details
108108

109-
- Remove `/db/neo4j/tx/commit`
110-
- Replace it with `/db/neo4j/query/v2`
109+
Once your Neo4j sandbox instance is created (it may take a moment), you can
110+
navigate to the "Connection details" tab to view the connection credentials for
111+
your Neo4j sandbox instance.
111112

112-
For example:
113+
Note the username, password, and Bolt URL - you'll use these in the next step to
114+
create a Neo4j connection in Hypermode Agents.
115+
![Connection details](/images/connections/neo4j/sandbox-credentials.png)
113116

114-
- Original: `http://52.54.53.148:7474/db/neo4j/tx/commit`
115-
- Modified: `http://52.54.53.148:7474/db/neo4j/query/v2`
117+
## Creating your Neo4j agent
116118

117-
![Connection details](/images/tutorials/knowledge-graph-extraction/neo4j-http-connect.png)
119+
### Step 1: Create a new agent
118120

119-
<Info>
120-
The Neo4j connection in Hypermode Agents uses the [Neo4j Query HTTP API v2
121-
endpoint](https://neo4j.com/docs/query-api/current/), not the now deprecated
122-
HTTP v1 endpoint, which is why we need to modify the URL. Refer to the
123-
[Hypermode Agents Neo4j connection guide](/agents/connections/neo4j) for more
124-
information.
125-
</Info>
121+
From the Hypermode Agents dashboard, create a new agent:
126122

127-
### Get authentication credentials
123+
1. Select the "Create agent" button
124+
2. Describe your agent in a few sentences, we'll use "Extracts product data from
125+
Product Hunt and builds knowledge graphs in Neo4j"
128126

129-
Save this URL and then move to the connection details to grab the username and
130-
password.
127+
![Create agent modal](/images/tutorials/knowledge-graph-extraction/create-agent.png)
131128

132-
Make sure to note these details - you'll need them when setting up the
133-
connection in Hypermode.
129+
### Step 2: View your agent profile
134130

135-
## Step 2: Create your knowledge graph Agent
131+
Once created, navigate to your agent's details page. Here you can view and edit
132+
the agent instructions that were created from your initial agent description
133+
preceding the agent creation process.
136134

137-
### Manual Agent creation
135+
![Agent profile](/images/tutorials/knowledge-graph-extraction/agent-profile.png)
138136

139-
Let's create an Agent specifically designed for knowledge graph extraction.
140-
Navigate to your Hypermode workspace and create a new agent with these settings:
137+
You can update the agent instructions at any time to help align the agent's
138+
background and skills with your use case.
141139

142-
- **Agent Name**: KnowledgeGraphBuilder
143-
- **Agent Title**: Product Hunt Knowledge Graph Extractor
144-
- **Description**: Extracts product data from Product Hunt and builds knowledge
145-
graphs in Neo4j
146-
147-
![Agent creation form](/images/tutorials/knowledge-graph-extraction/agent-creation.png)
148-
149-
### System prompt
150-
151-
Use this comprehensive system prompt for your agent:
140+
For example, you can update the agent instructions to include more explicit
141+
workflows:
152142

153143
```text
154144
Identity:
@@ -207,53 +197,27 @@ Not all products will have the same information, so create flexible queries that
207197
Always maintain data accuracy and provide clear explanations of the graph structure you're creating.
208198
```
209199

210-
### Select your model
211-
212-
For this use case, we recommend **Claude 4 Sonnet** or **GPT-4.1** as they excel
213-
at:
214-
215-
- Understanding complex data structures
216-
- Writing accurate Cypher queries
217-
- Managing multi-step workflows
218-
219-
## Step 3: Add connections
220-
221-
Your agent needs key connections to function properly:
222-
223-
### Add Neo4j connection
224-
225-
1. Navigate to your agent's connections tab
226-
2. Click "Add connection"
227-
3. Search for "Neo4j" and select it
228-
229-
![Add Neo4j connection](/images/tutorials/knowledge-graph-extraction/add-neo4j.png)
230-
231-
Configure the Neo4j connection with your Sandbox details:
232-
233-
- **URL**: Your modified HTTP v2 endpoint
234-
- **Username**: `neo4j` (or your custom username)
235-
- **Password**: Your Sandbox password
200+
## Connecting to Neo4j
236201

237-
![Neo4j MCP connection setup](/images/tutorials/knowledge-graph-extraction/neo4j-mcp-connect-http.png)
202+
### Step 1: Add the Neo4j connection
238203

239-
### Add LinkedIn connection
204+
Navigate to the **Connections** tab in Hypermode Agents and add Neo4j:
240205

241-
For enriching founder and company data:
206+
1. Click "Add connection"
207+
2. Select the "Connect" button next to Neo4j in the list of available
208+
connections
242209

243-
1. Add the "LinkedIn" connection
244-
2. Complete the OAuth flow to authorize access
245-
3. This enables the agent to gather professional information
210+
![Add Neo4j connection](/images/connections/neo4j/add-neo4j-connection.png)
246211

247-
![Add LinkedIn connection](/images/tutorials/knowledge-graph-extraction/add-linkedin.png)
212+
### Step 2: Configure credentials
248213

249-
### Add Product Hunt connection
214+
Enter your Neo4j credentials from the Neo4j Sandbox details page.
250215

251-
For direct Product Hunt API access (if available):
216+
![Neo4j connection modal](/images/connections/neo4j/neo4j-connection-modal.png)
252217

253-
1. Add the "Product Hunt" connection if available in your workspace
254-
2. This provides structured access to Product Hunt data
218+
<Warning>Ensure you're using the Bolt URL endpoint format.</Warning>
255219

256-
![Add Product Hunt connection](/images/tutorials/knowledge-graph-extraction/add-product-hunt.png)
220+
### Step 3: Update your agent instructions
257221

258222
## Step 4: Test the connection
259223

@@ -762,7 +726,7 @@ Always provide the graph traversal logic used for recommendations and offer to e
762726
<Card
763727
title="Read"
764728
icon="book-open-cover"
765-
href="https://hypermode.com/blog/why-contextual-ai-agents-beat-chatgpt-for-enterprise-sales"
729+
href="https://hypermode.com/blog/topic/knowledge-graphs"
766730
>
767731
Read more about knowledge graphs on the Hypermode blog
768732
</Card>
-187 KB
Loading
39.3 KB
Loading
-185 KB
Loading
-154 KB
Loading
64.2 KB
Loading
142 KB
Loading
-92.3 KB
Loading
-27.5 KB
Loading

0 commit comments

Comments
 (0)