Skip to content

docs(agentic-trust): Analyze AI agents guide#8383

Open
afgambin wants to merge 14 commits intomainfrom
af-3393-ai-agents-optimize
Open

docs(agentic-trust): Analyze AI agents guide#8383
afgambin wants to merge 14 commits intomainfrom
af-3393-ai-agents-optimize

Conversation

@afgambin
Copy link
Copy Markdown
Contributor

Description

This PR adds a new guide documenting how to analyze AI agents with Optimize. It is part of this epic.

When should this change go live?

  • This is a bug fix, security concern, or something that needs urgent release support. (add bug or support label)
  • This is already available but undocumented and should be released within a week. (add available & undocumented label)
  • This is on a specific schedule and the assignee will coordinate a release with the Documentation team. (create draft PR and/or add hold label)
  • This is part of a scheduled alpha or minor. (add alpha or minor label)
  • There is no urgency with this change (add low prio label)

PR Checklist

  • My changes are for an upcoming minor release and are in the /docs directory (version 8.9).
  • My changes are for an already released minor and are in a /versioned_docs directory.

@afgambin afgambin self-assigned this Mar 25, 2026
@afgambin afgambin added agentic orchestration component:docs Documentation improvements, including new or updated content labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

👋 🤖 🤔 Hello, @christinaausley! Did you make your changes in all the right places?

These files were changed only in docs/. You might want to duplicate these changes in versioned_docs/version-8.8/.

  • docs/components/agentic-orchestration/agentic-orchestration-overview.md
  • docs/components/agentic-orchestration/analyze-ai-agents.md
  • docs/components/agentic-orchestration/img/dashboard-optimize.png
  • docs/components/agentic-orchestration/img/heatmap.png
  • docs/components/agentic-orchestration/img/instance-history.png
  • docs/components/agentic-orchestration/img/pie-chart.png
  • docs/components/agentic-orchestration/img/process-instance-overview.png
  • docs/components/agentic-orchestration/img/script-task.png
  • docs/components/agentic-orchestration/img/variables.png
  • docs/components/agentic-orchestration/monitor-ai-agents.md
  • docs/components/assets/icon-operate-black.png
  • docs/components/assets/icon-operate.png
  • docs/components/assets/icon-tool-black.png
  • docs/components/react-components/_ao-card-data.js

You may have done this intentionally, but we wanted to point it out in case you didn't. You can read more about the versioning within our docs in our documentation guidelines.

@afgambin afgambin moved this to 🏗 In Progress in Documentation Team Mar 25, 2026
@afgambin afgambin added the deploy Stand up a temporary docs site with this PR label Mar 26, 2026
@github-actions github-actions bot temporarily deployed to camunda-docs March 26, 2026 11:33 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 26, 2026 17:10 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 27, 2026 08:31 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 27, 2026 10:16 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 27, 2026 15:54 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 27, 2026 16:04 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 30, 2026 09:13 Destroyed
@github-actions github-actions bot temporarily deployed to camunda-docs March 30, 2026 10:39 Destroyed
@afgambin afgambin marked this pull request as ready for review March 30, 2026 12:50
@github-actions github-actions bot temporarily deployed to camunda-docs March 30, 2026 14:15 Destroyed
@afgambin afgambin requested review from a team March 30, 2026 14:41
@camunda-docs-pr-automation camunda-docs-pr-automation bot moved this from 🏗 In Progress to 👀 In Review in Documentation Team Mar 30, 2026
@github-actions github-actions bot temporarily deployed to camunda-docs March 31, 2026 11:13 Destroyed
mdii
mdii previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@mdii mdii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment on lines 92 to 96
```json
{
"storeId": "gcp",
"documentId": "1aa0e4f6-7cee-4c19-ac2e-cebee3c7b151",
"contentHash": "649a8575bf8ced157fbbba7acc02ba33058bb2e3f40fb37b0f303730fb64fba0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unrelated to this PR, but this example with the document response might be a bit hard to grasp. Maybe we can use another tool call result here showing the actual tool call result in plain text? Or a Fetch URL call where "store response" is not enabled?


How you extract these values depends on how your AI agent implementation exposes token usage. The important aspect is that the target variables exist at the **process level** when the instance finishes.

To do so:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the token counts from the agent context only works with the AI Agent Process when the "Include agent context" option is enabled, because otherwise the context won't be part of the agent response - should we mention this somewhere?

Comment on lines +55 to +60
- In **Script**,
- **Result variable**: `tokenUsage`.
- **FEEL expression**: `agent.context.metrics.tokenUsage.inputTokenCount`.
- In **Output mapping**, add two process variables:
- `inputTokenUsage` with **Variable assignment value**: `agent.context.metrics.tokenUsage.inputTokenCount`.
- `outputTokenUsage` with **Variable assignment value**: `agent.context.metrics.tokenUsage.outputTokenCount`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: I don't know much about Optimize, so I might miss something here.

I'm not sure if I completely understand why we refer to inputTokenCount twice here, once in the result variable and once in the output mapping. Is this because we need to create 2 distinct global variables, but the script task needs an implementation?

Could we potentially create a result variable tokenUsage (so a FEEL implementation exists) mapped to agent.context.metrics.tokenUsage and 2 output mappings:

  • inputTokenUsage - >tokenUsage.inputTokenUsage
  • outputTokenUsage -> tokenUsage.outputTokenUsage

Copy link
Copy Markdown
Contributor

@christinaausley christinaausley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work here! Very minor adjustments in my latest commit, and two non-blocking comments.

- **FEEL expression**: `agent.context.metrics.tokenUsage.inputTokenCount`.
- In **Output mapping**, add two process variables:
- `inputTokenUsage` with **Variable assignment value**: `agent.context.metrics.tokenUsage.inputTokenCount`.
- `outputTokenUsage` with **Variable assignment value**: `agent.context.metrics.tokenUsage.outputTokenCount`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tokenUsage is set to inputTokenCount, which may read like total token usage later in the guide? If the intent is total usage, we could consider renaming the variable or adjusting the example? Optional.


1. Follow [the previous steps 1 through 6](#step-3-create-reports-for-token-usage).
1. In the **Visualization** settings, click the gear icon, and then enable **Set target** to configure a target value, for example, a maximum token usage threshold.
1. Set the target to less than 10,000 tokens.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Optimize uses a specific target operator or threshold mode here, we could consider naming it explicitly instead of implying "less than" behavior but I'm not sure of the mechanics here -- like would "Set the target to 10,000 tokens or to the threshold that matches your budget." even really work? Feel free to disregard but just a thought.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

The preview environment relating to the commit b48a7d5 has successfully been deployed. You can access it at https://preview.docs.camunda.cloud/pr-8383/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentic orchestration component:docs Documentation improvements, including new or updated content deploy Stand up a temporary docs site with this PR

Projects

Status: 👀 In Review

Development

Successfully merging this pull request may close these issues.

4 participants