View a markdown version of this page

Continue a conversation - AWS Context

Continue a conversation

AWS Context keeps no conversation state between requests. To ask a follow-up, send the earlier turns in messages, then the new question.

The following example sends two earlier turns and a follow-up question:

"messages": [ {"role": "USER", "content": "How many orders shipped late last quarter?"}, {"role": "ASSISTANT", "content": "1,240 orders shipped late in Q3."}, {"role": "USER", "content": "Break that down by Region."} ]

Only the text of earlier turns is used; the context retrieved for them isn’t carried over. Up to 100 messages are allowed. Long histories count toward request size limits (1 MiB over MCP), so trim or summarize older turns.

sessionId doesn’t restore earlier turns. It groups the traces of related requests for trace analysis; set it to a value unique to each conversation. AWS Context can also analyze the traces of a conversation’s session to learn from it. For more information, see Sessions.