----------------------
To load an existing Neo4j database with LlamaIndex, you need to follow these steps:
- Install the Neo4j Python driver by running the following command in your Python environment:
- Set up your Neo4j connection parameters. Replace the
username
, password
, url
, and database
values with your actual Neo4j database details:
username = "neo4j"
password = "retractor-knot-thermocouples"
url = "bolt://44.211.44.239:7687"
database = "neo4j"
- Import the necessary modules from LlamaIndex:
from llama_index import (
KnowledgeGraphIndex,
ServiceContext,
SimpleDirectoryReader,
)
from llama_index.storage.storage_context import StorageContext
from llama_index.graph_stores import Neo4jGraphStore
- Define your LLM (Language Learning Model). In this example, the OpenAI model
gpt-3.5-turbo
is used:
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:
----------------------