Moodify had to listen
Turning Google's ReasoningBank into memory for a playlist agent.
Moodify is a small app I built that turns how you feel into a Spotify playlist. Four friends and I use it. You type something like “gym session, running on 4 hours of sleep”, it writes a brief, picks the songs and saves the playlist to your account. Afterwards you can rate it and write a review.
At first, Moodify had no memory of what you thought of its playlists. If a workout playlist was too slow, the next one could be too slow in exactly the same way.
I didn’t want to invent agent memory from scratch, so I built it on a published design: Google’s ReasoningBank. This post is about what I kept from the paper, what broke when I applied it to music, and the four feedback loops Moodify runs now.
०१What the paper does
ReasoningBank is memory for agents that do long, multi-step tasks, like browsing the web or fixing code. Most agents start every task from zero: they repeat yesterday’s mistakes and forget what worked. The paper’s answer is to write down short lessons after every task and read the relevant ones back before the next.
Three ideas carried straight over:
- Lessons, not logs. A memory item is three short fields: a title, a description of when it applies, and the content, the advice itself. A transcript of a run is long and hard to reuse. “Keep workout sections at energy 8 or more” isn’t.
- Failures count. The paper learns from “both successful and failed experiences”. A playlist that missed teaches as much as one that landed.
- At most three per run. A few sharp lessons beat a pile of vague ones.
०२Where the paper broke
a)Self-graded outcomes
The paper usually has no answer key, so it asks a model to grade its own run: “LLM-as-a-judge … without any ground-truth reference”. Moodify has something better, the listener’s review. But a review is free text in any shape (slang, typos, one word or a paragraph), and a model reading it can still put words in the listener’s mouth.
review "the workout part was way too slow, rest was great"
verdict partly
title Workout sections need more energy
content Keep workout sections at energy 8 or more from the first song.
kind pitfall, lasting · tags: workout, energy
evidence "the workout part was way too slow"
Each lesson also has a kind. Pitfalls and strategies are the paper’s failures and successes. Preferences are new: general taste like “too much Drake”, which outranks the taste Moodify reads from Spotify when the two disagree.
b)Append-only memory
The paper adds new items “with a simple addition operation”. Nothing is ever edited. That works for web tasks, where a strategy that worked stays true. People change their minds. If a listener once wrote “loves long intros” and later “skip the long intros, they bore me”, an append-only memory keeps both, and the next build gets two lessons that contradict each other.
A few rules keep it safe:
- Lessons about one playlist (“track 4 didn’t fit”) never reach memory. They only feed the Fix it button.
- At most 40 active lessons per listener. Past that, consolidation merges near-duplicates, and as a last resort the least-used lessons expire.
- If the consolidation call fails, every new lesson is simply added, so a grounded lesson is never lost.
c)Similarity-only recall
The paper recalls memory “using embedding-based similarity search”. With at most 40 lessons per listener, I started with plain tags, plus a word list so “gym session” finds a lesson tagged workout. Tags still missed “leg day”. When I added embeddings, they missed things too: “homework” never reached the focus lesson. And one similarity threshold either missed half the matches or let in up to ten wrong ones.
०३Four loops, four clocks
The paper describes one loop. Moodify now runs four, each on a different clock.
- Seconds: ask before building. When a prompt pulls against a lesson (“gym session, running on 4 hours of sleep” against “workout energy 8 or more”), Moodify asks one question and waits up to 20 seconds. The call that writes the brief spots the clash itself, so asking costs no extra LLM call. “From now on” retires the lesson. No answer keeps it, so a build never stalls. This is the first step of Meta’s PAHF loop, which the paper doesn’t have.
- Minutes to days: Fix it. The lessons about one playlist, plus the review itself, rebuild that playlist as version 2.
- Between playlists: the paper’s loop. Reviews become lessons, and later builds recall them.
- Months: upkeep. Every recall marks a lesson as used. Pitfalls and strategies nobody recalls for 180 days expire. Preferences never expire; they can only be superseded.
०४What it measured
Memory has a cost the paper doesn’t deal with: it changes the prompt, and a prompt that changes on every build can’t be reused from OpenAI’s prompt cache. So memory comes in two parts. A per-listener block (preferences, liked songs, playlists rated 8 or more) is rendered once and kept until new feedback arrives, and sits right after the fixed rules. Only the lessons recalled for this request change from build to build. My first layout cached 53% of input tokens; this one caches 98%.
Each of these phases shipped with a live check against the real model, next to the mocked tests.
| Check | Result |
|---|---|
| Builds with lessons vs without judged against 5 test reviews | 5 of 5 |
| Next gym brief after a “too slow” review energy, out of 10 | 8 → 9 |
| Input tokens cached second build, a minute later | 98% |
| Ask before building 6 prompts, 3 runs | 17 of 18 right |
| Recall by meaning 14 live requests | 12 found, 1 wrong |