played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (a:Actor)-[:ACTED_IN]->(m:Movie {name: 'Top Gun'})    RETURN a.name    Full Context:    [{'a.name': 'Tom Cruise'}, {'a.name': 'Val Kilmer'}, {'a.name': 'Anthony Edwards'}, {'a.name': 'Meg Ryan'}]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'Ignore specified node and relationship typesYou can use include_types or exclude_types to ignore parts of the graph schema when generating Cypher statements.chain = GraphCypherQAChain.from_llm(     graph=graph,     cypher_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     qa_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo-16k"),     verbose=True,     exclude_types=['Movie'])# Inspect graph schemaprint(chain.graph_schema)    Node properties are the following:      {'Actor': [{'property': 'name', 'type': 'STRING'}]}    Relationships properties are the following:      {}    Relationships are:     []Validate generated Cypher statementsYou can use the validate_cypher parameter to validate and correct relationship directions in generated Cypher statementschain = GraphCypherQAChain.from_llm(     llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     graph=graph,     verbose=True,     validate_cypher=True)chain.run("Who played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (a:Actor)-[:ACTED_IN]->(m:Movie {name: 'Top Gun'})    RETURN a.name    Full Context:    [{'a.name': 'Tom Cruise'}, {'a.name': 'Val Kilmer'}, {'a.name': 'Anthony Edwards'}, {'a.name': 'Meg Ryan'}]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'PreviousArangoDB QA chainNextFalkorDBQAChainSeeding the databaseRefresh graph schema informationQuerying the graphLimit the number of resultsReturn intermediate resultsReturn direct resultsAdd examples in the Cypher generation promptUse separate LLMs for
This notebook shows how to use LLMs to provide a natural language interface to a graph database you can query with the Cypher query language.
This notebook shows how to use LLMs to provide a natural language interface to a graph database you can query with the Cypher query language. ->: played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (a:Actor)-[:ACTED_IN]->(m:Movie {name: 'Top Gun'})    RETURN a.name    Full Context:    [{'a.name': 'Tom Cruise'}, {'a.name': 'Val Kilmer'}, {'a.name': 'Anthony Edwards'}, {'a.name': 'Meg Ryan'}]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'Ignore specified node and relationship typesYou can use include_types or exclude_types to ignore parts of the graph schema when generating Cypher statements.chain = GraphCypherQAChain.from_llm(     graph=graph,     cypher_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     qa_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo-16k"),     verbose=True,     exclude_types=['Movie'])# Inspect graph schemaprint(chain.graph_schema)    Node properties are the following:      {'Actor': [{'property': 'name', 'type': 'STRING'}]}    Relationships properties are the following:      {}    Relationships are:     []Validate generated Cypher statementsYou can use the validate_cypher parameter to validate and correct relationship directions in generated Cypher statementschain = GraphCypherQAChain.from_llm(     llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     graph=graph,     verbose=True,     validate_cypher=True)chain.run("Who played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (a:Actor)-[:ACTED_IN]->(m:Movie {name: 'Top Gun'})    RETURN a.name    Full Context:    [{'a.name': 'Tom Cruise'}, {'a.name': 'Val Kilmer'}, {'a.name': 'Anthony Edwards'}, {'a.name': 'Meg Ryan'}]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'PreviousArangoDB QA chainNextFalkorDBQAChainSeeding the databaseRefresh graph schema informationQuerying the graphLimit the number of resultsReturn intermediate resultsReturn direct resultsAdd examples in the Cypher generation promptUse separate LLMs for