In today’s newsletter:
[23 hours left] Thanksgiving SALE for Lifetime Accounts
RAG vs. MeMo RAG, clearly explained!
How LLM routing actually works in production
[23 hours left] Thanksgiving SALE for Lifetime Accounts
Only 24 hours remain for you to get lifetime access to Daily Dose of Data Science at 2x the yearly price instead of 3x.
Secure your Lifetime Access at a discount here →
It gives you lifetime access to our all-in-one hands-on blueprints designed specifically to succeed in AI Engineering roles:
Here’s what you’ll get:
The 13-part RL course, which teaches the core algorithms and how AI teams use RL today, so you can work on post-training instead of only calling models.
The 17-part Agentic systems course, plus a 6-part LangChain and LangGraph series, which teach you to design, build, and ship agents the way AI engineering teams do.
Our 18-part MLOps course, which teaches you to deploy, monitor, and update models, the work that separates an ML engineer from a notebook data scientist.
Our 14-part LLMOps course, which teaches you to evaluate, fine-tune, and serve LLMs, so you can own an LLM app after launch.
The full 9-part MCP course, which teaches you to connect agents to tools and data.
Our 21-part RAG course, which teaches you to build retrieval systems that are fast and accurate, and to diagnose them when they aren’t.
LLM fine-tuning techniques and implementations.
Our courses on graph neural networks, PySpark, model interpretability, model calibration, causal inference, and more.
Scaling ML models with implementations.
Building privacy-preserving ML systems.
Mathematical deep dives on core DS topics, clustering, etc.
From-scratch implementations of several core ML algorithms.
Building 100% reproducible ML projects.
50+ more existing industry-relevant topics.
You will get all 140+ existing resources plus every new weekly deep dive for life.
Secure your Lifetime Access at a discount here →
P.S. Our last sale was ~12 months ago. We don’t run such sales often, so you might not get such discounts again soon.
Join 100k+ people that we helped get promoted, get a better job, or start their own company →
P.P.S. If you are an existing monthly or yearly member and wish to upgrade to lifetime, please reply to this email.
RAG vs. MeMo RAG, clearly explained!
RAG is great, but it has a major problem:
It treats every chunk as an isolated piece of text. The retriever picks the chunks that look most similar to your question, and the LLM only sees what got picked.
That works when the answer sits in one place. But many real questions need facts from several documents, and the fact that connects them often looks nothing like the question.
So the retriever skips it, and the LLM answers with a missing link.
Memory as a Model (MeMo), a new paper from MIT and NUS, fixes this by learning those connections ahead of time. It trains the knowledge into a separate, smaller model instead of retrieving it at query time.
Here’s how it works:
↳ an LLM turns your documents into question-answer pairs, including cross-document ones where clues from several documents point to the same entity
↳ a small memory model is fine-tuned on those pairs without ever seeing the documents, so everything it knows lives in its weights
↳ at query time, your main LLM stays frozen. it splits the question into sub-questions, asks the memory model, and writes the final answer from its short replies

The links between documents are learned once during training, so nothing has to find every piece at query time.
And since the main LLM only gets short answers instead of raw chunks, irrelevant documents barely hurt it. It also works with closed models like Gemini, because the two models only exchange text.

