# Long-term value

> How a Thompson Sampling agent can learn which messages make people use your app more over the next 90 days, compared with people who got nothing, and skip a send when no message is likely to help.

By default an agent learns from a goal soon after each send. A message can win that way and still hurt: a pushy message gets clicks today and uninstalls next week. On a Thompson Sampling agent you can switch the agent's **Settings**, **What Herald learns from**, to **Long-term value** instead.

## What counts as value

Value is counted in one unit: active days over the next 90 days. Each day someone uses your app counts once, however many sessions they have. On top of that:

- **Shares.** Each event named `share` is worth 7 active days.
- **Referrals.** Each event named `referral_signup`, sent when a friend someone invited signs up, is worth 30 active days.
- **Purchases.** Revenue is turned into active days at your app's average revenue per active day over the last 90 days.

Annoyance costs value too. An unsubscribe costs 1, turning off push 2, an uninstall 3 and a spam complaint 3, where 1 is an average person's next 90 days.

## How a message gets credit

Herald compares each person who got a message with people who got nothing: the agent's holdout group, and people it chose not to message. It looks at how active the person was in the 28 days before the send and estimates their next 90 days from what they do after it. A message gets credit only for value above what similar people did without one, minus any annoyance beyond the holdout group's rate.

Results start after a day, are corrected after three days and settle after a week, when annoyance is checked.

## No repeated messages

A long-term value agent doesn't send someone a message they got from it in the last 7 days, even if it's the strongest one. When the person has had every message in that time, the agent sends the one they got longest ago, so messages take turns.

## Skipping a send

With long-term value on, a second option appears: **Skip a send when it's unlikely to help**. Sending nothing is then one of the choices, with a value of exactly zero. If no message is likely to beat that for a person, Herald sends nothing and tries again on a later day. A small share of picks still tries every option, so the agent keeps learning.

## Small apps and big apps

A small app starts with a simple estimate: a person's activity rate over the days measured, times 90 days, allowing for some drop-off. Once 2,000 of your app's messages, skips and holdout picks have a full 90 days measured, Herald fits its own estimate each week and uses it only while it predicts better than the simple one. It fits a second one the same way from the 28 days before a message alone, which is what each person's next 90 days would likely have been without it; a message's credit is measured from there. Personas with little data borrow from the whole agent, as with [learning with small audiences](/docs/concepts/learning-with-small-audiences).

The agent's results show a **Long-term value lift** card: extra active days per person over 90 days compared with people who got nothing, with a 95% range. It needs 200 people who got a message and 200 who didn't, each at least a week ago.

## Message features

Every message variant can carry a few features: its **Tone** (practical, warm, curious, urgent, playful or celebratory), **Approach** (progress, social proof, fear of missing out, curiosity, reward, reminder, news or personal), **Offer** (none, discount, free trial, content or feature), **Call to action** (open the app, buy, read, watch, share, invite, update or none), **Length** (short, medium or long), and whether it's **Personalized** and **Uses emoji**. Set them under **Message features** when you edit a variant.

You don't have to fill them in by hand. When someone adds a message or changes its copy, Herald asks AI to fill the features of any variant that has none. People who can edit the message library can press **Fill with AI** on a variant to get a suggestion to check before saving, and admins can press **Tag messages** on an agent's Messages page to fill up to 20 messages at a time that don't have features yet. Each variant AI fills counts as one AI copy request against your daily limit, and filling stops when the limit is used up. Features you save yourself replace what AI filled.

With features, an agent can learn **by message features** instead of by persona: which kinds of message work for which kinds of person. It looks at how engaged someone has been (active fewer than 3 of the last 30 days, 3 to 14, or more than 14), their lifecycle stage and how recently they were active. A brand-new message then starts from what similar messages did for similar people, instead of from scratch. Learning by features needs more traffic than learning by persona, and it doesn't forget old results, so a big change in what your audience likes takes longer to show.

## Testing a new approach

Each agent has a **Learning** tab. On a long-term value agent it shows the agent's **Current approach**, **Long-term value, by persona** or **Long-term value, by message features**, and a suggestion. The suggestion counts the decisions the agent made per message per week over the last four weeks: under 200 is too few to compare approaches, so it suggests keeping the current one; otherwise it suggests learning by message features when at least half the agent's messages have features, and by persona when they don't.

Admins can test the other approach in one of two ways, with at most two tests running per agent:

- **Try in shadow.** The new approach scores every decision and records what it would have done, without sending anything. **Check on past decisions** estimates how it would have done on the last 60 days of decisions it saw, once at least 1,000 of them have a full week of results.
- **Give it 10% of people.** The new approach decides for a fixed 10% of people. Once 200 decisions on each side have a full week of results, the page compares the two.

Either way the result is the extra active days per person over 90 days compared with the current approach, with a 95% range. **Make it the current approach** is available only once the whole 95% range is above zero; it stops any other test. A test given 10% of people is stopped automatically, checked once a day, if its unsubscribes, push opt-outs, uninstalls and spam complaints per message are more than 50% higher than the current approach's over the last 30 days, once it has at least 30 of them.

## Learning from other apps

Admins can turn on **Share and learn across accounts** under Settings, General, **Learn from other apps**. It's off by default. Every night, Herald combines what has been learned in the accounts that have it on, weighting each by how much it has learned: what each kind of message feature is worth with each kind of person, from agents with at least 200 results, and each app's fitted estimate of the next 90 days. Only these learned numbers are shared, never your data or your users, and only between accounts that share.

