FAQ Builder
STEP 0 — Discover the account and ask the user
Call allo_get_me to confirm the connected Allo account and available scopes.
Then call allo_list_users and allo_list_numbers in parallel to enumerate who and what is available.

Present the user with a scoping question before doing anything else:
"I found [N] users and [N] phone lines on [TEAM NAME].
Who or what should I include in this FAQ analysis?

Options:
  A) Specific user(s) — list names and let them pick
  B) Specific phone line(s) — list numbers/labels and let them pick
  C) The whole team (all users, all lines)

Also: what date range? (default: last 30 days)"
Wait for the user's answer before proceeding. Do not assume a default scope.
Log this as Step 0 in the run log.

STEP 1 — Retrieve calls for the selected scope
Using allo_search_conversation_items, pull all answered calls within the chosen date range. Apply only the filters the user confirmed:
  - If a specific user was chosen: add user_id
  - If a specific line was chosen: add allo_number
  - If whole team: omit both (searches across all lines)
  - Always set: type=CALL, result=ANSWERED, size=100, sort=DATE
Paginate if has_more=true. Collect all pages before moving on.
Log each API call with method, inputs, and result count.

STEP 2 — First-pass demo/discovery detection from summaries
Do NOT fetch transcripts yet.

Each call returned by Step 1 includes a summary field. Read every summary and flag a call as a demo/discovery candidate if any of the following signals are present:

Explicit signals: demo / product walkthrough / discovery call / first call / how does X work / show me / trial setup / onboarding intro / evaluating the product / can it do X

Implicit signals: prospect asking about pricing / asking about integrations / asking about compliance or security / comparing with a competitor / asking about use cases / asking about implementation time / asking about team size or plan limits / asking about support model

Note: internal calls, support troubleshooting calls for existing customers, or billing-only calls should NOT be flagged as demo/discovery candidates.

Mark each call: DEMO_CANDIDATE (yes/no) with a 1-line reason drawn from the summary. Calls with no summary should be deferred to Step 3 for manual review if they are ≥ 3 minutes long.

Exclude calls shorter than 180 seconds at this stage. Log how many were excluded and how many candidates remain.

STEP 3 — Pull full transcripts for demo/discovery candidates
Fetch transcripts only for candidates using allo_batch_get_conversation_items with extend=transcript. Batch in groups of 6 to avoid token overload — do not exceed 6 per batch call.

For each transcript, confirm whether it is truly a demo or discovery call. If a candidate turns out to be unrelated (false positive from summary), discard it and note it in the run log.

For each confirmed demo/discovery call, tag every prospect question:
  QUESTION        — the exact question asked by the prospect (verbatim when possible; paraphrase only if spread across several turns, marked ⚠️ paraphrased)
  QUESTION_CATEGORY — one of: pricing / feature-specific / integrations / security & compliance / onboarding & setup / use case / competitor comparison / support model / contract & terms / other
  REP_ANSWER      — a brief summary of how the rep responded (1–2 sentences)
  FAQ_POTENTIAL   — high (clear question, reusable answer) / medium (needs rephrasing) / low (too context-specific to generalise)

Preserve the speaker's name or role, the moment in the call (early / mid / late), and a call reference (ID, date, contact name or number).

STEP 4 — Cluster, rank, and report
Group identical or near-identical questions into clusters. Count how many distinct calls each cluster appeared in (occurrence count). Then produce this report:

📊 Demo/Discovery FAQ Analysis — [TEAM NAME] — [DATE RANGE]
Scope: [Users / Lines / Whole team — as selected by user]
Calls retrieved: [N total] → [N after length filter] → [N confirmed demo/discovery calls]
False positives discarded: [N] (summaries flagged but transcripts didn't confirm)
Total questions extracted: [N] → [N unique clusters]

🔵 Top 20 Prospect Questions — Ranked by Frequency
For each question cluster:
  Canonical question — the clearest, most reusable phrasing
  2–3 sentence summary of how this question surfaced across calls
  Exact quotes with speaker role, call moment (early/mid/late), and call reference
  Question category
  Occurrence count
  Suggested FAQ entry — a draft answer (2–5 sentences) based on how your best reps answered it; mark gaps as ⚠️ no good answer on record

🟣 Question Category Breakdown
For each category (pricing, features, integrations, etc.):
  Total unique questions in this category
  Top 3 most frequent questions
  % of demo calls where at least one question from this category appeared

🏴 Competitor Mentions in Questions
List every competitor named in a prospect question across all confirmed calls:
  Competitor | # of calls | Context (comparing features / pricing / switching from / other)

🔧 Run Log
| Method | Key Inputs | Result |
|--------|-----------|--------|
| …      | …         | …      |

Rules that always apply:
  - Never fabricate quotes. If something is inferred or paraphrased, mark it ⚠️ inferred / ⚠️ paraphrased.
  - Occurrence count = distinct calls, not total mentions within one call.
  - If a question appears in only 1 call, flag it ⚠️ weak signal.
  - If fewer than 3 confirmed demo/discovery calls exist, report what's available, flag ⚠️ thin data, and offer to widen the date range before concluding.
  - If allo_get_me or allo_list_users fail, ask the user to provide the team name, user list, or phone lines manually before proceeding.
  - If Allo MCP is unavailable, ask the user to paste transcripts directly.