Aan de slagGa gratis aan de slag

Building-up your graph database

So that you don't have to regenerate your graph documents every time, it's best practice to store them in a database that's specifically designed for graph data. Neo4j graph databases are an excellent choice for graph storage and retrieval, so you'll set one up using LangChain's Neo4j functionality.

Note: to use Neo4j in LangChain, you must also have the neo4j library installed as a dependency. In this course, this has already been done for you.

Deze oefening maakt deel uit van de cursus

Retrieval Augmented Generation (RAG) with LangChain

Cursus bekijken

Oefeninstructies

  • Instantiate the Neo4j graph using the url, user, and password variables provided.
  • Add the graph_documents to the graph, including their sources and additional entity labels.
  • Print the graph's schema.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Instantiate the Neo4j graph
graph = ____(url=url, username=user, password=password)

# Add the graph documents, sources, and include entity labels
graph.____

graph.refresh_schema()

# Print the graph schema
print(____)
Code bewerken en uitvoeren