Pitchbar's self-improvement loop watches every conversation and flags questions your agent could not answer confidently. Those questions cluster into content gaps at /app/analytics/content-gaps. Treat the page as a prioritised backlog of what to teach your bot next.

How a gap is detected

After every visitor turn, DetectGapJob queues asynchronously (off the hot path) with the user message, the agent id, and the confidence score the retriever produced. The job:

  1. Normalises the question (lowercase + collapse whitespace) and hashes it.
  2. Looks up an existing gap with the same hash for this agent; if found, increments occurrences and refreshes last_seen_at.
  3. Otherwise inserts a new row in content_gaps with status=open.

The job is single-attempt — duplicating a gap row is harmless, but retrying after a transient DB hiccup would over-inflate occurrences.

What the UI shows

Each row carries the question text, the count of times it has been asked, the last time it was asked, and the agent it belongs to.

Actions

Who can do what

RoleView gapsResolve / Ignore
Owner / AdminYesYes
EditorYesYes
ViewerYesNo

Why this matters

Most chatbots silently degrade — a question never gets answered, the visitor bounces, no one notices. Pitchbar turns those silent failures into a triage queue. Working the gap queue weekly is the fastest path to a high-quality agent.