SnowPro Specialty: Gen AI Question 174
Single answerChat conversationsA retail company is building a customer-support assistant in Snowflake using Cortex chat capabilities. Agents need the assistant to answer follow-up questions like "What if I return it after 45 days?" based on the prior conversation, while also ensuring each customer's conversation history is isolated from others. The development team notices that when they send only the latest user message to the model, the assistant often loses context and gives inconsistent answers. Which approach should the team use to preserve conversational context correctly and securely?
- A
Store the full conversation as ordered chat messages per session and send the relevant message history with each new request, scoped to that specific customer session.
- B
Rely on the model to remember prior requests automatically across API calls, because chat models persist context by default once a session is established.
- C
Concatenate all customers' previous prompts into one shared prompt so the model can learn common return-policy patterns and answer follow-up questions better.
- D
Send only the system prompt on each request, because system prompts are sufficient for the model to infer prior user intent in multi-turn conversations.
Show answer and explanation
Correct answer: A
Explanation
For chat conversations, preserving context requires the application to manage and resend relevant message history with each turn. This is a core best practice for multi-turn LLM applications: the model uses the messages included in the current request, not an implicit long-lived memory across calls. In Snowflake-based GenAI solutions, teams commonly store conversation history in tables or application state, then pass the ordered messages back to the chat function or API for each new user turn. Just as important, history should be partitioned by customer or session to maintain privacy and prevent data leakage. System prompts are useful for instructions and guardrails, but they are not a substitute for prior conversational turns. This aligns with standard chat-conversation design patterns and Snowflake Cortex usage guidance for building contextual, secure conversational applications.
- A. Correct.
Correct. In chat-based applications, the model does not automatically retain prior conversation state across independent requests unless that context is provided again. The recommended pattern is to maintain conversation history in the application or database, structure it as ordered messages (for example, system, user, assistant), and send the relevant prior turns with each request. Scoping the stored history to an individual customer session also helps prevent cross-user data leakage.
- B. Incorrect.
Incorrect. A common misconception is that chat models maintain persistent memory between separate API calls. In practice, conversational context must generally be supplied as part of each request. If only the latest message is sent, the model may not understand references such as pronouns, prior policy details, or follow-up conditions.
- C. Incorrect.
Incorrect. Mixing multiple customers' prompts into one shared context would create serious privacy and security issues and would likely degrade answer quality by introducing irrelevant context. Conversation state should be isolated per user or per session, not pooled across unrelated users.
- D. Incorrect.
Incorrect. A system prompt can define behavior, tone, guardrails, or high-level instructions, but it does not replace the prior user-assistant turns needed for multi-turn understanding. Without message history, the model cannot reliably resolve follow-up references like "it" or "that order."