# Retry AgentCore result writes without duplicate records

Kam State is an add-on for Amazon Bedrock AgentCore, planned for AWS Marketplace.

Handle a timed-out Kam State write from an AgentCore application. Preserve result identity, inspect exact retry receipts, and keep external tool effects separate.

> Use retained identity and receipts to retry an AgentCore result write without creating a second revision for the same submission.

Status: Implemented in source. Prelaunch; not a live service guarantee.
Record deduplication is bounded by retained evidence. It does not provide exactly-once model calls, refunds, messages, or other external actions.

Reviewed: 2026-10-14.
Backend source: e16b81b4a637acec91f3aed8a71cf5b0f42f0c19.
Native toolkit: merged in PR #176, reviewed at e16b81b4a637acec91f3aed8a71cf5b0f42f0c19.
HTML: /docs/agent-result-retries

## In short

An AgentCore application may lose a response after submitting a result. Preserve its original identity and payload so a supported retry can return the retained receipt. Recording a result and executing a tool are separate operations; the application must resolve uncertain external effects before running a tool again.

**Available today:** Private SDK 0.40.0 supports the documented History recording and retry contract. Evaluation access is required; a hosted production service is not offered.

## Retry the recorded result

- **Preserve the request** — Keep the original identity, revision and payload after a lost response.
- **Inspect the receipt** — A supported exact retry returns retained acceptance evidence.
- **Resolve tool effects separately** — The AgentCore application owns external-action evidence and retry decisions.

## Preserve identity before sending the result

Bind the approved tenant scope through the authorized service connection. Keep the subject, type, ID, revision, occurrence time and complete declared payload with the application work item. A new random ID on each attempt represents a new record, so it cannot deduplicate the original submission.

Record a declared success or failure only when the application has evidence for that result. Pending and unknown execution states must not be converted to failure just to fit an outcome write.

[SDK integration and access requirements](/docs/integrate)

## Separate a lost response from a failed action

1. **The response was lost** — Keep the original request. A timeout does not establish whether the result was accepted.

2. **Retry the exact result submission** — Resubmit the same identity, revision and payload through the approved connection. A supported exact retry returns the original receipt without a new revision while its evidence is retained.

3. **Inspect a conflict explicitly** — A different payload at the same revision conflicts. Do not hide the conflict by assigning a different ID or silently overwriting the recorded result.

4. **Treat a correction as a correction** — Use the next revision for a changed result and preserve its identity, scope and occurrence time. Read the retained versions explicitly when reviewing the change.

[Run the documented record, retry and correction example](/developers#integration)

## Keep external tool idempotency in the application

If a payment or message was sent before its result was recorded, retrying the Kam write does not resend that payment or message. Conversely, an accepted Kam record does not prove that an external action completed. Use the external system’s supported request identity and evidence when resolving that uncertainty.

The application controls AgentCore execution, model calls and tool retries. Kam preserves admitted results and its own processing progress; it does not infer successful execution from a missing response.

[Accepted-State recovery boundaries](/docs/durability)

## Plan for evidence expiry

Idempotency depends on retained evidence. Do not recycle result IDs after expiry or assume an old retry receipt remains available forever. Retention, current authorization and the working History window still apply.

During evaluation, check an exact retry, a conflicting payload, a valid correction and an unavailable old reference. Keep those results separate from proof that the complete AgentCore workflow has been qualified in a live environment.

[Identity, ordering and retained revisions](/docs/history)

[History retention contract](/docs/retention)

[Qualification and evidence](/docs/qualification)
