Instructions vs. Memory
Agents in Pinchy have two places to hold knowledge: Instructions and Memory. They look similar — both are Markdown, both shape future replies — but they serve different jobs. Putting knowledge in the wrong place is the most common reason agents feel forgetful, repetitive, or “drift” over time.
This page is the short version. Use it as a cheat sheet when you’re editing an agent.
The two stores
Section titled “The two stores”- Instructions — what the agent is and how it operates. Loaded at the start of every conversation. In Pinchy, this is the SOUL.md (Personality tab) plus AGENTS.md (Instructions tab).
- Memory — what the agent has learned across conversations. Stored in
MEMORY.mdand daily logs undermemory/YYYY-MM-DD.md. The agent writes there when it decides something is worth keeping, or when you tell it to “remember this.” Memory is a permission — see Understanding Agent Memory.
A useful mental model: Instructions are the job description you hand a new hire on day one. Memory is the notebook they fill in as they work.
The heuristic
Section titled “The heuristic”| Question | Where to put it |
|---|---|
| WHO is the agent? (persona, tone, language) | Instructions — SOUL.md |
| HOW does the agent behave? (rules, SOPs, tool order) | Instructions — AGENTS.md |
| Stable fact, relevant every session (product list, tax rates, IDs) | Memory — say “remember this” in chat |
| User preference learned from interaction | Memory — the agent usually saves this on its own; say “remember this” if it matters |
| One-off detail for a single conversation | Don’t persist — leave it in chat context |
| Large body of knowledge (manuals, policies, codebases) | Knowledge base — mount as a data directory and use a knowledge-base agent |
If you’re still not sure: ask yourself whether a brand-new conversation tomorrow would need this. If yes, persist it. If only this conversation needs it, don’t.
Promoting something you worked out together
Section titled “Promoting something you worked out together”The most common way knowledge lands in the wrong store isn’t carelessness — it’s success. You and the agent spend a conversation developing a good way of working: a scoring framework for leads, a checklist for closing a month, the order in which to reconcile things. It works, you want to keep it, and the agent files it in Memory. That’s the only store the agent can write, and it will keep choosing it.
A way of working belongs in Instructions instead. Three reasons, in order of how much they’ll cost you:
- Scheduled and background runs don’t load Memory. Cron jobs and delegated subagent runs start from a reduced set of files that excludes
MEMORY.md. A rule kept in Memory quietly stops applying the moment the same work runs on a schedule — and the agent won’t tell you, because from its side nothing failed. - A rule deserves review. Instructions are something a person wrote and can diff, correct, and roll back. Memory is prose the agent wrote about itself.
- On a shared agent, Memory is mixed and partly withheld. It accumulates from every member’s conversations and is deliberately held back in group chats, so a team’s working method is the last thing that should live there.
The agent can’t edit its own Instructions — that boundary is the point. So the handover is a two-step, and the agent will usually offer it:
- Ask it to draft the rule: “Write that up as an instruction I can paste.” It knows the working method in detail and turns it into a rule better than a summary from memory would.
- Paste the draft into Settings → Instructions for that agent and save.
From the next conversation on, the rule is there before the first word — no lookup, no reminder, and it reaches automations too.
Why the distinction matters
Section titled “Why the distinction matters”Memory and Instructions have different lifetimes and load rules:
- Memory survives compaction. When a conversation gets long, the agent runtime compacts the chat history into a summary — older messages disappear. Memory entries already written to
MEMORY.mdormemory/do not. Anything important enough to outlive a single thread belongs in Memory, not in the chat itself. - Memory is written as the agent learns — not salvaged at the last second. An agent with the Memory permission persists what it decides is worth keeping, or what you tell it to remember, through a governed write tool that keeps every save auditable. There is no automatic sweep and no last-moment flush before compaction, so don’t rely on one: if a detail matters beyond this thread, say so, and check that the agent confirms it saved.
- You can compact on demand. If a long conversation starts feeling sluggish or repetitive, use Compact conversation in the chat header’s actions menu (
⋯). It triggers the same summarization the runtime does automatically — your visible messages stay put, and it takes effect on your next message. Anything already in Memory is unaffected; for an unsaved detail that matters, ask the agent to remember it before you compact. - Subagent and cron sessions don’t load MEMORY.md. Background and delegated sessions intentionally skip Memory to stay focused on their task. If a piece of knowledge needs to be available to every session — including cron jobs and subagents — it belongs in Instructions, not Memory. See the OpenClaw memory docs for the underlying filter logic.
Examples
Section titled “Examples”Put in Instructions:
- “Always answer in English, even if the user writes in another language.”
- “When the user asks for a deploy, run
pnpm build, thendocker compose up -d, in that order.” - “You are the HR assistant for Acme Corp. Be warm and discreet.”
Let Memory hold:
- “Our quarterly board meeting is the first Friday of every quarter at 10:00 CET.”
- “Project IDs follow the format
PRJ-NNNN.” - “Clemens prefers shorter answers without bullet points.”
Don’t persist at all:
- “For this conversation only, pretend you’re reviewing a draft PR.”
- “Look at the file I just pasted and find the bug.” (the file is in the chat already)
Editing each store
Section titled “Editing each store”- Instructions — open the agent’s settings, then the Personality or Instructions tab.
- Memory — talk to the agent. Say “remember this: …” to add an entry, or “forget …” to have it drop the entry — rewriting the note, or removing the whole file when nothing in it still applies. Removal is permanent and there is no undo, so an agent asked to forget something will normally say what it is about to remove.
For more on how memory is scoped between personal and shared agents (and what that means for privacy), see Understanding Agent Memory.
Upstream references
Section titled “Upstream references”Pinchy runs on the OpenClaw runtime, which owns the underlying mechanics: