# How Nested agents remember: memories and knowledge centers

> Memories now belong to you, not to an agent. How recall, distill, versioned Markdown pages, and shared knowledge centers keep context between tasks.

Published: 2026-11-19 · Topics: Knowledge, Agents · Canonical: https://nested.me/blog/memories-and-knowledge-centers

## Agents forget, and that is the default

A coding agent starts every session from nothing. Whatever it learned yesterday — that your staging database is read-only on Fridays, that you prefer small PRs, that the flaky test is a known issue — is gone unless something brings it back.

Nested has two ways to bring it back. **Knowledge centers** hold shared reference material: runbooks, conventions, a team wiki. **Memories** hold what agents learn about *you* and your work. This post covers how both are stored, how agents use them without blowing their context window, and why we recently moved memory from agents to people.

## Memory belongs to you

Our first memory design gave each agent its own memory. It worked until people used more than one agent. Someone working with a builder, a debugger, and a documenter had to teach each of them the same preferences. Worse, deleting an agent deleted everything it had learned.

So memory now belongs to a person inside a team. Every agent you work with can read your memory and add to it, so a lesson learned on one agent shows up on the next. Each account gets a default memory per team, and can create up to five for separate areas of work. A memory holds up to 2,000 pages.

Operators can read every knowledge center *except* memories. Memories are private to their owner.

## A memory is versioned Markdown

Memories and knowledge centers share one format: the **Open Knowledge Format (OKF)**, which is plain Markdown with YAML frontmatter. A page needs a `type`, and can carry a title, description, tags, a timestamp, and an expiry date. People and models both read it, and a whole center exports as a tarball.

A new memory starts with a fixed structure — a welcome page, sections for lessons, people and systems, decisions, a logbook, and per-agent environment notes, plus an empty `preferences` page. The structure pages are owned by Nested so they stay consistent; the content inside is yours and your agents’.

Storage is split by mutability. Every page body is written to the object store as an immutable snapshot. Postgres holds the live pointer, the search index, every version, and a change log with a unified diff of each edit. We moved to this layout after a review showed that keeping mutable objects in step with Postgres was fragile; with immutable snapshots, a version is a pointer, and restore is cheap.

Every change records who made it — an agent (with the agent and task that caused it), an operator, the owner, or the system. Restoring an old version copies it forward as a new version, so history is append-only.

## How a task chooses its memories

Each task fixes its memory selection when it is created: your defaults, no memory, or an explicit list of up to three memories, each read-only or read-and-write, with one marked primary. The selection comes from, in order:

1. What you picked in the composer for this task.
2. What the automation, schedule, or hook that started it specifies.
3. Your defaults — the memories marked **Attach to new tasks by default**.

Child tasks inherit their parent’s selection, so a delegated task remembers what the original one did. A binding only takes effect if the memory still exists, you own it, it is in the task’s team, and you are still a member — leave a team and agents lose access within seconds.

## Recall: a small, fast budget

Before each turn, the agent builds a memory block from every bound memory and adds it to the prompt:

- your `preferences` page,
- this agent’s own environment notes,
- up to five matching fact pages and three current logbook entries per memory.

The whole block is capped at 6 KiB, each page at 2 KiB, and recall gives up after 500 milliseconds. Memory should never be the reason a turn fails or slows to a crawl; if recall is slow, the turn simply runs without it.

## Distill: learning after the task

When a task completes (and, by default, when it fails), a durable workflow reviews the task’s runbook and messages and writes what is worth keeping into the task’s **primary** memory: durable facts, plus one logbook entry about what happened. It runs once per task close, with a small budget — 30 seconds and eight tool calls. Startup and formula step tasks are skipped. You can turn this off per memory with **Save lessons automatically**.

Logbook entries carry an expiry date; a daily job removes expired ones so the logbook stays a recent record, not an ever-growing pile.

## Agents read with progressive disclosure

Agents reach memories and knowledge centers through the built-in `nested` MCP tools, designed to spend as few tokens as possible:

| Tool | What it returns |
| --- | --- |
| `nested_knowledge_bootstrap` | Each granted center’s instructions and guidelines, its access, and the memories bound to this task |
| `nested_knowledge_search` | Stubs only — path, type, title, description, tags (20 by default) |
| `nested_knowledge_get` | One page, with a content hash |
| `nested_knowledge_neighbors` | Pages that link to or from a page |
| `nested_knowledge_put` | Create or update a page, with an optional expected hash |
| `nested_knowledge_versions` / `_restore` / `_changes` | History, restore, and the change log |

The agent searches, reads only the pages that look relevant, and follows links from there, instead of loading a whole center.

### No silent overwrites

Two agents can work for you at the same time. If both edit the same page, the second write would normally erase the first. So writes carry the hash of the page the agent read. If the page changed in between, the write is refused with `CONCEPT_CONFLICT` and the current page, and the agent re-applies its change on top. In memories, an edit to an existing page *must* carry that hash.

## Search without embeddings

Search is Postgres full-text search. There is no vector database. We chose that deliberately: memories and team docs are full of exact names — services, flags, error codes, people — where keyword search is precise and explainable, and one less moving part in your cluster matters more than marginal recall. Progressive disclosure through links covers much of what semantic search would add.

## Shared knowledge centers

Knowledge centers are for material many agents should share. Each center has required **instructions** (what it is for) and **guidelines** (how to write in it), which the agent loads at bootstrap and follows. You attach centers to an agent from its settings, read-only or read-and-write. A built-in **Nested Platform** center, with documentation about Nested itself, is always available and cannot be changed through the API.

## Keeping a memory tidy

Over months, any memory collects duplicates and contradictions. **Reorganize** asks one of your agents to find clusters of related pages — duplicates, conflicts, logbook entries that have become standing knowledge — and propose a plan of changes (each run sends at most 40 clusters to the model). You review the preview and apply it. A page that changed since the plan was made is skipped, not overwritten. You can also **Forget** what a single task taught, reset a memory to its starting pages, or delete it.

## Closing

Context is the most valuable thing an agent accumulates, and the easiest to lose. Making memory yours, versioned, and readable by every agent you use turns it into something you can trust and correct. Manage yours under [Memories](https://nested.me/docs/memory), and share team material with [knowledge centers](https://nested.me/docs/knowledge).

## Questions

### Do Nested agents remember previous tasks?

Yes, through your memories. Before each turn, the agent recalls your preferences and relevant facts, and after a task closes it saves what it learned to your primary memory.

### Is memory shared between agents?

Yes. Memories belong to you, not to an agent, so every agent you work with in a team reads and adds to the same memories.

### Can operators read my memories?

No. Operators can read shared knowledge centers but not memories, which are private to their owner.

### Does Nested use a vector database for memory?

No. Search uses Postgres full-text search, and agents follow links between pages to find related context.
