Submits an agent's execution traces so that AWS Context can extract reusable knowledge and skills from them. Call it when an agent finishes a task or session that is worth learning from. In agentContextArns, name the agent contexts that the traces are about. AWS Context analyzes the traces for each of them.
Each traceDocuments entry is one raw trace document in the trace schema that format selects. You can send 1–100 documents per call. Each document can be up to 5 MiB before encoding. If you use an AWS SDK, pass each document's raw bytes. If you call PutTrace through the agent context's MCP server or another JSON client, send each document as a base64-encoded string. To send a larger trace, split it across calls that share a sessionId. sessionId groups related calls into one session. If you omit it, AWS Context generates one and returns it in the response so that you can reuse it.
Each agent context can hold up to 100,000 trace documents. If a request would exceed this quota, it fails with ServiceQuotaExceededException, and AWS Context stores no documents. If a request fails for any other reason, AWS Context might have stored some of its documents. To store the rest without duplicates, retry with the same clientToken.