Developer Guide
This guide documents the Personal Suggestions feature for developers. Personal Suggestions are agent-owned canned responses that are prioritized in Next Best Message, Search & Autocomplete results for the authoring agent.
Overviewβ
- Source of truth: Admin (Django) database
- Surfacing: Indexed into the account/profile Content Index used by Search and Next Best Message
- Ranking: Boosted for the author (the creating
CustomUser) so their own suggestions appear first - Metadata: Optional labels and locale to aid filtering, search, and ranking
Data modelβ
Notes
- The
Labelrelation uses an explicit through modelPersonalSuggestionLabelto allow for future metadata (e.g., ordering, confidence) without schema breakage. localeis optional and defaults toSupportedLanguages.NL(Dutch). When present, it is used to localize template variables in thetextfield.
Indexing and searchβ
- On create/update, the record is projected into the per-profile Content Index (see Architecture β Search) alongside other content types.
- Indexed fields:
text, normalizedlabels,locale,author_id, timestamps, and visibility keys (account_code,profile_codewhen applicable). - Ranking:
- If
request.user.id == author_id, apply a boost so the authorβs items rank above organization-wide content. - Label and locale matches add secondary boosts.
- If
Access controlβ
- Read: visible to the author in all channels where the author operates under the same account/profile context.
- Write: only the
authormay modify or delete their Personal Suggestions. - Admins may manage retention according to account policy (soft delete preferred; reindex on delete).