Free courses from frontend to fullstack and AI
35% Off Finance Skills That Get You Hired - Code CFI35
Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement conversational memory in LangChain to enable chatbots and AI agents to remember previous interactions within conversations. Explore the evolution from deprecated LangChain 0.0.x memory types to modern implementations using the RunnableWithMessageHistory class in LangChain v0.3. Master four essential memory types: ConversationBufferMemory for storing all conversation history, ConversationBufferWindowMemory for maintaining a sliding window of recent messages, ConversationSummaryMemory for creating condensed summaries of conversations, and ConversationSummaryBufferMemory for combining buffer and summary approaches. Work through practical implementations of each memory type, transitioning from legacy methods to current best practices using LangChain Expression Language (LCEL). Understand the importance of conversational context in building effective chatbots that can maintain coherent multi-turn conversations rather than treating each message in isolation. Gain insights into token usage optimization through LangSmith monitoring and learn to balance memory efficiency with conversation quality in your AI applications.
Syllabus
00:00 Conversational Memory in LangChain
01:12 LangChain Chat Memory Types
04:26 LangChain ConversationBufferMemory
08:23 Buffer Memory with LCEL
13:14 LangChain ConversationBufferWindowMemory
16:01 Buffer Window Memory with LCEL
22:32 LangChain ConversationSummaryMemory
25:17 Summary Memory with LCEL
30:12 Token Usage in LangSmith
32:08 Conversation Summary Buffer Memory
34:36 Summary Buffer with LCEL
Taught by
James Briggs