On multi-hop and long-story benchmarks, it beat a strong graph-based RAG setup.
This isn’t a replacement for RAG though. Training the memory model takes real compute, and new data means retraining, so it fits knowledge that rarely changes.
The best setup combines the two. Stable, densely linked knowledge like legal archives or reference docs goes into the memory model, and fresh data stays in retrieval.
A memory model can hold stable, densely linked knowledge, but fresh data still stays in retrieval. Our 21-part RAG Systems course develops that retrieval stack from the first pipeline through preloading, agentic retrieval, and verification:
Part 1: Build the complete RAG workflow, including chunking, embeddings, retrieval, and reranking →
Part 3: Reduce RAG latency with faster retrieval and generation paths →
Part 5: Understand CLIP embeddings, multimodal prompting, and tool calling →
Part 6: Build a multimodal RAG system over real-world data →
Part 7: Use Graph RAG for relationships that ordinary chunk retrieval misses →
Part 10: Apply the first set of techniques for production RAG systems →
Part 11: Complete the production RAG techniques and implementation patterns →
Part 12: Reduce prefill latency by reusing KV caches without a shared prefix →
Part 13: Preload a corpus before queries arrive and examine the production constraints →
Part 14: Compress preloaded caches and measure where the approaches break →
Part 15: Implement Block-Attention, Cartridges, and production preloading →
Part 16: Build an agentic retrieval loop with BM25 and dense retrieval →
Part 17: Decide what a retrieval loop should clear, compact, and keep once the window fills →
Part 18: Decide whether you need a dedicated vector database, including operational costs that benchmarks miss →
Part 19: Measure how much recall approximate search gives up once ten million vectors no longer fit in memory →
Part 20: Show why retrieval quality falls after launch while operational metrics stay green →
Part 21: Verify every answer against its evidence at query time, as a classification problem →
👉 Over to you: Would you put stable reference knowledge in a memory model, and leave fresh data in retrieval?
How LLM routing actually works in production
A tricky LLM interview question:
Your agent runs everything on a frontier LLM, so you add a routing layer that sends several easy calls to a 15x cheaper LLM.
The router is working as expected, but the bill is still the same as before.
Where did the savings go?
On a high-level, model routing works as follows:
Add a classifier in front of the agent
Send easy prompts to the cheap model
Send hard ones to an expensive model
While this looks simple, under the hood, a lot more engineering must go into this layer before you can actually realize any savings.
And the reason is in how agents consume tokens.
A typical agent task is never one LLM call. Instead, one prompt fires several LLM calls in sequence, like planning, tool use, and analyzing results.
Each call sends the accumulated context back through the model, so the input grows every step.
To avoid redundantly processing the same tokens on every call, providers built prompt caching.
Essentially, the input a model has already seen costs about 90% less than fresh input.
The problem is that this cache is specific to a model.
So every time the router switches models mid-task, the accumulated warm cache gets thrown away, and the full context is re-billed at cold rates.
This means a cache-hot expensive model can still cost less than a cache-cold cheap model.
Production routers solve this by making the routing decision once per task instead of once per call.
The first call routes normally, and the chosen model gets pinned to a session ID. Every call after that goes to the same model, so the cache stays warm and the context stays coherent.
When the task changes, the pin resets, and routing starts fresh.
The savings don’t disappear, but rather they move one level up.
Each new task still gets routed by difficulty, so easy tasks land on a cheap model and hard ones on an expensive model.
The pin only stops switching inside a task, which is exactly where switching costs more than it saves.
This is called model affinity, and it’s the last layer of a 4-stage production routing layer that runs on every request.
A) Guardrail filter
The prompt goes through a safety check. Jailbreaks and unsafe inputs get caught before they reach the router, and every call is logged and traced from this point.
B) Router model
A small routing model reads the prompt, infers the domain and action of the request, and matches it against candidate models.
The model has to be tiny, because a routing decision that costs as much as the call it’s routing saves nothing.
C) Selection policy
A cost policy picks the winner from the candidates, preferring the cheapest or the fastest, depending on the config.
Prices are picked from pricing catalogs, so the choice adapts when providers reprice, and the runner-up stays on standby as the fallback if the winner fails.
D) Model affinity
After selection, the winning model gets pinned to the session ID. Every later call in the task goes to it, so the cache never resets and the context never splits.
To see this in practice, the exact pipeline is already implemented in Plano, an open-source proxy that runs locally between your agent and your model providers.
The config for all four layers is defined in one YAML config file, and swapping any of it never touches agent code.
The routing model in stage 2 uses Arch-Router, a 1.5B model available on HF. It’s trained on human preference data, i.e., what developers actually pick for each task type.
So routing reflects real-world preference instead of benchmark rank, and you define those preferences in plain English in the config.
It also implements an observability console with a per-request cost column, so you can see exactly which model answered each request and what it cost.
We put this exact pipeline in front of my Hermes agent, and the usage dropped 2x, without changing a line of agent code.
Here’s the full article we wrote →
Good day!











