AIP-C01 practice question: Conversation memory and clarification flows
Foundation Model Integration, Data Management, and Compliance A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A mobile carrier runs a support chatbot on AWS Lambda behind Amazon API Gateway. Each conversation needs the last 20 turns sent to the model, so that follow-up questions make sense.
The bot handles bursts of thousands of chats during outages, and any instance of the Lambda function may serve any customer's next message. Each message must be deleted automatically seven days after it is sent, and the team has no capacity to run scheduled cleanup jobs.
History reads must return in a few milliseconds.
Which design meets these requirements with the LEAST operational overhead?
Choose one answer.
AA. Store each conversation as one Amazon S3 object, rewrite the whole object on every turn, and run a nightly Lambda function that deletes objects whose last-modified date is older than seven days.
BB. Keep the conversation history in a global variable of the Lambda function, so that it persists between invocations in the same execution environment and needs no database.
CC. Store each message as a row in an Aurora PostgreSQL cluster, read the last 20 rows for each request, and schedule a job that deletes rows older than seven days.
DD. Store each message as an Amazon DynamoDB item keyed by conversation ID and turn number, set a Time to Live attribute seven days ahead, and query the latest 20 items.
Show the answer and explanation
Answer: D
A. Wrong: Rewriting the whole object on every turn adds latency as conversations grow, and the nightly deletion job is exactly the cleanup the team cannot run. This misses the latency and operations requirements.
B. Wrong: A global variable lives only in one execution environment, and any environment may serve the customer's next message. Environments are also created and recycled during bursts, so the history would be missing or lost, which fails the reliability requirement.
C. Wrong: Aurora can store this data, but the team would manage the cluster, database connections from thousands of concurrent functions and the scheduled purge job. The team has no capacity for scheduled cleanup, so the approach misses the operations requirement.
D. Right: DynamoDB serves single-digit millisecond reads at any burst size, and the TTL attribute removes old messages with no cleanup job. The table is fully managed, so it meets every requirement with the least operations. Learn more: Using time to live (TTL) in DynamoDB (opens in a new tab)
Explanation
A DynamoDB table keyed by conversation and turn returns recent history in milliseconds, scales through bursts without servers, and deletes expired items with TTL. Object rewrites, per-environment memory and a self-managed database each fail one requirement: latency, reliability or cleanup effort.
Want more on Conversation memory and clarification flows? The 5 full-length practice sets have 6 more Conversation memory and clarification flows questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →