Skip to main content

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 Label relation uses an explicit through model PersonalSuggestionLabel to allow for future metadata (e.g., ordering, confidence) without schema breakage.
  • locale is optional and defaults to SupportedLanguages.NL (Dutch). When present, it is used to localize template variables in the text field.
  • On create/update, the record is projected into the per-profile Content Index (see Architecture β†’ Search) alongside other content types.
  • Indexed fields: text, normalized labels, locale, author_id, timestamps, and visibility keys (account_code, profile_code when 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.

Access control​

  • Read: visible to the author in all channels where the author operates under the same account/profile context.
  • Write: only the author may modify or delete their Personal Suggestions.
  • Admins may manage retention according to account policy (soft delete preferred; reindex on delete).