AI agents performance
Overview
The brains_performance function provides comprehensive performance metrics for AI agents. Use this endpoint to:
- Evaluate AI agent response times and containment rates
- Track coverage and confidence metrics
- Monitor rating scores and conversation activity
Quick start
query BrainsPerformance(
$accountId: uuid
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$startDate: timestamp
$endDate: timestamp
$isTest: Boolean
$agentIds: _text
$tags: _text
$minNumUserMessages: Int
) {
rows: brains_performance(
args: {
account_id: $accountId
start_time: $startDate
end_time: $endDate
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
is_test: $isTest
agent_ids: $agentIds
tags: $tags
min_num_user_messages: $minNumUserMessages
}
) {
brain_parent_id
containment
coverage
avg_confidence
median_confidence
avg_response_time
avg_first_response_time
median_response_time
median_first_response_time
max_response_time
max_first_response_time
min_response_time
min_first_response_time
avg_close_time
median_close_time
max_close_time
min_close_time
ratings
avg_rating
ratings_more_than_3
closed_conversations
participated_sessions
replies
}
}
Variables:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Try it
Loading GraphQL Playground...
Parameters
| Parameter | Type | Description |
|---|---|---|
accountId | uuid | Account identifier |
deskIds | _uuid | Filter by desk IDs |
brainIds | _uuid | Filter by AI agent IDs |
integrationIds | _uuid | Filter by integration IDs |
brainVersions | _int4 | Filter by AI agent versions |
channels | _text | Filter by channels |
startDate | timestamp | Start date (format: yyyy-mm-dd) |
endDate | timestamp | End date (format: yyyy-mm-dd) |
isTest | Boolean | Exclude test sessions |
agentIds | _text | Filter by human agent IDs |
tags | _text | Filter by session tags |
minNumUserMessages | Int | Minimum user messages in session |
Response fields
All time-related fields are in minutes.
AI agent identification
| Field | Type | Description |
|---|---|---|
brain_parent_id | uuid | AI agent identifier |
Performance metrics
| Field | Type | Description |
|---|---|---|
containment | Float | Containment rate (0-1) |
coverage | Float | Coverage rate (0-1) |
avg_confidence | Float | Average confidence score |
median_confidence | Float | Median confidence score |
Response time metrics
| Field | Type | Description |
|---|---|---|
avg_response_time | Float | Average response time (minutes) |
avg_first_response_time | Float | Average first response time |
median_response_time | Float | Median response time |
median_first_response_time | Float | Median first response time |
max_response_time | Float | Maximum response time |
max_first_response_time | Float | Maximum first response time |
min_response_time | Float | Minimum response time |
min_first_response_time | Float | Minimum first response time |
Close time metrics
| Field | Type | Description |
|---|---|---|
avg_close_time | Float | Average close time |
median_close_time | Float | Median close time |
max_close_time | Float | Maximum close time |
min_close_time | Float | Minimum close time |
Rating metrics
| Field | Type | Description |
|---|---|---|
ratings | Int | Total ratings received |
avg_rating | Float | Average rating (1-5) |
ratings_more_than_3 | Int | Ratings greater than 3 |
Activity metrics
| Field | Type | Description |
|---|---|---|
closed_conversations | Int | Conversations closed |
participated_sessions | Int | Sessions participated in |
replies | Int | Total replies sent |
Common use cases
- Account totals
- Multiple AI agents
- Filter by tags
- AI agents and tags
Get performance for all AI agents in an account:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Get performance for specific AI agents:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Get performance for sessions with specific tags:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"tags": "{vip-user, return-order}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Combine AI agent and tag filters:
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"tags": "{vip-user, return-order}",
"startDate": "2024-01-08",
"endDate": "2024-01-17"
}
Example response
{
"data": {
"rows": [
{
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"containment": 0.921,
"coverage": 1,
"avg_confidence": 0.951,
"median_confidence": 1,
"avg_response_time": 0.002290511,
"avg_first_response_time": 0.0033838984,
"median_response_time": 0.0019166666,
"median_first_response_time": 0.0029166667,
"max_response_time": 0.014166667,
"max_first_response_time": 0.014166667,
"min_response_time": 0.00053333334,
"min_first_response_time": 0.0007166667,
"avg_close_time": null,
"median_close_time": null,
"max_close_time": null,
"min_close_time": null,
"ratings": 0,
"avg_rating": null,
"ratings_more_than_3": 0,
"closed_conversations": 0,
"participated_sessions": 63,
"replies": 1600
}
]
}
}