Hello Everyone ![]()
Hope everyone is doing well. I’m reaching out to seek some expert guidance on an image analysis use case using the Pega Gen AI Agent step. Would really appreciate any help or pointers!
Environment
-
Pega Version: Infinity 25
-
AI Model: Pega-Default-Smart (Claude-Sonnet-45)
-
Constraint: Must use only Agent step — no external REST connectors
Requirement
User uploads a PNG image as a case attachment. We need to analyze the image using the Agent step and display the summary on UI.
What We Built
An activity loops through the ImageDoc page list, fetches the Base64 encoded image stream via: D_AttachmentContent[AttachInsKey:.pxAttachmentKey, PopulateAttachStream:true].pyAttachStream and stores it in ImageInputPrompt property (String, max length 1000000).
The Agent step is configured as:
-
Input message:
.ImageInputPrompt(contains full Base64 image string — verified no truncation in tracer) -
Output message:
.ImageSummary -
Model: Claude-Sonnet-45 (vision capable)
Issue
Despite the Base64 string being stored correctly, the Agent always returns a summary describing a Pega system screen (mentioning actual case ID, logged-in user, navigation tabs) instead of analyzing the actual uploaded image. The response mentions “Based on provided pega_context” which confirms the Agent is reading Pega system context rather than processing the image.
What We Have Already Tried
-
Passed Base64 with and without
data:image/png;base64,prefix — same result -
Increased property max length to 1000000 — truncation resolved but issue persists
-
Updated Agent guardrails to ignore Pega context — no change
What is the correct way to pass a Base64 image to the Agent step for actual image analysis?
Any guidance, workarounds or best practices would be greatly appreciated. Thanks in advance for your time and support! ![]()
