Token budget tool adds LangGraph and CrewAI support
token-budget-contracts is an tool for controlling token use across several AI agents. Each agent receives a priority and a maximum . If an agent runs out during a task, unused tokens can move from idle or lower-priority agents so the entire workflow does not immediately fail.
-gated spending also stops an agent from using more tokens once it is already confident in its answer. Version 0.3.0 adds native adapters for LangGraph and CrewAI. In LangGraph, wrap each node and specify its priority, , and the field that reports usage.
In CrewAI, the tool wraps the function that runs an agent’s task and reads exact usage through a supplied measurement function. support makes the budget-control activity observable.
Key points
- Set a separate priority and maximum for each agent.
- Move unused tokens from idle or lower-priority agents when an important agent runs out.
- Stop further spending when an agent is already confident in its answer.
- Use native adapters with LangGraph and CrewAI.
- Observe budget-control activity through .