(val)-[:ACTED_IN]->(top),        (anthony)-[:ACTED_IN]->(top),        (meg)-[:ACTED_IN]->(top)""")    []Creating FalkorDBQAChain‚Äãgraph.refresh_schema()print(graph.schema)import osos.environ['OPENAI_API_KEY']='API_KEY_HERE'    Node properties: [[OrderedDict([('label', None), ('properties', ['name', 'birthDate', 'title'])])]]    Relationships properties: [[OrderedDict([('type', None), ('properties', [])])]]    Relationships: [['(:Person)-[:ACTED_IN]->(:Movie)']]    chain = FalkorDBQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True)Querying the graph‚Äãchain.run("Who played in Top Gun?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person)-[:ACTED_IN]->(m:Movie)    WHERE m.title = 'Top Gun'    RETURN p.name    Full Context:    [['Tom Cruise'], ['Val Kilmer'], ['Anthony Edwards'], ['Meg Ryan'], ['Tom Cruise'], ['Val Kilmer'], ['Anthony Edwards'], ['Meg Ryan']]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'chain.run("Who is the oldest actor who played in The Godfather: Part II?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)    WHERE m.title = 'The Godfather: Part II'    RETURN p.name    ORDER BY p.birthDate ASC    LIMIT 1    Full Context:    [['Al Pacino']]        > Finished chain.    'The oldest actor who played in The Godfather: Part II is Al Pacino.'chain.run("Robert De Niro played in which movies?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person {name: 'Robert De Niro'})-[:ACTED_IN]->(m:Movie)    RETURN m.title    Full Context:    [['The Godfather: Part II'], ['The Godfather: Part II']]        > Finished chain.    'Robert De Niro played in "The Godfather: Part II".'PreviousNeo4j DB QA chainNextHugeGraph QA ChainCreate a graph connection and insert some demo data.Creating FalkorDBQAChainQuerying the
This notebook shows how to use LLMs to provide a natural language interface to FalkorDB database.
This notebook shows how to use LLMs to provide a natural language interface to FalkorDB database. ->: (val)-[:ACTED_IN]->(top),        (anthony)-[:ACTED_IN]->(top),        (meg)-[:ACTED_IN]->(top)""")    []Creating FalkorDBQAChain‚Äãgraph.refresh_schema()print(graph.schema)import osos.environ['OPENAI_API_KEY']='API_KEY_HERE'    Node properties: [[OrderedDict([('label', None), ('properties', ['name', 'birthDate', 'title'])])]]    Relationships properties: [[OrderedDict([('type', None), ('properties', [])])]]    Relationships: [['(:Person)-[:ACTED_IN]->(:Movie)']]    chain = FalkorDBQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True)Querying the graph‚Äãchain.run("Who played in Top Gun?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person)-[:ACTED_IN]->(m:Movie)    WHERE m.title = 'Top Gun'    RETURN p.name    Full Context:    [['Tom Cruise'], ['Val Kilmer'], ['Anthony Edwards'], ['Meg Ryan'], ['Tom Cruise'], ['Val Kilmer'], ['Anthony Edwards'], ['Meg Ryan']]        > Finished chain.    'Tom Cruise, Val Kilmer, Anthony Edwards, and Meg Ryan played in Top Gun.'chain.run("Who is the oldest actor who played in The Godfather: Part II?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person)-[r:ACTED_IN]->(m:Movie)    WHERE m.title = 'The Godfather: Part II'    RETURN p.name    ORDER BY p.birthDate ASC    LIMIT 1    Full Context:    [['Al Pacino']]        > Finished chain.    'The oldest actor who played in The Godfather: Part II is Al Pacino.'chain.run("Robert De Niro played in which movies?")            > Entering new FalkorDBQAChain chain...    Generated Cypher:    MATCH (p:Person {name: 'Robert De Niro'})-[:ACTED_IN]->(m:Movie)    RETURN m.title    Full Context:    [['The Godfather: Part II'], ['The Godfather: Part II']]        > Finished chain.    'Robert De Niro played in "The Godfather: Part II".'PreviousNeo4j DB QA chainNextHugeGraph QA ChainCreate a graph connection and insert some demo data.Creating FalkorDBQAChainQuerying the