Find answers from the community

Updated 4 months ago

how to load an existing neo4j db

At a glance

The post asks how to load an existing Neo4j database. A community member responds with steps to load an existing Neo4j database using LlamaIndex, including installing the Neo4j Python driver, setting up the connection parameters, importing necessary modules, and defining the language model. The community member notes that the steps provided are based on the information in the extracts and may need to be adjusted for the specific use case. The post also includes a follow-up question asking if a solution has been found, and the original responder confirms that they have found a solution.

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