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
- Have tools stage widget payloads in state instead of rendering inline. [src-google-stage-shopping-widgets-across-agent-turns]
- Use
after_agent_callbackto reconcile stable widget IDs, replacements, and removals. [src-google-stage-shopping-widgets-across-agent-turns] - 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
- Google ADK sample, A2UI client, test product catalog, and a runtime that stores session state.
Permissions
- Reads the catalog and writes session widget state; callback sends UI payloads to clients, with no payment/order permission.
Limitations
The example handles widget lifecycle and duplicates; it does not validate product relevance or checkout security.
Pinned upstream source
- 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