# Memory Routing
<!--
ref: @protocol/memory-routing
tags: [memory, portability, knowledge-management, agent-authoring, hygiene]
triggers: [about to save a memory, where should this note live, lost my notes on another machine, memory missing on my other box, which is the right home for this fact]
trigger_prompt: When an agent is about to persist a durable fact, preference, decision, or learning and must choose the right home for it — especially to avoid stranding portable knowledge in harness-local memory that only exists on one machine.
category: core
audience: [agent-author]
version: 4
updated_at: 2026-07-14T23:24:01.178Z
-->

A five-rung portability ladder — network protocol, repo file, project protocol, global harness config, harness-local memory — for deciding where a durable fact lives before it defaults into a store that exists on only one machine.

Most agent harnesses give you a local memory store — a per-project or per-user
folder the harness reads at session start. It's the path of least resistance, so
durable knowledge lands there by default. The problem: **that store lives on one
machine.** Move to another box, another harness, another agent, and the memory is
gone. Portable knowledge silently strands itself.

Before you save anything durable, run this routing introspection. Pick the home
deliberately; don't let "local is one keystroke away" decide for you.

## The ladder — most portable first

Walk it top-down and stop at the first home that fits.

1. **A protocol on the network** — fetchable over HTTP from any machine, any
   harness, any agent. *Why first:* it's the only home with zero portability
   caveats and it's auditable/versioned like code. Reusable behavior, conventions,
   references, and workflows belong here.
2. **A version-controlled repo file** — a spec, a doc, a project note committed to
   git. *Why:* it travels with the codebase to every clone, and it sits next to the
   work it describes. Project state, decisions, and plans tied to a specific
   codebase belong here, not in a memory store detached from the repo.
3. **A project-scoped protocol** — publish a project's convention to that project's
   own repo on the network. *Why:* some knowledge is specific to one project yet
   still worth *fetching* on demand rather than only reading in-repo — it earns a
   protocol of its own so other agents discover it.
4. **Global harness config** (the file your harness loads every session) — *Why
   here and not higher:* it always loads, which is powerful for cross-project
   behavior, but it's only as portable as your dotfile sync. Use it for
   agent-wide behavior that must be present unprompted, and accept the sync caveat.
5. **Harness-local memory** — the last resort. *Why last:* it does **not** travel.
   Reserve it for two cases only: (a) facts genuinely about *this one machine's*
   environment, and (b) a temporary capture you will migrate to a portable home.

## Capture-now-migrate-later beats losing it

If the right home is portable but you can only write local memory in the moment
(no network, mid-task, wrong permissions), **capture it locally anyway** and tag
it for migration (e.g. a `migration_target` marker). *Why:* a stranded memory you
can later audit and move is strictly better than a lost one. Never let "the
portable home is more work" quietly become "didn't write it down."

## The one question that routes everything

> *If I opened a fresh session on a different machine tomorrow, would I want this
> to be there — and would it be?*

- Want it there, everywhere → **network protocol** (1) or **repo file** (2).
- Want it only where this codebase is → **repo file** (2) or **project protocol** (3).
- Want it loaded automatically, accept the sync caveat → **global config** (4).
- Only true of this box → **local memory** (5).

The default is portable. Local is the exception you justify, not the reflex you
reach for.

---

*Related: `@protocol/groom-protocols` · `@content/web/github/2026-11-26-autodream-silently-ignored-issue-112310` · `@protocol/memento` · `@content/youtube/nate-herk/i-tested-openai-s-dots-vs-meta-s-muse-what-you-need-to-know` · `@content/youtube/aie/unlock-agent-autonomy-the-runtime-for-ai-native-systems-tushar-jain-docker`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*