Your account then gets a head start: a new agent learning by message features starts from the shared numbers instead of from zero, and until your app fits its own estimate of the next 90 days, it uses the shared one. The shared numbers exist only once at least two accounts contribute. While only a few accounts share, the one that has learned the most counts for most of the result. Turn sharing off and you stop getting the head start too.

## Time and channel

An agent's messages can go out on different channels, so the agent already chooses the channel when it chooses a message. An agent that learns by message features also learns which channel works for which kind of person.

Such an agent can also choose the time of day: tick **Choose the time of day too** under what the agent learns from. When it's on, the agent decides for each person about once a day: it picks a message and a three-hour block in the person's local time (6-9, 9-12, 12-15, 15-18 or 18-21) that starts within the next 24 hours, outside the agent's quiet hours and blackout dates. Pushes never get the 6-9 block. The message goes out at the person's usual time if it falls inside that block, otherwise when the block starts, and the messaging limits are checked again right before it goes out. Content cards, modal in-app messages and in-app messages without a title still go at once. Value is measured from when the message was due to go out. This works only for messages Herald delivers itself; with any other sending connection the agent chooses only the message.

## Journeys

A journey's message step with versions can **Let Herald choose per person**: each person gets the version most likely to add long-term value for them. Turn it on under Settings, General, **Journey features**. Each step learns on its own, from people who got a version compared with the journey's holdout group, counted when they enter the journey. It doesn't need a journey goal. Give it a few weeks before it learns.

Tick **Allow skipping this message** and sending nothing becomes one of the choices: a person it's unlikely to help moves on to the next step without the message. A version with no valid content isn't a choice.

## Attention as a budget

Each message uses some of a person's attention. Under Settings, **Messaging limits**, admins can set **Messages per person per week, aim**. Every day Herald counts the messages your long-term value agents sent over the last 7 days per person who was active in that time, and moves a price toward your aim: up when they sent more, down when they sent less, never below zero. Long-term value agents then send only a message they estimate is worth more than the price, even when **Skip a send when it's unlikely to help** is off, so volume lands near your aim. Leave it empty and there's no price. Agents that learn from goals ignore it.

**When several agents want the same person** decides who gets them on a run:

- **Highest priority agent first** (the default): the agent highest in your priority order, as before.
- **Agent whose message adds the most value**: among the long-term value agents that want the person, the one whose best message is estimated to add the most value gets them, if it's worth more than the price; if none is, nobody messages them on that run. Message categories still come first: only agents in the person's highest category compete, and agents in that category that don't learn long-term value get first pick, in priority order.

A long-term value agent's results show a **Sending less** card when messages make some of its personas less active than people who got nothing. A persona counts once at least 200 of its people got a message and 200 didn't over the last 90 days, and the whole 95% range is below zero. The card reads "Sending less to these N people would add an estimated X active days per person over 90 days", with a 95% range.

## New messages

On a long-term value agent's **Learning** tab, admins can turn on **Write new messages each week**. Every Monday, Herald asks AI for up to the number you choose (1 to 5, 2 by default) of new messages, based on what's working: the message features worth the most to the agent, or its best messages. They're added to the message of the agent's best variant, with their features filled. For email, the new versions try new subject lines.

Under **New messages**, choose **Wait for my approval** and each one shows on the agent's messages as **Suggested by Herald**, never sent until someone who can edit the message library presses **Approve** (or **Discard**). Choose **Start sending them** and they go live at once with a week's warm-up. No new messages are written while that many suggestions are still waiting. Writing them counts against your daily AI copy limit: one request for the drafts and one per new message to fill its features. If today's limit can't cover that, the agent waits for next week.

**Pause messages that can't win** pauses a message once it has been sent 500 times and has less than a 1% chance of being the best. It never leaves an agent with fewer than 2 active messages.

## Sequence learning for very large apps

The other approaches judge each message on its own. **Long-term value, sequence learning** learns which series of messages works best over time: it knows how many messages someone got in the last day and week, how long ago the last one was, what it was like, and how engaged the person is, so it can learn that a message that works today makes the next one work less, or that waiting a day pays off. Every night it refits from the agent's most recent decisions, up to 200,000, and it's cautious with choices the agent has rarely made. It follows the price too.

It needs a lot of traffic: about 50,000 decisions a month. The Learning tab suggests it once an agent records that many, and it can only be tested, in shadow or on 10% of people, never switched on directly. Until its first nightly fit it decides like learning by persona.

Making it the current approach takes two checks. One is the usual check on past decisions, or the comparison on 10% of people. The other is a simulation: Herald builds a model of your app from the agent's last 90 days of decisions, then runs the current approach and sequence learning for 90 simulated days on the same simulated people, up to 5,000 of them. The result reads "In a simulation of your app over 90 days: +X active days per person compared with the current approach", with a 95% range. Admins run it with **Check on past decisions**; a run stops after about 3 minutes, and a result from the last 24 hours that's newer than the model is reused. **Make it the current approach** is available once the whole 95% range is above zero in both checks.

## Settings

Admins can change what counts under Settings, General, **How long-term value is counted**, for each app: what a share and a referral signup are worth, whether purchases count, and what each kind of annoyance costs. Agents that learn from goals ignore them.
