GUIDE · THE LOOP
The self-improving loop: how a trends engine makes an AI agent better every week
A trends API returns rows. A trends engine feeds a loop: read the market, pick one test, measure it and start the next run from what won. How to set it up, with the log and the prompt to copy.
ANSWER FIRST
The short answer
A self-improving agent is one whose next run starts from the results of its last one. With TrendsFast that takes five steps: read the market, pick one test, post it, measure it and log what won. Your agent reads that log before it pays for the next call, so it does more of what worked and stops repeating what did not. The engine supplies the evidence, your agent keeps the memory, and you post.
What is a trends engine?
A trends engine is a service that keeps reading a market, ranks what it finds against one brand, and says what that evidence does and does not support. Your agent reaches it through an API or an MCP server. The difference from a plain API is who does the deciding.
| Kind | Returns | Who decides what matters | What it remembers |
|---|---|---|---|
| A trends API | Rows of trends for a query | Your agent | Nothing beyond the data itself |
| A tool catalog | Each provider's own answer, one call per provider | Your agent | Nothing about your market |
| A trends engine | Evidence ranked for your brand, with what it supports and what it could not see | The engine ranks; your agent picks one test | History for each topic, and your confirmed brand |
The five steps
- Read (TrendsFast): One call collects fresh from your brand's sources and ranks the evidence against it.
trendsfast_niche_trends - Decide (Your agent): The result says what the evidence supports, what it does not and which channels were not read. Your agent picks one test.
brief · evidence_class · coverage - Test (You and your agent): Your agent drafts inside each community's rules and you post it. TrendsFast never does.
trendsfast_community_brief - Measure (You and your agent): A video outlier check scores your post against your own median for 5 credits. Your analytics cover the rest.
trendsfast_video_outlier - Learn (Your agent): Your agent logs what won beside the result ID. The next run reads that log first and rereads the old result for free.
trendsfast_read_result
Two of those steps are yours on purpose. TrendsFast has no tool that posts, so a bad week produces a draft you throw away and never a post you regret.
Keep the log
The log is what makes the loop improve. Each test is one line, added when the test starts and completed when its date comes. Never rewrite a line: the record of what lost is the part people lose first.
{"date":"2026-11-09","test":"First-person post on r/indiehackers about finding first users","evidence":"00000000-0000-4000-8000-000000000000","success_signal":"signups from the post within 7 days","check_after":"2026-11-16","outcome":null,"verdict":null}Claude Code and other coding agents can keep it as a file in the project. In the Claude app, use a project document called Loop log. In n8n, use a table. The evidence field holds the TrendsFast result ID, because rereading a saved result is free: a later run can go back to what it saw without paying again.
Give your agent the loop
Add this to the instructions of the agent that does your marketing, such as a Head of Growth project in Claude, or to CLAUDE.md:
Run this as a loop. Keep a file named trendsfast-loop.jsonl: one line per test, with date, test, evidence (the result ID), success_signal, check_after, outcome and verdict. Add lines; never rewrite one.
1. Before paying for a call, read the log. Do more of what won, drop what lost, and never repeat a test that lost without saying what changed. Fill in every test whose check_after has passed before you start a new one.
2. Pick one test from the evidence: one change, one place, one success signal I can measure, and a date to check it. If the evidence does not support a test, say so instead of inventing one.
3. To measure a video I posted, run trendsfast_video_outlier on it (5 credits, only when it is found): it scores the post against my own median. For anything else, ask me for the number from my analytics. Never guess one.
4. Write the verdict as WON, LOST or UNCLEAR. One post is not a pattern: call something a winner only when the log shows it twice.Run it every week
The loop works when you ask for it on a Monday, and it works unattended from anything that can run on a schedule: a scheduled Claude Code routine, cron with the TrendsFast CLI, or the n8n node. Set a credit cap on every paid call, so a scheduled agent cannot overrun: the server never spends past a call’s max_credits.
One Customers call (10 credits) and one outlier check (5 credits) come to 15 credits a week, so the 100 free credits cover 6 weeks of the loop.
What a log looks like after three weeks
Illustrative, not real output: for a scheduling tool for dentists, three lines might read like this.
- Week 1, WON. A first-person post about last-minute cancellations, built from a problem in four threads. The founder’s analytics showed 11 signups within the week.
- Week 2, LOST. A short video with a statistic as its hook. The outlier check put it at 0.6× the account’s median.
- Week 3, UNCLEAR. A second cancellations post, in a different community. Too few readers to say.
On Monday of week 4 the agent reads those lines first. It proposes a third cancellations post, drops statistic hooks, and says why, instead of starting from nothing.
What improves, and what does not
- Your agent improves, from your log. The log is yours. It stays with your agent, not on our servers, and TrendsFast does not learn from it. There is no endpoint that receives your results.
- The index improves by accumulating. The engine compounds on its own too: each night every topic it tracks gains another day of comparable history, and each product call adds what it collected to the shared index. That history began in late October 2026, so it is weeks deep, not years.
- The measurement has edges. The outlier check compares views on one TikTok, Instagram or YouTube video with that account’s recent posts. It says nothing about signups, and a video it cannot find costs nothing and scores nothing.
- A small log is noise. One post is not a pattern, which is why the instructions ask for a winner to show up twice before it counts.
- None of this predicts a result. The loop makes your next test better informed. It does not promise that a post will perform.
We run the same loop on TrendsFast itself: a daily routine reads the five products and a Sunday routine scores the week’s experiments and rewrites the backlog. We have no results from it to publish yet.
When a loop is not worth it
If you post less than once a week, or cannot see any number after you post, the log has nothing to learn from and a single well-researched post is the better use of your time. The same goes for a launch that happens once: read the market, post, and move on. The loop pays off when the same kind of decision comes back every week.
Ready to start the loop on your own market?
Run the free trend analysis on your website: it reads your homepage, shows what it understood about your niche and matches it against evidence already collected. No account needed. Then start for $0 to call the products yourself.