ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Retrieval Augmented Generation (RAG) with LangChain

Ver curso

Instrucciones del ejercicio

  • 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.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# 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(____)
Editar y ejecutar código