v3.2.0
Release Notes
New: Chat Turn Sensors (per user/device)
You now get per-user and per-device sensors that count conversation turns. These sensors are grouped under the xAI Notifications device (same group as sensor.xai_notifications_available_models). They let users decide how to handle long chats via automations without any forced resets.
Sensor names
<User Name> - <Conversation Subentry Title> (<mode>)(e.g.,Alberto - xAI Conversation (pipeline))<Device Name> - <Conversation Subentry Title> (<mode>)(e.g.,Kitchen - xAI Conversation (tools))
What counts as a “turn”
A turn is stored when a conversation response ID is saved in memory. The sensor value aggregates all stored turns for that user/device (across modes and subentries).
Example Automation: Reset Long Chats (User/Device Controlled)
This example uses the Clear Conversation Memory service to reset chat history when a user’s turn count exceeds a threshold. It’s optional and fully controlled by the user.
alias: Reset chat memory when turns exceed 60
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.alberto_xai_conversation_pipeline
above: 60
action:
- service: xai_conversation.clear_memory
data:
user_id:
- person.alberto
include_server: true
only_inactive: falseOptional: include inactive sessions only
Use this to clear only conversations that are already inactive (e.g., older than the configured TTL).
alias: Clear inactive chat memory for a device
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.kitchen_xai_conversation_tools
above: 100
action:
- service: xai_conversation.clear_memory
data:
satellite_id:
- assist_satellite.kitchen
include_server: true
only_inactive: trueOptional: clear everything
Use with caution.
alias: Clear all chat memory (manual)
mode: single
trigger: []
action:
- service: xai_conversation.clear_memory
data:
delete_all: true
include_server: trueAlso includes internal optimizations across intent pipeline, fallback handling, memory management, prompt construction, and tool orchestration to improve overall stability, safety, and responsiveness.
Full Changelog: 3.1.0...3.2.0