← Back to concept explainers

Concept Fable

Long-term memory

Conclusion first:Long-Term Memory is information stored outside the current context window that can be retrieved across sessions and tasks. It lets enterprise Agents remember customer preferences, historical commitments, domain facts, unfinished tasks, and long-term state. Long-term memory is not about permanently stuffing all chat records back into the prompt, but about building persistent storage, retrieval strategies, update rules, expiration mechanisms, permission controls, and source tracking, so that relevant memories enter the working context at the right time.

Long-Term Memory · Agent state

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

The post station that still remembers promises after the night

The old innkeeper had run the inn for thirty years and remembered which regulars liked river-view rooms, which merchant avoided spicy food, and which horse caravan was always late in winter. The new clerk only listened to the day's instructions and forgot as soon as guests crowded in.

The owner first had the clerks write down all the idle talk in a notebook. Within a few days the notebook was too thick to flip through: who praised the tea, who complained about the wind, who casually said he might come next month—all mixed together. The next reception was actually slower.

Once a regular guest came to stay while ill, and the clerk could not find his old note about avoiding medicinal wine, nearly serving the wrong soup. Only then did the shopkeeper layer memory: long-term preferences, important taboos, completed past matters, and possibly expired rumors, each stored separately.

Before each new piece of information was entered into the register, the clerk had to ask: will it still be used later, is it reliable, when does it expire, and is the guest willing to leave it? When using old records, he also had to see whether they still fit the present.

The new assistant then tried to record only big things, but he didn't know what counted as big. The merchant casually said 'don't rely on the stable,' and next stay it was forgotten; the horse caravan complained about winter delays, which seemed like idle talk but actually affected whether meals were kept. Record too much and it drowns; record too little and it's rude.

The old shopkeeper taught him to divide the notebook into columns: long-term preferences, important contraindications, recent unfinished matters, and expired remarks. Each time a guest left the shop, only content that would still affect future service was kept; at the next meeting it was brought out for verification, and old words were no longer treated as forever correct. The usefulness of memory lies not in its thickness, but in bringing back the right thing at the right moment.

Later, regular guests felt the inn was thoughtful, but did not feel spied on. The staff only recorded things that would affect service, and updated them when guests changed their habits. A good memory is not about never forgetting, but about knowing what should be kept and when to let it go. Later, regular guests felt the inn was thoughtful, but did not feel spied on. The staff only recorded things that would affect service, and updated them when guests changed their habits. A good memory is not about never forgetting, but about knowing what should be kept and when to let it go.

Afterward, the inn seemed to carry on the old innkeeper's legacy. Remember, it is not about piling everything into a box; it is about placing matters that will affect service in the future—by source, timeliness, and purpose—where they can be retrieved.

Reveal

This story is about: long-term memory

Long-Term Memory is information stored outside the current context window that can be retrieved across sessions and tasks. It lets enterprise Agents remember customer preferences, historical commitments, domain facts, unfinished tasks, and long-term state. Long-term memory is not about permanently stuffing all chat records back into the prompt, but about building persistent storage, retrieval strategies, update rules, expiration mechanisms, permission controls, and source tracking, so that relevant memories enter the working context at the right time.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Metaphor mapping

  • Can remember during the day: current context or short-term state
  • Cleared after the shift change at night: session end causes context loss
  • Knotted cuffs and blackboards: temporary, ungovernable memory patches
  • Long-term ledger: persistent long-term memory storage
  • Retrieve the relevant pages for the current task: retrieval-based memory injection
  • Source, update time, deletion conditions: long-term memory governance
  • Final insight: the core of long-term memory is cross-session continuity and controllable recall

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

memoryvector databaseretrievalknowledge baseuser profilecontext engineering
京ICP备2026014272号