Optimizing Tokens in Pega Agentic AI Using Data Pages

Enjoyed this article? See more similar articles in :fire::fire::fire: Pega Cookbook - Recipes :fire::fire::fire: series

Optimizing Tokens in Pega Agentic AI Using Data Pages

When designing Agents in Pega, efficient token usage is critical for achieving fast, reliable, and cost‑effective responses. One of the most effective optimization techniques is carefully controlling what information is provided to an Agent at initialization time.

Use Data Pages for Dynamic Context at Agent Initialization

Pega Data Pages provide a powerful mechanism to fetch dynamic, context‑specific data during Agent initialization. By configuring Data Pages to load only essential information upfront, you can supply the Agent with the right context without overwhelming its instructions.

This approach ensures that:

  • The Agent starts with accurate, up‑to‑date enterprise data

  • Prompts remain concise and focused

  • Token consumption is kept under control

While it may be tempting to provide extensive background data, more information does not always lead to better results. Overloading Agent instructions can:

  • Slow down response generation

  • Increase token usage unnecessarily

  • Risk exceeding token limits

A recommended practice is to provide only the data the Agent truly needs to reason or take action. Any non‑essential information should be retrieved later, on demand, rather than during initialisation.

Configuration Steps

Step 1:
Navigate to Agent → Additional Context to configure data sources used during Agent initialisation.

Step 2:
Create a new Data Transform and ensure the JSON option is selected.

Step 3:

  • Use Object for Scalar Properties and Embedded Data(Single Page)

    • Use Update Page for EmbeddedData (single page)
  • Use Array for EmbeddedData (PageList)

Step 4:
Configure the Data Page created in Step 3 and apply the Data Transform to optimize the payload.

Step 5:
Validation.

Before Data transform

After Data transform to optimize the token.

Metric Before optimization After optimization
Tool node token count 10,745 tokens 265 tokens
Token reduction -– 40× reduction (97.5% fewer tokens)

What this means at enterprise scale: A 40× reduction in tool output tokens translates directly to:

  • Lower LLM API costs on every Pega Agent run

  • Faster response generation for Pega users

  • More available context window for runtime reasoning

  • Greater headroom for complex multi-step Pega Agent tasks

At enterprise scale — thousands of Pega Agent runs per day — this optimization compounds significantly.

Best Practices for Token‑Efficient Agent Design

To optimize token usage effectively:

  • Configure Data Pages to return relevant fields

  • Avoid embedding large data structures or verbose descriptions in instructions

  • Separate static instructions from dynamic runtime data

  • Periodically review Agent prompts to remove redundant context

Final Thoughts

Token optimization is not just a performance consideration—it directly impacts scalability and user experience. By leveraging Data Pages thoughtfully and keeping Agent instructions lean, you enable Pega Agents to respond faster, operate more reliably, and scale efficiently across enterprise use cases.

Design smart. Include only what matters. Let Pega do the orchestration.

Enjoyed this article? See more similar articles in :fire::fire::fire: Pega Cookbook - Recipes :fire::fire::fire: series

Thanks for sharing yet another way Pega Solutions are head of the curve when it comes to mitigating token cost. Curious if Token Mitigation isn’t worthy of it’s own Expert Circle Category?

I love this.I do this in an Agentic Tool with a data page that calls a data transform that only returns what I need. I use a slightly different approach where I call a data transform that uses the ootb case lookup Data Page , then I just set what I need. Not only token reduction, but as you say, it lets the LLM focus on the data it needs and reduces variability because it doesn’t need to look through data it has no use for.