# AI Bar History

_AI Features_

Per-user log of every AI command bar interaction (Ctrl+K). Searchable, pinnable, exportable. Most useful when an admin wants to know what the team's actually using AI for, or when a user wants to recall "what was that thing the AI helped me build last Tuesday?".

## Steps
1. Sidebar > Tools > AI Intelligence > AI History. Defaults to your own history; admins see a tab to view org-wide.
2. Each row: timestamp, question, answer (collapsed by default — click to expand), action type tag (command / insight / draft / info), category (auto-classified by the light-tier model in the background), pin icon.
3. Search box matches across questions + answers. Tag filter narrows by action type or category.
4. Click the pin to keep an answer at the top of your list — useful for recurring queries (your favorite report, a complex formula you've worked out, etc.).
5. Promote any answer to the org-shared Knowledge Base via the "↑KB" button on the row — turns one-off Q&A into team-wide documentation. Promoted rows show a green "✓ KB" badge instead of the button.
6. (Faster path) Promote in-line from the AI Bar response bubble itself — every answer now has a violet "↑ Save to Knowledge Base" pill underneath it. AI History is the right place for bulk curation or re-promoting older entries.
7. Export your history as CSV from the page header (preserves question + answer + timestamp).

## Tips
- History is per-user — admins can't snoop on individual users' AI interactions, only see their own. Org-level aggregate (most asked questions, AI usage by user) is in the AI Usage Dashboard.
- Auto-categorization runs in the background after each entry (one light-tier call per new entry). Categories like "billing", "pipeline", "reporting" emerge from your actual usage; the classifier doesn't use a fixed taxonomy.
- Pinned items don't expire. Unpinned history retains for 90 days then auto-purges.

## Example
A marketing analyst spent 30 minutes last week working out a complicated cohort-retention query with the AI bar. Today she needs the same query for a different segment. She opens AI History, searches "cohort retention", finds the entry from last Tuesday, copies the answer, adapts the segment filter. 90 seconds vs. 30 minutes.

## Troubleshooting
- **AI History page is empty** — You've never used the AI command bar (Ctrl+K), or the entries auto-purged at 90 days. Fix: Open Ctrl+K and ask the AI something — the entry shows up immediately. To preserve entries past 90 days, pin them.
- **Answer column shows "[hidden]"** — You're not the user who originally asked. Other users' AI history is private by default. Fix: Ask the user to share or promote the entry to the org Knowledge Base if the team needs it.
- **Promoted to KB but it doesn't appear there** — KB promotion writes to a different model and may take a few seconds. Or the KB feature is disabled for the org under Settings > AI Usage > AI Features. Fix: Refresh the Knowledge Base page. If still missing, verify the Knowledge Base feature is enabled.

## Plans
Included in every plan. Logging is free; auto-categorization is one tiny light-tier call per entry. Toggleable per-org under Settings > AI Usage > AI Features (key: ai_bar_history) — disabling it stops history persistence (the AI Bar itself stays on).
