Home / GenAI Engineer practice test / Application Development / Question

Databricks Generative AI Engineer Associate · free practice question

If a developer is creating an AI chatbot using LangChain and it needs to recall previous messages to maintain continuity within a single ongoing dialogue…

Exam-style question on Application Development from the free GenAI Engineer practice test, with the answer and a full explanation below.

Updated November 11, 2026

Application Development

If a developer is creating an AI chatbot using LangChain and it needs to recall previous messages to maintain continuity within a single ongoing dialogue, which LangChain component should be integrated into the processing pipeline to enable this memory feature?

  1. AA conversation memory component that stores the chat message history and feeds prior turns into each new prompt
  2. BA RetrievalQA chain with a vector store retriever that fetches earlier parts of the conversation from an external store
  3. CAn OutputParser configured to capture the model's previous reply and carry it forward into the next call
  4. DA PromptTemplate with a fixed set of few-shot examples that demonstrate typical conversational patterns
Answer & explanation

Correct answer: A

WHY A: LangChain's memory components keep the session's earlier messages and inject them into each new prompt, giving the model access to prior turns. Current code wraps the chain with RunnableWithMessageHistory and a chat message history (or uses a LangGraph checkpointer); older code did the same with ConversationBufferMemory on an LLMChain, both now deprecated.

WHY NOT B: RetrievalQA is used to query external vector stores for document Q&A, not to manage in-session dialogue history. It retrieves semantically similar documents, not sequential conversation turns.

WHY NOT C: OutputParser extracts structured data from model responses. It does not store or replay conversation history.

WHY NOT D: A static few-shot prompt template contains baked-in example conversations authored at design time. It does not dynamically record or replay the actual live user-agent interaction history.

Take the full GenAI Engineer practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Generative AI Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →