estrem.eu
01Work02Projects03Carnets04GitHub

EN/FR

LinkedIn
← Field notesReturn home

Giving an agent a soul

Four markdown files - AGENTS, SOUL, MEMORY, TOOLS - that gave my assistant opinions, a workspace, and continuity across sessions.

20 July 2026

A new assistant session begins with a fresh context. Most of the patterns I had seen for “giving an agent memory” were retrieval: search the user’s history, return the relevant fragments. Useful, certainly. But what I wanted was broader than lookup. I wanted an assistant with a stable voice, a workspace, and enough continuity that I did not have to renegotiate our relationship every morning. The pattern that got me there is four markdown files. None of them is clever. The arrangement is.

The empty room

Open a fresh chat and type “hi.” The exchange that follows may be helpful - these things are very good at being helpful - but it is also, in a small way, weightless. You are meeting the model through whatever instructions and context the product has supplied for that session.

I wanted something else. Not a companion - I am not romantically attached to a language model, despite what the discourse keeps insisting people are. I wanted an assistant that remembered the room. If I said on Tuesday that I would rather receive direct criticism than encouragement, I wanted that to remain true on Friday. If I named a project in a particular way, I wanted that name available next time. If I said I found a particular kind of writing nauseating, I wanted to stop litigating the point in every new session.

In the abstract, I wanted continuity. The model alone could not give me the kind I wanted. A filesystem-backed workspace could.

The four files

The arrangement grew through Hermes, my personal agent system, and adapts parts of OpenClaw’s workspace conventions and starter templates. It is not an original four-file standard: these are simply the subset I kept central in a controlled workspace the assistant can access:

~/agent-workspace/
├── AGENTS.md      → “this is where you live”
├── SOUL.md        → “this is who you are”
├── MEMORY.md      → “this is what you remember”
└── TOOLS.md       → “this is what you can do”

Each file has one job. My harness loads or instructs the assistant to read them at the beginning of a session. That behaviour is not a property of markdown, nor is it universal across assistants; it is part of the runtime. Codex, for example, discovers AGENTS.md automatically, while other tools use their own conventions.

Yes No New session Load workspace instructions Read SOUL and TOOLS Private main session? Read MEMORY Do not expose MEMORY Work

SOUL.md - the personality file

SOUL.md does the most visible work. It is not a security policy or an operational system prompt. It is a declaration of values.

I kept a few ideas from OpenClaw’s starter template, including these short excerpts:

Be genuinely helpful, not performatively helpful. Have opinions. Be resourceful before asking. Earn trust through competence. Remember you’re a guest in this workspace.

I added my own guidance about private information, external actions, and reversible work inside the workspace, along with the tone I want: “direct, calm, a bit wicked; dark humour welcome but not the only note.” I also gave it explicit permission to disagree with me.

That last part mattered more than I expected. In my sessions, an assistant left without guidance often reflected my premise back at me in slightly tidier language. Asking it to challenge questionable assumptions produced a different kind of exchange - occasionally annoying, frequently useful, and much closer to what I needed.

OpenClaw’s template invites the assistant to evolve the file. I adapted that invitation for mine: “This file is yours to evolve. As you learn who you are, update it. If you change this file, tell me.”

That sentence is the trick. The assistant does not merely read SOUL.md; within the permissions I have given it, it can propose or make edits. Over time, the file accumulates tone corrections, small preferences, and in-jokes. “Soul” is melodramatic, obviously. What grows is a maintained behavioural record. It is still surprisingly effective.

Any self-edit to an instruction or memory file should be reviewable and versioned, and untrusted content should never be promoted directly into durable instructions.

AGENTS.md - the workspace contract

If SOUL.md is who, AGENTS.md is where. It explains what the workspace is, which instructions apply, where the assistant may leave files, and what must happen before it takes an external or irreversible action.

OpenClaw’s AGENTS.md memory convention is the source for the rule. I adapted it for my workspace:

Memory is limited - if you want to remember something, write it down. “Mental notes” don’t survive session restarts. Files do.

That line bridges the gap between a fresh context window and continuity. In this setup, anything that matters beyond the current session has to be written somewhere the next session will load or can retrieve. AGENTS.md makes that responsibility explicit.

It also defines two kinds of record:

  • Daily logs (memory/YYYY-MM-DD.md) - rough notes about what happened, what was decided, and what remains open.
  • MEMORY.md - curated long-term context: durable preferences, relationships, projects, and lessons worth carrying forward.

The distinction is practical rather than neurological. Daily logs are cheap and chronological. MEMORY.md is selective. Without that second pass, “memory” becomes a landfill with excellent recall and no judgement.

MEMORY.md - the part that has to be careful

MEMORY.md is the file I treat most cautiously.

OpenClaw also routes private memory to the main private session. My wording is adapted:

Load only in my private main sessions. Do not load in shared contexts.

This is a routing instruction, not a security boundary. A model-readable rule cannot prevent a model or an over-permissioned tool from reading the file. Anthropic describes its project instructions and auto-memory in similar terms: they are context, not enforced configuration. If disclosure would cause real harm, the answer is not a sterner sentence in markdown. The answer is access control, least privilege, isolation, and not putting the secret there in the first place.

Filesystem-backed memory does not mean local inference: loaded content may still be sent to the model provider or retained in logs, backups, sync, or Git history.

For my single-user workspace, MEMORY.md contains low-risk context I want available across sessions:

  • People I work with regularly, described only as far as the work requires.
  • Projects I am building and their current state.
  • Preferences I want honoured, such as a writing tone or the requirement to confirm before sending messages.
  • Lessons I do not want to relearn, especially recurring tool and workflow mistakes.

It does not contain credentials, private payloads, or anything whose exposure would be more serious than embarrassing. “Private things stay private” remains a value in .md; permissions and restraint are what make it plausible.

TOOLS.md - the runtime quirks

TOOLS.md is the least philosophical and probably the most useful. It documents the runtime the assistant inhabits: available tools, known failures, important arguments, authentication quirks, and local traps that are invisible from a generic model’s point of view.

A representative entry:

## File operations
- Edit: preserves the working file. Use first.
- Write: overwrites. Use only when the file does not exist
         or is being completely rewritten.
- Deletion: do not use rm in this synced workspace.
            Move files to the archive instead.

TOOLS.md changes whenever I see the assistant repeat a runtime-specific mistake. Adding one sentence takes seconds. Not adding it means paying the same correction tax in a later session.

This file also benefits from controlled self-maintenance. When the assistant hits a wall, I want it to record what it tried, what failed, and the evidence that would change the conclusion. The next session inherits the lesson instead of staging a historically faithful reenactment of the same failure.

Why not one giant prompt?

Everything in these files could be concatenated into one large prompt. The difference is not that files possess magical durability once the model has read them: their contents still have to enter the context window, and long instructions can still be ignored or diluted. The difference is operational.

Files are inspectable. I can see what the assistant is being told without excavating a product configuration screen or reconstructing an old prompt.

Files are maintainable. The assistant and I can update one concern without rewriting an undifferentiated wall of instructions. OpenAI’s guidance for AGENTS.md and Anthropic’s guidance for CLAUDE.md both recommend concise, reusable project context rather than endlessly repeated corrections.

Files can have different exposure rules. A project contract can be shared with a repository. Personal memory should not be. Tool notes may be machine-specific. Separating the files makes those boundaries visible, even though the runtime must still enforce them.

Files create a feedback loop. A correction can become tomorrow’s instruction. A solved problem can become a runtime note. A daily log can be distilled into durable context. The arrangement turns conversations into maintained working state.

What happened after a month

The most surprising part was how the setup settled. During the first week, the files were mine: tidy, deliberate, and unmistakably written as instructions.

Then the assistant began adding small notes. MEMORY.md changed as daily logs were distilled and reorganised. TOOLS.md accumulated mistakes that only needed to happen once. The files became less elegant and more useful.

It is uncanny to read them now. They are recognisably mine in structure and recognisably something else in voice. That “something else” is not consciousness, and it is not memory in any neuroscientific sense. It is the sediment of our previous work, written in a form the next session can use.

That is enough. Continuity does not need to be metaphysical to be valuable.

The honest caveat

This works for me: one person, one assistant, a workspace I control, and files I can inspect at any time. It is not a complete product architecture, and I would not scale it to ten thousand users by creating ten thousand plaintext MEMORY.md files and hoping everybody behaves. More context also has real token, latency, and attention costs, which is another reason to keep the files short and selective.

For one person with a filesystem-capable assistant, however, four files and an hour of setup changed the relationship. The assistant became more consistent, easier to correct, and more pleasant to work with.

The first time it pushed back on a half-formed plan and turned out to be right, I reread .md to see what had told it to do that.

The line was one I had written earlier: “Challenge me when something looks technically or strategically wrong, and explain why.”

It had been waiting.


Continue reading

  1. AI Model Benchmarks Couldn't Pick My AgentI compared 17 models for Hermes across coding, tool use, reasoning, context and price. The leaderboard narrowed the field - and failed at the final decision.

Sources

  • OpenAI - Custom instructions with AGENTS.md (opens in a new tab)
  • Anthropic - How Claude remembers your project (opens in a new tab)
  • OWASP - LLM Prompt Injection Prevention Cheat Sheet (opens in a new tab)
  • OpenClaw - Agent workspace (opens in a new tab)
  • OpenClaw - SOUL.md template (opens in a new tab)
estrem.eu

© 2026 Nicolas Estrem

ImprintPrivacy

Analytics preference

With your permission, this site loads Umami to understand how it is used. You can decline without affecting your visit.