Skip to content

Conversation

@charlotte-hoblik
Copy link
Contributor

Summary

This PR adds a new "Token usage and counting" section to the documenatition.

It clarifies how the agentic framework calculates token consumption.

Related issue: https://github.com/elastic/docs-content-internal/issues/600

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Vale Linting Results

Summary: 1 warning found

⚠️ Warnings (1)
File Line Rule Message
solutions/search/agent-builder/monitor-usage.md 21 Elastic.DontUse Don't use 'just'.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

@leemthompo
Copy link
Contributor

leemthompo commented Dec 17, 2025

Looking good. I think this deservers to be a standalone page, with a generic name which will allow us to add more content about usage, pricing, billing etc. in the future: maybe something like monitor-usage.md?

The H1 can just be about "token usage in AB" initially

We should then make sure we link to this new page from the landing page and from the chat, agents, tools pages for visibility.

@leemthompo
Copy link
Contributor

@copilot can you remove the #token-usage-in-elastic-agent-builder anchor in all the new links added in this PR?

Copy link
Contributor

Copilot AI commented Dec 18, 2025

@leemthompo I've opened a new pull request, #4413, to work on those changes. Once the pull request is ready, I'll request review from you.

Removed the `#token-usage-in-elastic-agent-builder` anchor from all
links to `monitor-usage.md` to simplify navigation and improve
maintainability.

**Changes:**
- Updated links in `chat.md`, `agent-builder-agents.md`, and `tools.md`
to reference `monitor-usage.md` directly without anchor fragments
- Links now point to the page itself rather than a specific section,
allowing the page structure to evolve independently

Before:
```markdown
[Token usage in Elastic Agent Builder](monitor-usage.md#token-usage-in-elastic-agent-builder)
```

After:
```markdown
[Token usage in Elastic Agent Builder](monitor-usage.md)
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: leemthompo <32779855+leemthompo@users.noreply.github.com>
@leemthompo
Copy link
Contributor

@copilot we need to add the new page to the /solutions/toc.yml file too

Copy link
Contributor

Copilot AI commented Dec 18, 2025

@leemthompo I've opened a new pull request, #4414, to work on those changes. Once the pull request is ready, I'll request review from you.

Thanks for the feedback on #4384. I've created this new PR, which merges
into #4384, to address your comment. I will work on the changes and keep
this PR's description up to date as I make progress.

Original PR: #4384
Triggering comment
(#4384 (comment)):
> @copilot we need to add the new page to the `/solutions/toc.yml` file
too


<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: leemthompo <32779855+leemthompo@users.noreply.github.com>
@chrisbmar
Copy link

This LGTM but I'll leave the approval to @joemcelroy and @akm-esco as this relates to tokens and billing 🙏🏽

@akm-esco
Copy link

akm-esco commented Dec 19, 2025

This generally looks good just want to check on a couple things:
@joemcelroy does the Raw Response json contain all the tokens that are sent/received? Can we tell users to look at that for more detail on the usage?

As the conversation history grows and the agent performs more complex reasoning loops, the input and output token count increases multiplicatively for each round of execution.

I think I know what this line is getting at but it feels like it would be difficult for a user to understand. Maybe something like, "each conversation round uses the previous rounds of the conversation for context, so subsequent rounds will generate larger quantities of tokens even if the inputs/outputs for that round are relatively small"

@leemthompo
Copy link
Contributor

I think I know what this line is getting at but it feels like it would be difficult for a user to understand.

Good point @akm-esco, I tightened this up based on your suggestion in 3e7f4da

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants