# How Does Regenerating Summaries Work?

**URL:** https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408
**Category:** Support
**Tags:** ai, ai-summarize
**Created:** [October 29, 2024, 2:20pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408 "2024-10-29T14:20:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [October 29, 2024, 2:20pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/1 "2024-10-29T14:20:59Z")

</div>

Can someone please explain the rules for regenerating summaries? There was some discussion that staff can regenerate summaries after one hour, but that’s not what I’m seeing. (Not sure what I’m seeing- it seems inconsistent.) If there is a new post, should it offer the option to regenerate? And to anyone, or just staff?

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 2, 2024, 3:55pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/2 "2024-11-02T15:55:50Z")

</div>

After experimenting, here’s what I see:

- For topics with \< 100 posts, the regenerate button is enabled immediately for staff only
- For topics with \> 100 posts, the regenerate button is not enabled, even after waiting an hour

Even if the regenerate button did enable, it’s not a viable workflow for our staff to continually hit the buttons, so I tentatively plan to implement a webhook listening for new posts that regenerates the summary using [https://forum.example.com/discourse-ai/summarization/t/12345](https://forum.example.com/discourse-ai/summarization/t/12345). Quick calculation says that would run around $500/year for our forum. I realize Discourse is trying to protect against an unexpected large cost.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 2, 2024, 4:42pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/3 "2024-11-02T16:42:23Z")

</div>

Hey @markschmucker,

We are currently working on a backfill strategy for Topic summaries in DiscourseAI. We plan to ship it next week, and I will update you here when it lands.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 7, 2024, 10:20pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/4 "2024-11-07T22:20:58Z")

</div>

We have the feature now @markschmucker, you can adjust it via the `ai summary backfill maximum topics per hour` site setting.

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 8, 2024, 3:10pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/5 "2024-11-08T15:10:36Z")

</div>

I’ve set that to 12 and on my Anthropic dashboard I see an event every 5 minutes, as expected. But I can’t see the payload from that dashboard. How can I see what summary Discourse is regenerating?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 8, 2024, 3:19pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/6 "2024-11-08T15:19:22Z")

</div>

> [@markschmucker](#):
>
> How can I see what summary Discourse is regenerating?

It is all stored in the `ai_api_audit_logs` table. If you have [Data Explorer](https://meta.discourse.org/t/32566?silent=true), you can use the following query:

```sql
SELECT
  *
FROM
  ai_api_audit_logs
ORDER BY
  id DESC
LIMIT
  100

```

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 8, 2024, 6:45pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/7 "2024-11-08T18:45:21Z")

</div>

After playing with that, it looks like backfilling generates summaries for some of the Latest topics (looks like around 100 topics or topics that were updated in the past few weeks?).

During or after the backfill cycle, if a topic with a summary gets a new post, its summary is not automatically updated. (If it has \< 100 posts, there is a “Regenerate” button that staff can hit manually.)

When should the topic with a new post get updated?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 8, 2024, 6:50pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/8 "2024-11-08T18:50:25Z")

</div>

> [@markschmucker](#):
>
> When should the topic with a new post get updated?

It should be updated in up to 5 minutes after a reply is posted, at least for normal topics with under 50 replies.

Is your community more geared towards mega-topics?

cc @Roman

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 8, 2024, 6:59pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/9 "2024-11-08T18:59:44Z")

</div>

Now I see there was a failure in the SummariesBackfill job- I hit a daily rate limit at Anthropic. That might be why it appeared to stop after maybe the 100 Latest topics, and also why the updated topic did not get a new summary.

So if I did not hit a rate limit, will SummariesBackfill summarize all 60,000 of our topics? Even those that have been inactive for years?

> [@Falco](#):
>
> Is your community more geared towards mega-topics?

Most topics have more than 100 replies. We have 8 topics with over 1000 replies.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 8, 2024, 7:14pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/10 "2024-11-08T19:14:00Z")

</div>

> [@markschmucker](#):
>
> So if I did not hit a rate limit, will SummariesBackfill summarize all 60,000 of our topics? Even those that have been inactive for years?

Yes, it starts every 5 minutes to do a batch, prioritizing the most recent active and skipping ones who already have an up to date summary.

If you configure your max limit per hour to be higher than how many topics with new activity you have per hour, on average, it will eventually backfill all your topics.

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 8, 2024, 7:35pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/11 "2024-11-08T19:35:12Z")

