← Latest papers
💻 computer science

MemFlow: Intent-Driven Memory Orchestration for Small Language Model Agents

MemFlow is a training-free framework that enhances Small Language Model agents in long-horizon tasks by externalizing memory planning into a structured, intent-driven routing system that dynamically selects specialized retrieval tiers and assembles compact evidence, thereby doubling accuracy over full-context baselines without relying on open-ended reasoning.

Original authors: Jiayi Chen, Yingcong Li, Guiling Wang

Published 2026-05-06
📖 5 min read🧠 Deep dive

Original authors: Jiayi Chen, Yingcong Li, Guiling Wang

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Problem: The "Overwhelmed Intern"

Imagine you have a very smart but tiny intern (a Small Language Model or SLM). This intern is great at answering questions, but they have a very short memory. If you give them a 100-page diary to read before answering a single question, they get overwhelmed, forget the beginning, and start making things up (hallucinating) just to fill the silence.

Current methods try to solve this in two ways:

  1. The "Dump Everything" approach: Shove the whole diary in front of the intern. The intern gets confused and misses the important details.
  2. The "Random Search" approach: Tell the intern to "go find the answer." The intern might grab the wrong page, read the wrong sentence, or get stuck in a loop trying to figure out what to do next.

The Solution: MemFlow (The "Traffic Control" System)

The authors created MemFlow, which acts like a highly organized traffic control tower for this tiny intern. Instead of letting the intern wander around the library of memories, MemFlow takes charge. It doesn't teach the intern new skills; it just organizes the work so the intern can do their best work with what they already know.

MemFlow works in four simple steps, like a relay race:

1. The Router (The Receptionist)

When a question comes in, the Router Agent (a smart receptionist) looks at it and asks: "What kind of question is this?"

  • Is it asking about your favorite pizza topping? (That's a Profile question).
  • Is it asking what happened on a specific Tuesday? (That's a Timeline question).
  • Is it asking for a summary of a whole year? (That's a Deep Reasoning question).

The Receptionist doesn't answer the question. They just hand it a specific ticket (an "intent tag") that tells the next person exactly how to handle it.

2. The Memory Agent (The Specialized Librarian)

Based on the ticket, the Memory Agent goes to the library and uses a specific strategy. It has three different "modes":

  • Tier 1 (The Profile): If the question is about your preferences, the librarian doesn't even search the library. They just pull out your "User Profile" card (which was pre-organized) and hand it over. No searching needed!
  • Tier 2 (The Targeted Search): If you ask for a specific fact, the librarian does a precise search, finds the exact paragraph, and brings it back.
  • Tier 3 (The Deep Dive): If the question is complex (like "What happened first, the trip to Paris or the trip to London?"), the librarian doesn't just bring back raw pages. They pre-process the evidence. They sort the dates, do the math, and write a short summary before showing it to the intern.

3. The Packer (The Suitcase Mover)

The librarian brings back a pile of papers. The Packer is like a pro at packing suitcases. They know the intern only has a small suitcase (a limited amount of memory space).

  • They throw away the fluff.
  • They keep the most important facts pinned to the top.
  • They compress the rest so everything fits perfectly into the small suitcase.
  • Result: The intern sees a tiny, perfect summary instead of a messy mountain of papers.

4. The Validator (The Quality Inspector)

Before the intern gives the final answer, the Validator checks it.

  • Inspector: "Did the intern actually find this in the papers, or did they make it up?"
  • If the answer is shaky, the Validator says, "Stop! Go back to the librarian and try a different search strategy."
  • If the answer is solid, it gets released.

Why This Works (The Results)

The paper tested this system on a tiny model (Qwen3-1.7B) against huge, expensive models.

  • Without MemFlow: The tiny model got about 29% of the answers right when given a long history.
  • With MemFlow: The same tiny model jumped to 52% accuracy.
  • Comparison: It performed better than other complex systems that let the model "think" for itself (which often leads to errors) and came surprisingly close to the performance of massive, expensive AI models, but using a fraction of the memory.

The Takeaway

The paper argues that the problem isn't that small models are "dumb." The problem is that we are asking them to do the wrong job (searching and organizing) instead of letting them do the right job (answering).

MemFlow is like hiring a team of specialized assistants to do the heavy lifting (sorting, searching, and packing) so the tiny intern can focus entirely on giving a good answer. It turns a chaotic, open-ended search into a structured, reliable assembly line.

Key Claim: You don't need to train the model or make it bigger. You just need to orchestrate how it uses its memory.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →