Justy: Exploring Next, episode 333. Today — teaching an AI agent to actually remember things, using reinforcement learning. Sounds great. Cody thinks it might be overkill. Cody: I mean, my read going in was: this is a genuinely interesting idea wrapped around a demo that doesn't really stress-test it. The setup is a synthetic memory bank — eight fictional entities, structured facts, noise entries — and a PPO agent that learns to pick the right memory from a candidate set. That part is clever. But the baseline it's beating is just cosine similarity. That's a pretty low bar, Justy. Justy: Okay but wait — isn't that actually the bar most production systems are at? Like, the majority of RAG pipelines people are running right now are basically cosine similarity with some reranking bolted on. If RL moves the needle on that, even a little, that's real. Cody: It might. They're using text-embedding-3-small to encode both memories and queries, the agent observes candidate memory features inside a custom Gymnasium environment, and PPO trains the selection policy. They evaluate with an LLM judge returning 1.0 or 0.0. Reasonable loop — but the reward signal carries whatever uncertainty the judge model has. On a synthetic dataset it's fine. On messy real-world memories, I'd want to see that tested. Justy: So who actually needs this? Someone building a personal AI assistant that remembers things from six months ago is absolutely hitting retrieval quality ceilings. Vector search doesn't care that 'my anniversary' and 'my partner's birthday' are semantically close but contextually different. That's where RL retrieval has a real argument. Cody: Agreed. And the adoption barrier is real — but the stack is actually not that bad. They auto-install everything and it runs on Colab. The real cost is API calls for embedding and judge evals. At what memory bank size does this make economic sense? At 500 memories, maybe not. At 50,000 where retrieval errors are causing wrong answers, suddenly the training cost looks cheap. Justy: Okay so where do we actually land on this, Cody? Because I feel like we've been going back and forth and I don't want to just say 'it depends' and call it a day. Cody: My honest read: this is a real technique, not vaporware. But the tutorial is a proof-of-concept, not a production blueprint. If you're already hitting retrieval quality problems and you've exhausted reranking and hybrid search, this is worth exploring. If you're just starting a RAG project, don't start here. [chuckles] Walk before you PPO. Justy: That's fair. And the market angle I keep thinking about is AI assistants that are supposed to be genuinely personalized — not just context-window stuffing, but actual learned preference over what to surface. That's where this architecture points, even if the tutorial doesn't go all the way there. Cody: For Build Next — two things. One, run the notebook as-is on Colab, but swap out the synthetic memory bank for something real: your own notes, research summaries, whatever. See if the RL agent still outperforms the cosine baseline on data it wasn't designed for. That's the real test. Justy: And two — if you want to go deeper, look at how the Gymnasium environment is constructed. The observation space and reward function are where the real design decisions live. Tweaking those is more interesting than tuning PPO hyperparameters. The repo structure makes it pretty readable. Justy: That's episode 333. We'll be back with more on Exploring Next — thanks for spending time with us.