Managing the Customer Knowledge Base
Navigate to Content → Knowledge Base to manage the help articles that gym staff and athletes see in their Help Centre and AI chat assistant.
Articles Tab
This is where you create, edit, and manage all help content. Each article has:
| Field | Purpose |
|---|---|
| Title | Displayed as the article heading and in search results |
| Slug | URL-friendly identifier (auto-generated from title, editable) |
| Category | The category this article belongs to |
| Body (HTML) | The article content — supports h2, h3, p, ul, ol, table, strong, code tags |
| Feature Route | The app route this article is relevant to — enables the AI help widget to suggest it contextually |
| Audience | Who can see it: gym (gym staff), athlete (members), platform (internal), or both |
| Published | Toggle between published (visible) and draft (hidden) |
| Sort Order | Position within the category |
Categories Tab
- Create and edit categories with name, slug, icon (Lucide icon name), and audience
- Deletion safeguard: Categories with articles cannot be deleted — you must move or delete all articles first
- Categories are ordered by sort_order and filtered by audience
Analytics Tab
- Most Viewed Articles — See which articles get the most traffic. High-view articles should be kept up-to-date.
- Searches With No Results — Identify gaps in content coverage. If users are searching for something and getting no results, that's a signal to write a new article.
AI Help Assistant
The KB powers a RAG-based AI assistant (kb-chat) that uses Google Gemini. The assistant:
- Receives the user's question plus their current page route as context
- Searches articles using full-text search (tsvector/GIN index) with title/slug priority and route boosting
- Generates a grounded answer citing specific articles
- Respects audience constraints (gym users only see gym articles, platform staff only see platform articles)
- Members can escalate to "Message my gym" which creates a group chat with gym admins and posts the AI transcript
KB Maintenance Rule
Critical: Every time a feature is built or updated, the corresponding KB content MUST be reviewed and updated. The seed files must be regenerated. See docs/KB-CONTENT-MAINTENANCE.md for the full process and build log.