Concepts/Concept

L1/L2/L3 Layered Memory and Experience Recall

From the Dongfang Yiteng execution agent (case by Bo Liang)

L1/L2/L3 Layered Memory and Experience Recall

Definition

For an execution-type agent to keep working in enterprise-grade scenarios, the context of the current turn alone is not enough; it also needs a memory system that stores information of different lifespans and uses in separate places. Dongfang Yiteng splits memory into three layers. L1 is the current stream of consciousness — the minimal necessary set the model should see at this moment, the direct input to the current reasoning or reply. L2 is the milestone log, which records where work has reached and what was just completed, persisted in a database in structured form. L3 is lessons learned, produced when a task succeeds or fails by distilling and summarizing the narrative context at that time, stored in a vector store and indexed semantically through embeddings. Each layer governs one span of time: L1 is the immediate present, L2 is the trajectory of this task, and L3 is the experience accumulated across tasks.

How it works

The part of this layering most worth making clear is how L3 and L2 connect, which borrows the idea of memory paging from operating systems. L3 stores semantic summaries: small in size and easy to retrieve by semantics. But a summary leaves out detail, and when you actually need to review the concrete situation of some past experience, the summary alone is not enough. So the data structure of L3 keeps an id pointing to the original memory fact in L2: most of the time it waits in the vector store carrying only the lightweight summary, and when the original detail is needed, this id is used to recall the full fact from L2. This is exactly one concrete implementation of operating-system memory paging — what stays resident is the summary, and the original detail is loaded on demand.

What it avoids is two opposite kinds of waste. One is keeping all historical detail resident in the context, which once the chain grows long will exceed the prompt's capacity limit and drive up the cost of every step. The other is compressing experience into summaries to save context, which then loses the original facts needed for review. Paging-style access strikes a balance between the two: retrieval works only on lightweight summaries, and the original detail is read on demand by id.

You can see how L3 helps in Dongfang Yiteng's payroll-setup scenario. If a scenario has previously been found to be solvable with a certain skill, this round of reasoning can converge quickly on the strength of a similar past experience, which amounts to a check against a familiar task of the same kind. Conversely, if an interface call in some intermediate step has failed before, this task's planning can first call a health-check interface to confirm that API has recovered, and only then orchestrate the later execution, sparing a heavyweight scenario from running its prior tasks for nothing. There is also a discipline for putting this into practice: L3 recall is expensive, so do not recall it at every reasoning step; recall it only at the large reasoning entry points — the first reasoning step of a reasoning chain, the first reasoning step of ReAct, and when planning the execution of a task. These are the entry points that most need full reference information, and if the first step is done right under more complete information, the later steps are more likely to follow correctly.

When you need it

When your agent has to accumulate experience across tasks and you do not want historical detail to blow up the context of every step, you need to layer memory by lifespan and use, keeping lightweight summaries resident and recalling original detail on demand. Its summaries come from the continually distilled progress in anchor, ledger, collection, and the package actually injected into the model at each step is assembled by the memory envelope.


This is an ADPS blue-book concept. Back to Concepts or the pattern matrix.