๐Ÿš€ We're in early access! Submit feedback โ€” your input shapes the platform.
๐ŸงชTDD Challengeยทbeginnerยทโฑ๏ธ 15โ€“30mยทโญ 100 XP

M-053Build a Conversation Memory Store

Description

Nebula Corp's chatbot has amnesia โ€” it forgets everything after each message. Build a simple conversation memory that stores messages, retrieves recent history, and can summarize the conversation. The memory should support adding messages, getting the last N messages, and searching for messages containing a keyword.

Test Cases (3)

Stores and retrieves messages
Should store messages and retrieve the most recent one
Input:testStoreAndRetrieve()
Expected:CONTAINS:Hi there!
Searches by keyword
Should find messages containing the keyword
Input:testSearch()
Expected:CONTAINS:pricing
Returns conversation stats
Should return total count and breakdown by role
Input:testStats()
Expected:CONTAINS:total

Related Lessons

Click Run / Check to validate your solution