Skip to content

Customer Success

05GTMCustomer success
Context Graph tribal knowledge
account history · prior alerts · suppressed risks · owner map
Sources
HubSpot
HubSpot
Read.ai
Read.ai
Slack
Slack
weekly
Agentcy
Agentcy
Agentcy
CS agent + sentiment
risk digest
Output
Slack #cs-leads
Slack #cs-leads

At a glance

The agent's job: every Monday at 07:00 UTC, score the top accounts on inactivity + sentiment + missed action items, then post a digest to #cs-leads listing the 5 highest-risk accounts with concrete next steps.

Stack

  • HubSpot HubSpot — deal stage, NPS scores, last contact timestamps.
  • Read.ai Read.ai — meeting transcripts, action items, sentiment.
  • Slack Slack — customer DM history (where consented) + outbound digest.
  • Scheduled Tasks — Monday-morning cron.
  • Agent Loop — uses the catalog to fetch the right slice of each tool.

What you'll build

A weekly task that:

  1. Pulls the customer accounts the team manages (from HubSpot).
  2. For each account, gathers: last activity date, deal stage, recent NPS, latest meeting summary from Read.ai, recent Slack DM thread sentiment.
  3. Scores each account on a simple 0–100 churn-risk index.
  4. Picks the top 5 highest-risk and the top 3 healthiest.
  5. Posts a digest to #cs-leads with one line per account and a suggested action.

The same agent answers ad-hoc questions in chat: "how is Acme Corp doing?", "summarize our last 3 calls with BigClient."

Prerequisites

  • HubSpot configured with a private-app token that has crm.objects.contacts.read, crm.objects.companies.read, crm.objects.deals.read, and tickets.
  • Read.ai configured via OAuth.
  • Slack configured. The bot needs chat:write. For DM-history scoring, also groups:history and im:history plus explicit user opt-in.
  • A frontier-class LLM — sentiment + summary quality matter here.
  • Realmcrm recommended.

Step-by-step

1. Configure the connectors

text
1. Open /connectors → "+ Add Connector".
2. Pick HubSpot → "Private app token". Paste the pat-na1-... token.
   Realm: crm. Tick objects: contacts, companies, deals, tickets.
3. Repeat for Read.ai (OAuth) and Slack (bot token).
4. Click Test on each — green pill = ready.
bash
# HubSpot
curl -X POST http://localhost:8080/api/v1/sources \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"hubspot-main","connector":"hubspot","realm":"crm",
    "config":{
      "auth":{"kind":"private_app","token":"pat-na1-..."},
      "objects":["contacts","companies","deals","tickets","owners"]
    }
  }'

# Read.ai (OAuth — finishes in browser)
curl -X POST http://localhost:8080/api/v1/sources \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"readai-cs","connector":"readai","realm":"crm",
    "config":{"auth":{"kind":"oauth"},"modules":["meetings","transcripts","action_items"]}
  }'

# Slack
curl -X POST http://localhost:8080/api/v1/sources \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"slack-cs","connector":"slack","realm":"crm",
    "config":{
      "auth":{"kind":"bot_token","token":"xoxb-..."},
      "channels":["customer-dms","cs-team"]
    }
  }'

2. Create the weekly digest task

Create Task panel.

text
1. Open /tasks → "+ New Task".
2. Trigger Type: Schedule.
3. Name: cs-churn-watch. Realm: crm.
4. Cron: 0 7 * * 1  (Mondays at 07:00 UTC).
5. Task Prompt: paste the instruction from the API tab.
6. Connectors: tick hubspot-main, readai-cs, slack-cs.
7. Save.
bash
curl -X POST http://localhost:8080/api/v1/tasks \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"cs-churn-watch",
    "agent":"default",
    "realm":"crm",
    "trigger":{"kind":"schedule","cron":"0 7 * * 1"},
    "input_template":{
      "instruction":"Score every active customer account for churn risk on a 0-100 scale. Inputs: HubSpot deal stage + last contact date + NPS, Read.ai meetings in the last 30 days (sentiment + open action items), Slack DM activity. Pick the top 5 highest-risk accounts and the top 3 healthiest. For each high-risk one: one-line summary, two-line suggested action (specific — naming a person to reach out, an unfinished action item to close, a meeting to schedule). Post to Slack #cs-leads as a single message with one bullet per account. Healthy accounts at the bottom in a small `Wins` section. Keep total under 25 lines."
    },
    "approval_defaults":{"write":"allow"},
    "cost_cap_usd_per_day": 5.00,
    "max_concurrent_runs": 1
  }'

3. Add the on-event trigger (optional)

For an extra signal: page when an NPS survey comes back below 6.

