>_ dark-factoryGuides

How to give an AI assistant memory that lasts between sessions

An AI model does not remember you. Each session starts blank. Anything it seems to "remember" was handed back to it at the start of the conversation.

That is the whole trick. Memory is text that gets loaded before you type. So the question is where that text lives and who controls it.

ChatGPT and Claude both have a memory feature now, and it is useful. You manage it through their settings, and it lives in their account. This page shows the other way: memory as plain files in a folder on your computer. You can open them, edit them, back them up, and take them to a different model.

No database. No coding. You need an agent app that can read and write files. Plan for roughly 30 minutes the first time. That is an estimate. For comparison, the Level 1 kit install, where your agent does the setup from a zip, was timed at under 10 minutes on a fresh host.

What you need

A chat window in a browser will not work for this. It cannot open files on your computer. An agent app can.

Step 1: Make a workspace folder

Create a folder called assistant somewhere you will find it again. Open that folder in your agent app. Everything below happens inside it.

Step 2: Create the memory files

Ask your agent to do this. Paste:

Create a folder called memory. Inside it create:
- decisions.md  (a dated list of decisions I have made, newest first)
- projects.md   (one short section per active project: goal, state, next step)
- a folder called daily
Do not put anything in them yet except a one-line heading.

Three kinds of memory, three places:

The assistant I built uses the same three. They cover most of what you would otherwise re-explain every morning.

Step 3: Tell the agent when to read and write

Files do nothing until the agent is told to use them. That instruction goes in a file the app loads at the start of every session.

So one AGENTS.md covers both. Create it in the assistant folder with this in it:

# How to work with me

## At the start of every session
1. Read memory/decisions.md and memory/projects.md.
2. Read the two most recent files in memory/daily/.
3. Tell me in three lines where things stand. Then wait.

## During a session
- When I make a decision, add it to the top of memory/decisions.md
  with today's date.
- When a project's state changes, update its section in memory/projects.md.

## When I say "wrap up"
1. Write memory/daily/YYYY-MM-DD.md for today: what we did,
   what was decided, what is still open.
2. Confirm the file name you wrote.

## Rules
- Never delete a memory file. Ask first.
- If two notes disagree, tell me. Do not pick one silently.

Plain English is the right format. There is no special syntax.

Step 4: Use it for one real session

Do a piece of actual work. Make at least one decision out loud, like "we are sending the newsletter on Thursdays from now on." When you are done, type wrap up.

Open memory/daily/ yourself and read the note. If it is wrong, fix it by hand. It is your file.

Step 5: Test that it remembers

Close the session. Start a new one in the same folder. Do not explain anything. Ask:

What did I decide last session, and what is still open?

If it answers from the notes, you have persistent memory. If it does not, the usual causes are:

Keep it small

More memory is not better memory. Every line you load costs attention. Anthropic's own guidance is to keep an instruction file under about 200 lines, because longer files are followed less reliably.

Two habits keep it working:

What about built-in memory?

Claude Code also keeps its own notes, called auto memory. It is on by default. It saves things like your preferences and corrections to ~/.claude/projects/<project>/memory/, and loads the first 200 lines at the start of each session. Those are plain files too, and you can read them.

It is a good layer to have. It is not a replacement for the files above, because Claude decides what goes in it. Your decision log should be something you control.

The honest limit

This setup depends on the agent following instructions. Most of the time it does. Sometimes it forgets to write the daily note.

The fix is to stop relying on the model for that step. A hook is a small script the app runs for you at a fixed moment, like session start or session end, whether or not the model remembers. That is the next thing to add once the files are working.

When plain files stop being enough

Plain files carry you a long way. You will know you have outgrown them when the agent needs a note from four months ago and cannot find it by reading the two most recent files. The next step up is search across the folder, and after that a proper retrieval system. Do not start there. Start with three files and a wrap-up habit.

If you want the thinking behind this before you build anything, the free primer covers it in five short modules: AI Beyond the Chatbot. When you want the whole system built step by step, Level 1 is the full path.

New to agents entirely? Start with the free primer. Ready to build the assistant whose memory is yours? Level 1 builds the file-based system end to end, no coding required. Not sure it fits: the compare page covers what Dark Factory is not.

Level 1 is $79 one-time, covered by the 30-day Read Before You Build guarantee.