Your team is building a customer support chatbot where individual customer sessions can span days. Users return after 48-hour gaps and expect the conversation to resume contextually. The system stores conversation history in a database. What is the correct strategy for managing message history across sessions of arbitrary length?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — c is correct because maintaining a bounded messages array with a persistent customer context record (updated via summarization after each session) provides both continuity across multi-day gaps and predictable token consumption. The customer context record injected as context gives Claude the relevant history without passing the full raw transcript.
Full explanation below image
Full Explanation
C is correct because maintaining a bounded messages array with a persistent customer context record (updated via summarization after each session) provides both continuity across multi-day gaps and predictable token consumption. The customer context record injected as context gives Claude the relevant history without passing the full raw transcript. A is wrong because passing the full unconstrained message history will eventually exceed the context window and cause API errors — automatic truncation is not guaranteed in a way that preserves semantic coherence. B is wrong because a hard 20-message cap creates an unacceptable customer experience for complex support issues and is not a scalable architectural decision. D is wrong because Anthropic does not provide a native Conversations API that manages server-side history; conversation state management is the developer's responsibility.