AI Prompt Management
Navigate to Settings → AI & Analytics → AI (Super Admin only) to manage the AI prompt templates that power all AI features across the platform.
What AI Prompts Control
Each AI feature has its own system prompt template that defines the AI's behaviour:
- KB Chat (gym) — The help assistant in the gym staff and athlete apps
- KB Chat (platform) — The help assistant in the platform help centre
- Workout Generator (v2) — AI-powered workout creation using a multi-pass structured pipeline (WOD → Strength → Session assembly). Uses Gemini tool calling to produce structured JSON, supports Preview → Edit → Commit workflows, and integrates with each gym's movement library.
- Coach Designed Enrichment — Powers the warm-up generation and coaching notes enrichment pipeline. Used for both individual workout enrichment and bulk enrichment in the Coach Designed import workflow.
- Other generators — Any AI feature using the prompt template system
Prompt Template Structure
Each template has:
- Name — Identifies which AI feature this prompt powers
- Generator Mode — The mode identifier used in code to select this prompt (e.g.
coach_designed_enrichment) - Description — Internal documentation of what this prompt does
- System Prompt — The actual prompt text sent to the AI model
- Active/Inactive — Only one version can be active per template at a time
Prompt Versioning
Every time you edit a prompt, a new version is created:
- Click on a prompt template to open the editor
- Modify the system prompt text
- Add a change summary explaining what changed and why
- Save — the new version becomes active, the previous version is archived
AI Archive
Navigate to Settings → AI & Analytics → AI Archive to view all historical prompt versions. This provides:
- Complete version history for each template
- Change summaries explaining each modification
- Ability to compare versions and understand prompt evolution
- Rollback capability — reactivate a previous version if a change causes issues
Workout Generator v2 Pipeline
The Workout Generator uses a specialised multi-pass pipeline that is not solely controlled by the prompt template. The pipeline includes:
- Movement library injection — The gym's component library and platform library are automatically injected into the AI context
- Benchmark detection — Known benchmarks are fetched verbatim to prevent hallucination
- Structured output via tool calling — Gemini responds with structured JSON function calls rather than free text
- Automatic validation — Session duration, movement counts, and safety rules are enforced post-generation
Editing the Workout Generator prompt template affects the system instructions but not the pipeline structure or movement library behaviour.
Enrichment Pipeline (Warm-ups & Coaching Notes)
The enrichment system uses the coach_designed_enrichment prompt template as the single source of truth for warm-up and coaching-note output:
- Structure, length, coaching tone, and movement-prep behaviour are all encoded directly in the system prompt
- There are no separate gym-level warm-up templates and no per-generation style toggles (warm-up style, coaching tone, time cap, movement prep, progressive loading have all been retired)
- To offer gyms a different feel (e.g. RAMP, express, mobility-led), publish an additional prompt variant in the AI Prompt Store — gyms can then select the variant they want at the point of generation
Warm-up Variety Strategy (Recent History Window)
To combat repetitive warm-ups, the enrichment function automatically fetches the last 50 workouts from the gym's recent programming, extracts individual movements, deduplicates them, and injects an avoidance instruction into the AI prompt. This ensures fresh movement selection without coach intervention.
Enrichment Edit Log
Every manual coach edit to AI-generated content is tracked in the enrichment_edit_log table (gym-scoped). This provides data-driven insights into where AI outputs diverge from coach expectations, supporting continuous prompt improvement. View aggregate stats in Platform Analytics.
Best Practices
- Always add a clear change summary — future you will thank past you
- Test prompt changes in a staging environment before applying to production
- Small, incremental changes are easier to debug than large rewrites
- Monitor the KB chat's response quality after prompt changes
- For the Workout Generator, test with a small 3-day cycle before rolling out to all gyms
- Review the enrichment edit log periodically to identify systematic prompt weaknesses
- Check AI usage metrics in Platform Analytics to monitor costs and performance