LangChain 1 · Agents and tools

Remember the conversation

Add a checkpointer and a thread ID so the agent keeps context between calls.

from langgraph.checkpoint.memory import InMemorySaver

agent = create_agent(model="anthropic:claude-sonnet-5-5", tools=[get_weather], checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "user-1"}}
agent.invoke({"messages": [{"role": "user", "content": "Hi, I'm Sam."}]}, config)

Official LangChain 1 documentation

More agents and tools commands

All agents and tools commands · LangChain 1 cheatsheet

Was this page helpful?