Skip to content

Content: generate three opportunities per run instead of five to fifteen #730

Closed

Description

@gkhngyk

Summary

Every generation run asks the model for 5 to 15 content opportunities. In production it consistently returns about ten. That is more than anyone acts on in a day, and because the nightly run repeats it, the list grows faster than a customer can work through it.

Three opportunities per run is enough. A short list that gets read beats a long one that gets scrolled past.

What it looks like now

Ten days of production generation:

Day Generated Brands Per brand
Day 1 208 21 9.9
Day 2 199 19 10.5
Day 3 182 18 10.1
Day 4 181 17 10.6

The model lands mid-range, so roughly ten arrive per brand per night.

Where the limit lives

The same rule is written twice, in two files that have drifted into near-copies of each other:

  • server/src/lib/opportunity-generator.js — the automatic run, fired from the tracking worker after each cycle
  • server/src/workers/content-worker.js — the queued run behind the Generate button

Both carry the same two constraints:

.min(1)
.max(20)
- Generate between 5 and 15 opportunities.

Proposed change

Ask for three, and cap the schema so a talkative model cannot exceed it. Both files need the change, or the button and the nightly run will disagree.

The count is the easy half. The harder half is that with only three slots, which three matters much more than it did at ten. The prompt already receives the top 25 scored prompts, ranked by volume, visibility gap, competitor gap and intent. The instruction should say the three must be the highest-impact available, not the first three the model composes — otherwise cutting from ten to three trades away the good ones as easily as the filler.

Worth deciding while implementing

The two code paths write to the table differently, and this change makes the difference more visible:

  • content-worker.js deletes every new row for the brand before inserting, so a manual run replaces the list.
  • opportunity-generator.js appends, skipping only rows whose prompt_id and title match an existing new row exactly.

So a manual Generate leaves the customer with exactly what the model just produced, while the nightly run adds to whatever is already there. Three per night with the append behaviour is still ninety a month.

Reducing the count does not fix that on its own, and this issue is not asking it to — the accumulation and near-duplicate problem deserves its own issue and its own decision about whether the nightly run should replace, expire, or genuinely deduplicate. But whoever implements this should know both paths exist and keep them consistent on the count.

Scope

  • The prompt instruction and schema ceiling in both files
  • No schema migration, no surface changes — the Content page already paginates whatever exists

How to test

  1. Trigger a manual generation for a brand with a rich tracking history and confirm exactly three opportunities are returned.
  2. Confirm the three are distinct recommendations, not one idea in three wordings.
  3. Run a tracking cycle for a brand on a plan with content optimization and confirm the automatic path produces the same count as the button.
  4. Confirm a brand with very little data still produces a sensible result rather than failing the schema.

Activity

  1. added
    enhancement
    content
    on Aug 17, 2026
  2. added a commit that references this issue on Aug 19, 2026
    00597f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions