Created
December 26, 2025 14:16
-
-
Save larkintuckerllc/aad394d86808e5dbf761f3816e7b9ed8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from langchain.agents import create_agent | |
| from langgraph.checkpoint.memory import InMemorySaver | |
| from langchain.messages import HumanMessage | |
| from langchain.tools import tool | |
| CONFIG = {"configurable": {"thread_id": "1"}} | |
| QUESTION_1 = HumanMessage(content="Hello my name is Sean and my favorite color is green.") | |
| QUESTION_2 = HumanMessage(content="What is my favorite color?") | |
| agent = create_agent( | |
| model="gpt-5-nano", | |
| checkpointer=InMemorySaver(), | |
| ) | |
| response = agent.invoke( | |
| {"messages": [QUESTION_1],}, | |
| config=CONFIG | |
| ) | |
| print(response["messages"][-1].content) | |
| response = agent.invoke( | |
| {"messages": [QUESTION_2],}, | |
| config=CONFIG | |
| ) | |
| print(response["messages"][-1].content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment