Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent workflows

Reconcile shopping widgets across agent turns

Stage product cards, comparison tables, delivery timelines, and spend charts in session state, then reconcile one UI update to prevent stale, duplicate, or unchanged widgets.

Goal

Stage product cards, comparison tables, delivery timelines, and spend charts in session state, then reconcile one UI update to prevent stale, duplicate, or unchanged widgets.

Steps

  1. Have tools stage widget payloads in state instead of rendering inline. [src-google-stage-shopping-widgets-across-agent-turns]
  2. Use after_agent_callback to reconcile stable widget IDs, replacements, and removals. [src-google-stage-shopping-widgets-across-agent-turns]
  3. Test restoring old cards, unchanged refreshes, and two tools staging the same ID. [src-google-stage-shopping-widgets-across-agent-turns]

How to verify

Emit one final payload per stable ID; verify restore, removal, and no-change refresh agree with session state.

Troubleshooting

If duplicate cards appear, ensure tools do not render directly; if stale cards remain, check that the callback consumed this turn’s staged state.

Permissions

Prerequisites

Permissions

Limitations

The example handles widget lifecycle and duplicates; it does not validate product relevance or checkout security.

Pinned upstream source

https://github.com/google/adk-samples/blob/9252494a7aaafca8fe4d81a04f15392345a5779b/contrib/python/staged-ui-widgets/README.md

Repository
google/adk-samples
File path
contrib/python/staged-ui-widgets/README.md
Pinned commit
9252494a7aaafca8fe4d81a04f15392345a5779b
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: Apache-2.0

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources