Agents

Adaptive Temperature

The agent loop dynamically adjusts the model temperature based on tool error rate. When tools fail, temperature lowers to make the model more conservative; it recovers toward the configured baseline on clean turns.

Algorithm

typescript
// On each round, after executing tools:
if (turnErrorCount > 0) {
  adaptiveTemp = Math.max(0.1, adaptiveTemp - 0.1 * turnErrorCount)
} else if (round > 0) {
  adaptiveTemp = Math.min(agentConfig.model.temperature, adaptiveTemp + 0.05)
}

Behaviour

ConditionChangeBound
One or more tool errors−0.1 × errorCountFloor: 0.1
Clean turn (no errors)+0.05Ceiling: configured temperature

Config

Set the baseline temperature in astra.yml:

yaml
agents:
  my-agent:
    model:
      temperature: 0.7   # adaptive range: 0.1 – 0.7
Adaptive temperature runs automatically. The configured value acts as the ceiling; the floor is always 0.1.