> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exulu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics

> GraphQL types for usage statistics and reporting

## statistics

Usage statistics and analytics.

```graphql theme={null}
type statistics {
  id: ID!
  name: String!
  label: String!
  type: String!
  trigger: String!
  count: Int!
  user: ID
  role: ID
  createdAt: Date!
  updatedAt: Date!
}
```

## Aggregate Statistics

Query aggregate statistics with grouping:

```graphql theme={null}
query {
  statisticsStatistics(
    groupBy: "label"
    filters: [
      { type: { eq: "agent_run" } }
    ]
    limit: 10
  ) {
    group
    count
  }
}
```

## Common Statistics Types

* **agent\_run** - Agent execution count
* **api\_call** - API request count
* **workflow\_execution** - Workflow run count
* **eval\_run** - Evaluation execution count
* **context\_search** - Vector search count

## Usage Analytics

Statistics track usage across:

* **Per user** - Track individual user activity
* **Per role** - Aggregate by role
* **Per resource** - Track specific agents, workflows, etc.
* **Time-based** - Query by date ranges

## Example: Agent Usage Report

```graphql theme={null}
query {
  statisticsStatistics(
    groupBy: "label"
    filters: [
      {
        type: { eq: "agent_run" }
        createdAt: { gte: "2025-01-01T00:00:00Z" }
      }
    ]
  ) {
    group  # Agent name
    count  # Number of executions
  }
}
```

## Related Types

<CardGroup cols={2}>
  <Card title="User Management" icon="users" href="/api-reference/core-types/user-management">
    User and role statistics
  </Card>

  <Card title="Agent Types" icon="robot" href="/api-reference/core-types/agent-types">
    Agent usage tracking
  </Card>

  <Card title="Workflow Types" icon="workflow" href="/api-reference/core-types/workflow-types">
    Workflow execution stats
  </Card>

  <Card title="Back to Overview" icon="arrow-left" href="/api-reference/core-types/overview">
    View all core types
  </Card>
</CardGroup>
