1. Learn
  2. /
  3. Courses
  4. /
  5. Designing Agentic Systems with LangChain

Connected

Exercise

Adding graph memory

Excellent! Your chatbot can use Wikipedia to answer questions based on the the user's query. Now you can take things a step further by allowing your users to ask follow up questions! To do this, you'll first need to enable memory within your chatbot. Memory will allow your chatbot access to the full context of the conversation so it can handle follow up conversations.

Instructions

100 XP
  • Start by importing MemorySaver from the checkpoint.memory module in LangGraph.
  • Create an instance of MemorySaver() as memory.
  • Compile the chatbot graph again by setting the checkpointer argument to memory in the .compile() method applied to graph_builder.