> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylinger.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent memory

> Learn how an agent carries what it learns from one Room to the next, when its memory updates, and how much it can hold.

An agent in Linger works in many Rooms at once, and each Room is its own conversation. See [Agents, Rooms, and Contexts](https://docs.heylinger.com/concepts/agents-rooms-contexts.md). Without memory, what an agent learns in one Room stays there. A rule you set in your direct chat, such as which quotes need your sign-off, would be unknown in a team Room the next day.

**Agent memory** carries those lessons across Rooms. It belongs to one agent. The agent uses it in every Room it works in, and no other agent sees it.

Agent memory is separate from your [personal memory](https://docs.heylinger.com/knowledge/personal-memory.md). The wiki records the facts of your work for every agent. Agent memory records what one agent learned about working with you.

Agent memory is not a chat backup. It keeps lasting lessons: your preferences, proven procedures, decisions, facts about the environment, lessons from failures, and your corrections. It leaves out progress notes, generic advice, secrets, and guesses. This page explains how a lesson moves between Rooms, when memory updates, and how much it can hold.

![In a direct chat you say anything over \$40k needs your sign-off. After five runs across two Rooms, an extraction lifts that rule out as a candidate. After six idle hours, a consolidation writes it into MEMORY.md. A new conversation in the Acme rollout Room recalls it, and the agent marks the two quotes over \$40k for your sign-off.](https://mintcdn.com/lev9-doc/KNNIi6FHi6k9VH5z/images/feature-agent-memory.gif?s=6c37f31183c5a9e50ab3ab08e68b6555)

A rule from one Room shapes a reply in another.

## How does a lesson reach another Room?

A lesson moves between Rooms in three background steps. The agent never writes its memory during a chat.

1. **Extract.** Linger reads the new messages and tool calls in each of the agent's Rooms. Each Room yields a short session summary and candidate memories.
2. **Consolidate.** The candidates merge into one memory, organized by topic. Only the sections that change are edited. Duplicates and facts that a later conversation disproved are removed.
3. **Recall.** When the agent starts a conversation in any Room, its first message carries a short summary of the memory as a hidden note. The agent reads the full memory when it needs more.

The memory appears as a read-only `agent-memory/` folder in each workspace of the agent:

* `summary.md`: the short index that the note carries.
* `MEMORY.md`: the memory, organized by topic.
* `session_summaries/`: one summary per Room.

To see what an agent remembers, ask it to show you its `MEMORY.md`. The note never goes into the system prompt, so a memory update does not invalidate the prompt cache or restart the agent.

## When does memory update?

Memory updates on its own schedule, not the moment you speak. A lesson reaches other Rooms hours after you teach it.

| Step | Starts when |
| - | - |
| Extract | The agent finishes five successful runs since the last extraction. Runs in all its Rooms count together. |
| Consolidate | The agent has had no successful run for six hours, or Linger compacts one of its Room conversations. It also starts early when many candidates are waiting. |
| Recall | The agent starts a new conversation in a Room, or a conversation continues after Linger compacts it. |

Extraction waits for five runs because it shares the model with the conversations it reads. Consolidation reads the whole memory, so it waits until the agent is idle.

The schedule shapes what you see:

* **A new agent starts empty.** Its first memory appears after its fifth successful run and the consolidation that follows. Until then, it has no `agent-memory/` folder and no note.
* **A running conversation keeps its memory.** A conversation already under way gets new memory only after Linger compacts it, which happens to an idle Room conversation about every 12 hours. A new conversation gets the latest memory at once.
* **Only Room conversations count.** A Task's report to the agent is part of the Room, so it can enter memory. The Task's own steps and Document work do not, and their runs do not count toward extraction.
* **A restart resets the count.** When the Linger server restarts, the count of runs toward the next extraction starts again from zero.

A correction you make in chat follows the same path. In the Room where you make it, the agent uses it at once, because it prefers what you say now over what it remembers. Other Rooms get it after the next extraction and consolidation.

## How much can memory hold?

The size of memory follows the context window of the agent's model. An agent on a smaller model keeps a shorter memory.

* **Each step fits in half the window.** One extraction or consolidation uses at most half of the model's context window. The other half stays free for the Runtime's own prompt and the answer.
* **The memory takes at most half of that.** The rest of the step is left for the candidates being merged. When the memory outgrows its share, consolidation shortens or drops its least useful sections.
* **Long records are cut.** Extraction keeps only the beginning of a very long message or tool result, such as a file or page that a tool returned.
* **Session summaries cover recent Rooms.** The folder keeps summaries for the 30 Rooms with the most recent activity. An older Room's summary is dropped after its candidates are merged.

Memory keeps what fits, not everything.

## Keep learning

> [card] [Agents, Rooms, and Contexts](https://docs.heylinger.com/concepts/agents-rooms-contexts.md)
>
> See how one agent works in many Rooms at once.

> [card] [Personal memory](https://docs.heylinger.com/knowledge/personal-memory.md)
>
> See what Linger records about your work for every agent.

> [card] [Memory layers](https://docs.heylinger.com/concepts/memory-layers.md)
>
> See how agent memory and the wiki fit together.

> [card] [Task delegation](https://docs.heylinger.com/agents/task-delegation.md)
>
> Hand long work to background Tasks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.