Skip to main content

What are Gaps?

Gaps represent questions your AI couldn’t answer or actions it couldn’t perform. Thunder automatically detects these moments and categorizes them, helping you understand where your AI falls short. There are two types of gaps:
TypeDescriptionExample
Knowledge GapInformation the AI doesn’t know but users expect”What’s your refund policy?” when the AI wasn’t trained on refund info
Tool GapActions the AI can’t perform but users request”Can you book an appointment for me?” when the AI can’t access calendars

Why Gaps Matter

Gaps are your roadmap for AI improvement. They tell you:
  • What knowledge to add - Specific topics users ask about that your AI can’t answer
  • What tools to build - Capabilities users expect but don’t exist yet
  • How often they occur - Which gaps affect the most users
  • Recent trends - What users are asking about now

Gap Metrics

MetricDescription
sessionsConversations where this gap was detected
usersUnique users who encountered this gap
messagesNumber of times this gap occurred (a gap can appear multiple times per session)

Querying Gaps

Most Common Gaps

Find your most frequent unanswered questions:
curl "https://api.usethunder.com/v1/query?\
groupBy=GAP&\
instanceId=your-instance-id&\
dateRange.start=2024-01-01T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=ALL&\
fields=sessions,users,messages&\
sort.field=messages&\
sort.order=DESC&\
limit=20" \
  -H "x-api-key: YOUR_API_KEY"
Response:
{
  "elements": [
    {
      "dimensions": {
        "gap": {
          "id": "gap-uuid",
          "name": "Refund policy details",
          "description": "Users asking about refund timeframes and conditions",
          "gapType": "KNOWLEDGE"
        }
      },
      "fields": {
        "sessions": 156,
        "users": 143,
        "messages": 234
      }
    },
    {
      "dimensions": {
        "gap": {
          "id": "gap-uuid-2",
          "name": "Appointment booking",
          "description": "Users wanting to schedule appointments",
          "gapType": "TOOL"
        }
      },
      "fields": {
        "sessions": 89,
        "users": 82,
        "messages": 112
      }
    }
  ],
  "pagination": { "total": 47, "limit": 20, "offset": 0 }
}

Filter by Gap Type

Find only knowledge gaps or only tool gaps:
# Knowledge gaps only
curl "https://api.usethunder.com/v1/query?\
groupBy=GAP&\
instanceId=your-instance-id&\
gapType=KNOWLEDGE&\
dateRange.start=2024-01-01T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=ALL&\
fields=sessions,messages&\
sort.field=sessions&\
sort.order=DESC" \
  -H "x-api-key: YOUR_API_KEY"
# Tool gaps only
curl "https://api.usethunder.com/v1/query?\
groupBy=GAP&\
instanceId=your-instance-id&\
gapType=TOOL&\
dateRange.start=2024-01-01T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=ALL&\
fields=sessions,messages&\
sort.field=sessions&\
sort.order=DESC" \
  -H "x-api-key: YOUR_API_KEY"

Recent Gaps

Find gaps from the last 7 days to see what users are asking about now:
curl "https://api.usethunder.com/v1/query?\
groupBy=GAP&\
instanceId=your-instance-id&\
dateRange.start=2024-01-24T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=ALL&\
fields=sessions,users,messages&\
sort.field=sessions&\
sort.order=DESC" \
  -H "x-api-key: YOUR_API_KEY"
Track how gaps change week over week:
curl "https://api.usethunder.com/v1/query?\
groupBy=GAP&\
instanceId=your-instance-id&\
dateRange.start=2024-01-01T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=WEEK&\
fields=sessions,messages" \
  -H "x-api-key: YOUR_API_KEY"

Finding Sessions with Gaps

See the actual conversations where a gap occurred:
curl "https://api.usethunder.com/v1/query?\
groupBy=SESSION&\
instanceId=your-instance-id&\
gapIds=gap-uuid-here&\
dateRange.start=2024-01-01T00:00:00Z&\
dateRange.end=2024-01-31T23:59:59Z&\
timeGranularity=ALL&\
fields=messages,sat,dsat&\
dimensionFields=title,summary,topics" \
  -H "x-api-key: YOUR_API_KEY"
This returns all sessions where that specific gap was detected, along with the conversation summary and related topics.

Use Cases

Knowledge Base Priorities

Use knowledge gap frequency to decide what documentation or training data to add first.

Feature Roadmap

Tool gaps show what integrations and capabilities users want most.

Measure AI Improvement

Track gap frequency over time to verify that updates are working.

Topic Correlation

Cross-reference gaps with topics to understand which subject areas have the most missing information.

See Querying Metrics for more query patterns and the full field reference.