# Custom Reports & AI Generate

_Analytics & Reports_

Reports lets you compose multi-widget dashboards (stat cards, donuts, bars, tables, lists, funnels). AI Generate writes the whole dashboard from a one-line prompt — no manual widget-clicking required.

## Steps
1. Go to Analytics > Reports (sidebar > Analytics > Reports tab).
2. To build manually: click "+ New Report" > "Edit mode" > "+ Add Widget" and pick from the catalog.
3. To build with AI: click "✨ Generate with AI" in the header (or use the inline prompt on the empty-state). Type what you want to see and submit — AI picks 3–8 widgets from the catalog and drops them into a fresh dashboard.
4. AI output goes into a NEW report so you never overwrite a hand-curated one. Rename, edit, or delete from the tabs above the widget grid.
5. Date range and dashboard name come from the prompt when AI can infer them ("...this year" → 1y range; "Pipeline Health" → name).
6. Export any report as CSV from the header (requires the reports:export permission).

## Tips
- Good AI prompts are specific about audience and timeframe: "weekly sales review — funnel, top deals, and stage distribution for the last 30 days" beats "show me sales".
- AI only picks from the shipped widget catalog — it won't invent new chart types. If your ask doesn't map to existing widgets, you'll see "AI could not match…"; rephrase using terms from the catalog (stage / source / lead score / deal value / activity / tasks / bookings).
- AI Generate uses your monthly AI token budget like every other AI feature (Starter 500K / Pro 2M / Max 10M). Each generation typically costs <2K tokens.

## Example
Before her Monday standup, an SDR manager opens Reports > "✨ Generate with AI" and types "this week's sales pulse — pipeline stage breakdown, top leads, and won revenue for the last 7 days". 3 seconds later "Sales Pulse" is a fresh dashboard with a donut + a top-leads table + a won-revenue stat card, time-windowed to the last 7 days. She never had to scroll the widget catalog.

## Troubleshooting
- **"AI could not match your prompt to any available widgets"** — The prompt described charts/data that aren't in the catalog, or used vocabulary the model couldn't map (e.g. "MQL-to-SQL conversion velocity" when the catalog has "Conversion Rate" and "Pipeline Stages"). Fix: Rephrase using the categories the catalog actually covers: contacts, pipeline & deals, tasks, activity, conversations, bookings. Example: "show pipeline stage breakdown and top leads this month".
- **AI generated only 1–2 widgets when I expected more** — The model intentionally caps picks at 3–8 and skews lower for narrow asks. A prompt like "total revenue" maps to one stat card by design. Fix: Broaden the prompt — list the angles you want covered ("revenue, deals by stage, top sources, weekly activity").
- **Generation failed with "monthly AI limit reached"** — Your org used up the month's AI token budget across all AI features (Coach, Pulse, Playbooks, Drafts, Generate, etc.). Fix: Add a BYOK provider key under Settings > AI to bypass the shared CRMown AI budget, or wait for the budget to reset on the 1st.

## Plans
Custom Reports + AI Generate are on all plans. AI Generate uses your monthly AI token budget; CSV export requires the reports:export permission (OWNER/ADMIN by default).