</div>

Feature request: something like `ai summary backfill maximum age`, so we don’t incur a lot of cost summarizing old topics with no activity say in the last six months. I estimate it would cost us $3,000 to summarize all 60,000, most of which we don’t care about.

cc @Roman

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 8, 2024, 8:19pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/12 "2024-11-08T20:19:24Z")

</div>

Just confirming here are you using haiku 3.5, it should produce good summaries

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [November 8, 2024, 8:40pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/13 "2024-11-08T20:40:30Z")

</div>

I’m using sonnet 3.5, for no good reason. Haiku 3.5 should cut the cost a lot. I think the feature request is still worth considering though.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 8, 2024, 8:57pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/14 "2024-11-08T20:57:19Z")

</div>

yeah certainly.

I feel like we can possibly create a fancy backfilling algorithm in automation, cause there are a lot of knobs you may want to twiddle with beyond age.

- Only these categories
- Stuff with more than X views
- Stuff with more than N likes
- Stuff with accepted answers
- Stuff newer than X

Adding 10 site settings for this will overwhelm users.

---

<div class="post-metadata">

### Author: ![AGeneral](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ageneral/32/157909_2.png) [@AGeneral](https://meta.discourse.org/u/AGeneral)
#### Post date: [November 13, 2024, 1:00am UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/15 "2024-11-13T01:00:29Z")

</div>

I agree with Mark. If we are to implement this for our forum, we dont want old posts getting resummarized that dont have new activity. AI is too costly at the moment considering summaries are just one small part of all the AI tools.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 9, 2024, 2:17pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/16 "2024-12-09T14:17:40Z")

</div>

> [@markschmucker](#):
>
> Feature request: something like `ai summary backfill maximum age`

There is `ai summary backfill topic max age days` now, and it defaults to 30 days.

> [@AGeneral](#):
>
> we dont want old posts getting resummarized that dont have new activity.

Old topics aren’t “resummarized” unless there is new activity.

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [December 30, 2024, 4:06pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/17 "2024-12-30T16:06:47Z")

</div>

I cleared all the summaries with rails c `AiSummaries.destroy_all`, and started a new run with a different LLM, using `ai summary backfill topic max age days` = 60. At first I had `ai summary backfill maximum topics per hour` set too high, so many of the newest topics failed because of rate limits. That’s my bad, but I expected after it backfilled to 60 days, it would start a new loop and backfill the failed topics. However it’s not doing that- it backfilled to 60 days and then stopped.

The job is running successfully every 5 minutes, but takes only milliseconds, so obviously isn’t finding anything to backfill.

I’m monitoring progress (or lack thereof) with [Data Explorer](https://meta.discourse.org/t/32566?silent=true), using the `ai_summaries` and `ai_api_audit_logs` tables.

If I manually click the Summarize button on a topic that did not get backfilled, it does generate a new summary, so I am properly connected to the AI provider, and the topics are “summarizable”.

No errors in /logs.

Ideas?

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [December 30, 2024, 8:37pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/18 "2024-12-30T20:37:03Z")

</div>

Found the problem. It’s comparing `ai summary backfill topic max age days` to `topic.created_at`, not `updated_at`. I think this should be changed to `updated_at`- I have many very active topics created two years ago which still get new posts every week, but if I use a max age of 90 days or even a year, those topics will not get summarized.

Please consider changing this.

`.where("topics.created_at > current_timestamp - INTERVAL '#{max_age_days.to_i} DAY'")`

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [January 13, 2025, 4:29pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/19 "2025-01-13T16:29:32Z")

</div>

I have many single post topics that are edited a lot (docs), can we update these summaries if a topic get’s updated?

---

<div class="post-metadata">

### Author: ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)
#### Post date: [January 14, 2025, 2:02pm UTC](https://meta.discourse.org/t/how-does-regenerating-summaries-work/333408/20 "2025-01-14T14:02:42Z")

</div>

Suggest changing the interval for the backfill job from 5 minutes to 1 minute if possible. Most(?) AI providers have rate limits per minute, so if the job ran every minute, you could get 5x more summaries done without exceeding the per-minute rate limits.
