Find answers from the community

Updated 3 months ago

how to load an existing neo4j db

how to load an existing neo4j db
k
f
L
4 comments
Please stand by @Liqvid as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
To load an existing Neo4j database with LlamaIndex, you need to follow these steps:

  1. Install the Neo4j Python driver by running the following command in your Python environment:
Plain Text
%pip install neo4j

  1. Set up your Neo4j connection parameters. Replace the username, password, url, and database values with your actual Neo4j database details:
Plain Text
username = "neo4j"
password = "retractor-knot-thermocouples"
url = "bolt://44.211.44.239:7687"
database = "neo4j"

  1. Import the necessary modules from LlamaIndex:
Plain Text
from llama_index import (
    KnowledgeGraphIndex,
    ServiceContext,
    SimpleDirectoryReader,
)
from llama_index.storage.storage_context import StorageContext
from llama_index.graph_stores import Neo4jGraphStore

  1. Define your LLM (Language Learning Model). In this example, the OpenAI model gpt-3.5-turbo is used:
Plain Text
from llama_index.llms import OpenAI
llm = OpenAI(temperature=0, model="gpt-3.5-turbo")
service_context = ServiceContext.from_defaults(llm=llm, chunk_size=512)

Please note that the above steps are based on the information provided in the extracts. You might need to adjust them according to your specific use case.

Sources:
  • Neo4j Graph Store ()
  • GitHub - jerryjliu/llama_index ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
@Liqvid Have you found a solution to this problem?
@fabian yes i did
Add a reply
Sign up and join the conversation on Discord