text
1. Create a second task: cs-low-nps-pager (webhook trigger).
2. Configure HubSpot → Workflows → on NPS-survey-complete →
   "Trigger webhook" → URL = the Agentcy webhook URL.
3. Optional but recommended: HubSpot has no native HMAC; put a
   tiny proxy in front to compute the signature.
bash
curl -X POST http://localhost:8080/api/v1/tasks \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "name":"cs-low-nps-pager",
    "agent":"default",
    "realm":"crm",
    "trigger":{"kind":"webhook"},
    "input_template":{
      "instruction":"An NPS event arrived: {{trigger.body}}. If score < 6, fetch the contact + their most recent meeting transcript + their open tickets, then post a one-paragraph context summary to Slack #cs-leads. Tag the account owner."
    }
  }'

4. Test with sample data

text
1. Open /tasks → cs-churn-watch.
2. Click "Run now" (manual fire).
3. Watch the run pane — sample HubSpot pulls happen first, then
   Read.ai meeting recall, then Slack post.
4. Check #cs-leads for the digest. Iterate the prompt until happy.
bash
curl -X POST "http://localhost:8080/api/v1/tasks/$TASK_ID/run" \
  -H "authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  -d '{}'

# Stream events
curl -N "http://localhost:8080/api/v1/tasks/$TASK_ID/runs/$RUN_ID/events" \
  -H "authorization: Bearer $TOKEN"

Worked example

A scoping policy that ensures the agent stays inside the crm realm and doesn't write back to HubSpot/Slack DMs by accident:

rego
package agentcy.cs

# Stay in CRM realm
deny[msg] {
  input.subject.task == "cs-churn-watch"
  input.resource.realm != "crm"
  msg := "cs-churn-watch is scoped to realm=crm"
}

# Allow Slack post_message to #cs-leads only
allow {
  input.subject.task == "cs-churn-watch"
  input.resource.connector == "slack"
  input.resource.tool == "slack.post_message"
  input.resource.args.channel == "#cs-leads"
}

# Block any HubSpot writes (no auto-creating notes/tasks without human review)
deny[msg] {
  input.subject.task == "cs-churn-watch"
  input.resource.connector == "hubspot"
  input.resource.tool_effect != "read"
  msg := "cs-churn-watch is read-only on HubSpot"
}

What good looks like

A weekly digest in #cs-leads:

CS digest · Mon 27 Apr

🔴 At-riskAcme Corp (risk 84) — silent 22 days, NPS dropped 9→6 last quarter, 3 open action items from 14 Apr meeting. Action: @alice → schedule a check-in this week. • Globex Inc (risk 71) — deal at "negotiation" for 47 days, last call sentiment was negative on pricing. Action: @bob → propose the 6-month plan. • Initech (risk 67) — primary contact left (Slack DM mentions handoff), no replacement identified. • Cyberdyne (risk 64) — 2 P1 tickets open >5d. • Stark Industries (risk 61) — usage down 38% MoM.

💚 WinsWayne Enterprises — NPS 9→10, deal moving to "closed-won". • Soylent — expanded seats by 30 last week. • Tyrell Corp — 4 great meeting outcomes since last week.

The transcript shows tools called: hubspot.search_companies, hubspot.get_deal, readai.list_meetings, readai.get_transcript, slack.list_messages, slack.post_message.

Variations

  • Per-segment digests. Split the task per CS pod (cs-emea, cs-amer). Each scoped to that pod's owner ids in HubSpot.
  • Real-time mode. Drop the cron, use Read.ai's webhook on meeting.ended to trigger the agent for that one account immediately after the call.
  • Add ZenDesk / Freshdesk. Once a ticketing connector ships, fold ticket SLAs into the score.
  • Action-item closer. A second agent that emails the contact (via Gmail) the open action items two days after each meeting if they haven't been marked done.

Troubleshooting

Read.ai recall is empty. Tokens expire silently. Check GET /api/v1/sources/$READAI_ID/test — if it 401s, re-run the OAuth flow.

Score swings wildly week to week. Frontier models give more stable scores. If you're on a smaller model, add explicit numeric weights in the instruction (e.g. "silence > 14 days = +30, NPS < 7 = +20, ...").

Slack post is missing some accounts. The agent paginated and stopped. Tighten the instruction: "limit yourself to top 100 accounts by ARR". Or pin the source list and increase CHAT_MAX_TOOL_ITERATIONS.

HubSpot rate-limit (429s in the transcript). Default rate is fine for weekly. If you fire the digest hourly + run other HubSpot tasks, bump the connector's rate cap or schedule the digest off-peak.

Next

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.