Neo4j Connection Error: Build an Neo4j-backed Chatbot

Hi there,
I am taking the course "Build an Neo4j-backed Chatbot..". I have forked the repo and developing on my own IDE (VScode).
Everything good except when I follow the "Neo4j Retriever Tool".

It keeps giving me an error regarding the connection to the Neo4j Server.

in my .toml file i have pasted the code found in "Connecting to Neo4j". So I have:

NEO4J_URI = "neo4j+s://82f3237db9dd8250face9188eb40a0cb.neo4jsandbox.com:7687"
NEO4J_USERNAME = "neo4j"
NEO4J_PASSWORD = "coordinations-frame-defect"

and ofc I also have the api_key and openai mode.

When i launch streamlit it returns me this error:

It seems that I cannot reach the Neo4j server.


I followed the guide entirely, except for the part of creating the vector.py. In the page it says to create the file in the folder "solutions/tool", but i guess there is where the solution for the step is in, thus i created the file in mail folder by copying the solution.

I also tried this code to check the connection:

from langchain.graphs import Neo4jGraph

graph = Neo4jGraph(
    url="neo4j+s://82f3237db9dd8250face9188eb40a0cb.neo4jsandbox.com:7687",
    username="neo4j",
    password="coordinations-frame-defect"
)

r = graph.query("MATCH (m:Movie{title: 'Toy Story'}) RETURN m")
print(r)

But it returns me the error:

"name": "ValueError",
	"message": "Could not connect to Neo4j database. Please ensure that the url is correct",

is it a problem with the neo4j server?

Maybe try neo4j or bolt as the protocol type instead of neo4j+s.

Hi Gary,

Thank you for your suggestion. I've now replaced the URL with that of my sandbox. This detail wasn't specified in the course materials, so I had initially retained the one indicated there.

1 Like

Got same issue, tried all protocols while credentials are ok etc... ex: work fine for example using llamaIndex.

Hi! I have exactly the same problem, did you find a solution?

@glilienfield Hi Gary - facing the same issue. Do you mind pointing me to what the sandbox URL/correct URL should look like? I've tried bolt and neo4j as protocol and nothing works.

Hi,

I resolved the issue by inputting the URL of my sandbox.

This is what the input looks like:

NEO4J_URI = "bolt://44.214.105.48"
NEO4J_USERNAME = "neo4j"
NEO4J_PASSWORD = "methodology-fasteners-analog"
1 Like