mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 06:53:59 +00:00
Neo4j conversation cypher template (#12927)
Adding custom graph memory to Cypher chain --------- Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
23
templates/neo4j-cypher-memory/main.py
Normal file
23
templates/neo4j-cypher-memory/main.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from neo4j_cypher_memory.chain import chain
|
||||
|
||||
if __name__ == "__main__":
|
||||
original_query = "Who played in Top Gun?"
|
||||
print(
|
||||
chain.invoke(
|
||||
{
|
||||
"question": original_query,
|
||||
"user_id": "user_123",
|
||||
"session_id": "session_1",
|
||||
}
|
||||
)
|
||||
)
|
||||
follow_up_query = "Did they play in any other movies?"
|
||||
print(
|
||||
chain.invoke(
|
||||
{
|
||||
"question": follow_up_query,
|
||||
"user_id": "user_123",
|
||||
"session_id": "session_1",
|
||||
}
|
||||
)
|
||||
)
|
Reference in New Issue
Block a user