Bird
0
0

Which Langchain memory class allows you to store chat history with a limit on the number of messages retained?

easy📝 Conceptual Q2 of 15
LangChain - Conversational RAG
Which Langchain memory class allows you to store chat history with a limit on the number of messages retained?
AConversationBufferMemory
BConversationSummaryMemory
CConversationBufferWindowMemory
DChatMessageHistory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the memory classes

    ConversationBufferMemory stores all messages without limit, ConversationSummaryMemory summarizes older messages, ChatMessageHistory is a base class for storing messages.
  2. Step 2: Identify the class with message limit

    ConversationBufferWindowMemory is designed to keep only a fixed window of recent messages.
  3. Final Answer:

    ConversationBufferWindowMemory -> Option C
  4. Quick Check:

    Memory class with window size limits messages [OK]
Quick Trick: Window memory limits recent messages count [OK]
Common Mistakes:
  • Confusing ConversationBufferMemory with ConversationBufferWindowMemory
  • Assuming ConversationSummaryMemory limits messages instead of summarizing
  • Selecting ChatMessageHistory which is a base class

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes