Bird
0
0

You want to build a chatbot that reformulates questions using the last 3 messages only. Which LangChain memory class should you use?

hard📝 Conceptual Q8 of 15
LangChain - Conversational RAG
You want to build a chatbot that reformulates questions using the last 3 messages only. Which LangChain memory class should you use?
AConversationBufferMemory
BConversationBufferWindowMemory
CConversationSummaryMemory
DConversationTokenBufferMemory
Step-by-Step Solution
Solution:
  1. Step 1: Understand memory classes

    ConversationBufferWindowMemory keeps a fixed window of recent messages.
  2. Step 2: Match requirement of last 3 messages

    ConversationBufferWindowMemory allows setting window size, perfect for last 3 messages.
  3. Final Answer:

    ConversationBufferWindowMemory -> Option B
  4. Quick Check:

    Window memory limits history size [OK]
Quick Trick: Use ConversationBufferWindowMemory for limited history [OK]
Common Mistakes:
  • Using ConversationBufferMemory which stores all history
  • Choosing summary memory which summarizes instead
  • Confusing token buffer with message count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes