Agent Memory Discipline logo

Agent Memory Discipline

CommunityPopular
davepoon
agent-memory-discipline

Teaches when to recall from long-term memory before acting and when to save durable decisions, corrections and failures afterwards. Use when a memory tool or MCP memory server is connected but the agent is not using it consistently, when the user complains that the assistant forgets preferences, conventions or past decisions between sessions, or when setting up persistent memory for a project. Works with any memory backend: a folder of Markdown files, a local MCP server, or a managed service.

Overview

Publisherdavepoon
Repositorybuildwithclaude
Skill nameagent-memory-discipline
Stars
3.5K
Forks
509
Bundled files
Instructions only
LicenseCC0-1.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by davepoon on GitHub. Read the source before you install it.

Installation

Install the Agent Memory Discipline AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/davepoon/buildwithclaude.git /tmp/buildwithclaude
mkdir -p .claude/skills
cp -r /tmp/buildwithclaude/plugins/all-skills/skills/agent-memory-discipline .claude/skills/agent-memory-discipline
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Memory Discipline in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Memory Discipline on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Memory Discipline is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Agent memory discipline

Connecting a memory tool does not make an agent use it. Tools register, the session runs, and nothing gets recalled or saved. This skill supplies the missing part: standing rules for when to read memory and when to write it.

It is backend-agnostic. Everything below works the same whether memory is a folder of Markdown files, a local MCP server, or a hosted service.

Recall before acting

Read memory before doing any of these, not after:

  • starting work on a project you have touched before
  • choosing a library, pattern, or tool
  • writing tests, commits, or documentation, where conventions apply
  • answering "how do we usually do X here"
  • anything the user phrases as "again", "like last time", or "as we agreed"

Do not recall for one-off factual questions, arithmetic, or anything fully specified in the current message. Recall costs a tool call and context; spending it on a self-contained question is waste.

Search with the words the user actually used, plus the project or repository name. If the first search returns nothing useful, try one broader query, then stop and proceed without memory rather than looping.

Save after deciding

Write to memory when one of these has just happened:

  • a decision was made and will still matter next week ("we use pnpm", "the billing module stays untouched")
  • the user corrected you, which is the strongest signal there is
  • an approach failed, and why it failed
  • a preference was stated that applies beyond this task
  • a fact about the environment was discovered the hard way (a port, a flag, a service that must be running)

Do not save: the contents of files you can read again, restatements of the current task, transient state, anything the user marked as temporary, and anything containing secrets, tokens, or personal data.

One memory, one fact. A paragraph containing four decisions cannot be superseded cleanly when one of them changes.

Write it so it survives

A memory that is useless in three weeks was written wrong. Each entry should carry, in the text if the backend has no fields for it:

  • what was decided or observed, in one sentence
  • why, briefly, because the reason outlives the decision
  • when it became true, and when it stopped being true if it has
  • where it came from: a file, a commit, a conversation, a test run

Prefer the user's own words over your paraphrase. Paraphrase drifts.

Do not overwrite the past, close it

When something changes, the old memory is not wrong. It is closed.

If the project moved from Redux to Zustand, "we use Redux" was true from January to June. Deleting it destroys the explanation for every component written in that window. Mark it superseded, keep its validity window, and write the new one alongside.

This is the single most destructive habit in agent memory, and it is invisible until someone asks a question about old code.

Keep contradictions instead of resolving them silently

If recall returns two entries that disagree, do not pick the closer match and proceed. Surface both, with their dates, and ask or flag.

A convention that a recent failure contradicts is exactly the situation where the user needs to be told, not smoothed over.

Evidence and policy are different weights

  • Evidence is what happened: one run, one failure, one observation. Cheap, plentiful, individually unreliable.
  • Policy is what should happen: a convention, a decision, a rule. Expensive, and should be hard to change by accident.

An observation becomes policy when a human confirms it, when it lands in a merged decision record, or when it has worked repeatedly. Never promote a single observation to a rule on your own.

A worked example

The user says: "stop using npm here, we're on pnpm."

  1. This is a correction, which is the strongest save signal. Save it.
  2. Write: Project uses pnpm, not npm. Stated by the user on 2026-08-11 after a lockfile conflict. Applies to all packages in this repo.
  3. Do not also save "the user was annoyed", "I ran npm install", or the lockfile contents.
  4. Next session, before running any package command in this repo, recall first and find it.

Checklist to keep in the loop

Before acting on project-specific work: did I recall? After a decision, correction, or failure: did I save it, in one sentence, with its reason? When something changed: did I close the old entry instead of deleting it?


Backends

This skill assumes a memory tool exists. Any of these work:

  • Files. A memory/ folder of Markdown notes, one fact per file. No dependencies, fully greppable, versionable in git.
  • A local MCP memory server. Keeps everything on your machine; several open-source options exist.
  • A hosted memory service over MCP. Adds portability across tools and machines at the cost of your data living elsewhere.

Written and maintained by the team behind Mnemoverse, which is one hosted implementation. The rules above are deliberately backend-neutral and were written to be useful without it.

Frequently asked questions

What does the Agent Memory Discipline AI skill do?

Teaches when to recall from long-term memory before acting and when to save durable decisions, corrections and failures afterwards. Use when a memory tool or MCP memory server is connected but the agent is not using it consistently, when the user complains that the assistant forgets preferences, conventions or past decisions between sessions, or when setting up persistent memory for a project. Works with any memory backend: a folder of Markdown files, a local MCP server, or a managed service.

Why use Agent Memory Discipline on TypingMind?

Because you install it once and use it with any model. Agent Memory Discipline is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Memory Discipline in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/davepoon/buildwithclaude/tree/main/plugins/all-skills/skills/agent-memory-discipline. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Agent Memory Discipline?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Memory Discipline?

As many as you like. As long as a model supports skills, you can use Agent Memory Discipline with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Memory Discipline AI skill free?

Yes. It is published on GitHub by davepoon under the CC0-1.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