← Back to Mar 9 – Mar 16 Launch

Agent Recommended Actions SOP

Standard Operating Procedure — Agent Pulse feature documentation for support, QA, and engineering handoff.

Purpose

This SOP documents the Recommended Actions feature in LiveChat. It covers:

This feature is intentionally implemented without a new backend service.

Frontend UI
   |
   +--> calls Supabase RPC directly when available
   |
   +--> falls back to client-side ranking if RPC is unavailable
   |
   +--> renders only the highest-signal actions for the current agent

Feature Summary

Recommended Actions is a next-best-action widget for agents. It helps an agent decide:

The widget is shown in the LiveChat agent metrics/dashboard card. Current recommendation buckets:

Only non-empty buckets are shown.


Client-Facing Behavior

What Agents See

Agents see a Recommended Actions card containing one or more sections. Each recommendation row includes:

What Each Bucket Means

Respond Now

The contact is waiting on the agent. The most recent message is inbound and the agent has not replied. Sorted by unread count and wait time — your #1 priority.

Re-Engage

The conversation is going silent. The agent sent the last message (24h–7d ago) but the contact hasn't replied. A well-timed follow-up can revive the chat.

Clicked Link

The contact recently clicked a tracked SMS or email link. This is often the strongest short-term buying signal after a direct reply.

High Intent

Strong engagement patterns — high message volume, lead score, or email opens — without falling into other buckets. Highly likely to convert.


Signals Used

Core Assignment Scope

Only contacts actively assigned to the current agent are considered. Source: livechat_contact_assignments_with_details

Conversation Signals

Intent Signals

Appointment Signals


Important Exclusions

Closed / Suppressed Lead Statuses

Contacts are excluded from intent-based buckets when lead status is: DNC, CLOSED, NOT INTERESTED, APPOINTMENT SET, WON.

Negative Click URLs

The system ignores opt-out style links (unsubscribe, opt-out, opt.customerconnects.app) to prevent false positives.


Architecture Overview

                     AGENT RECOMMENDED ACTIONS

  Assigned contacts
        |
        +----------------------------+
        |                            |
        v                            v
  Conversation signals         Intent signals
  - inbound/outbound           - lead score
  - unread count               - SMS link clicks
  - message counts             - email opens/clicks
        |                            |
        +-------------+--------------+
                      |
                      v
         Supabase RPC: get_agent_recommendations()
                      |
          ranked rows by recommendation_type
                      |
                      v
     frontend hook: useAgentRecommendations()
                      |
        +-------------+-------------+
        |                           |
        | RPC available             | RPC missing / unavailable
        v                           v
  use SQL-ranked rows         use client-side fallback ranking
        |                           |
        +-------------+-------------+
                      |
                      v
      AgentMetricsDashboard -> Recommended Actions card

Frontend Files

FilePurpose
frontend/src/hooks/useAgentRecommendations.jsFetches and groups recommendations, prefers RPC, falls back to client ranking
frontend/src/components/livechat/AgentMetricsDashboard.jsRenders the Recommended Actions card and section UI
supabase/migrations/20260315_create_agent_recommendations_rpc.sqlSupabase ranking logic and indexes

Deployment SOP

Step 1. Apply the migration

Run the full SQL from: supabase/migrations/20260315_create_agent_recommendations_rpc.sql

Step 2. Hard refresh the app

Ensures the newest frontend bundle is loaded.

Step 3. Open the dashboard

Open the LiveChat metrics/dashboard view that contains the Recommended Actions card.

Step 4. Verify bucket behavior


QA Checklist

Product / Client QA

Technical QA


Troubleshooting

Card is empty

  1. Does the agent have active assigned contacts?
  2. Do assigned contacts have message or engagement signals?
  3. Was the migration applied in the correct Supabase project?
  4. Is the current user authenticated in the app?
  5. Are contacts mostly in closed/disqualified statuses?

Clicked Link never appears

SQL works but dashboard still looks old


Known Limitations

Future Improvements