New Tool Radar

AI Agents & Automation

How to Build Long-Term Agent Memory from a Notes File

Give an agent a notes file it reads and updates, so what it learns in one session is still there next week.

Schematic illustration with three step boxes: create the notes file, read it at the start, and update it at the end.

Long-term memory is not the conversation: it is a durable record the agent reads at the start of a session and updates at the end. A notes file is the simplest form: a plain text file with facts, preferences and decisions, kept where the agent can read it. The agent must read it before it acts and write to it before it stops, or the memory is only a file.

Before you start

A file the agent can read and write, and a list of the facts worth remembering across sessions.

Create the notes file with real facts

Start the file with facts that matter across sessions: the user’s name, the products they own, the decisions already made, and the things that went wrong before. Each fact gets one line and a date.

Keep it short: a notes file with a hundred lines will not be read. Ten to twenty lines of real facts beat a hundred lines of trivia.

Read it at the start of every session

Load the notes file into the agent’s context at the start of every session, before the first user message is answered. An agent that reads the file only when asked has no memory, it has a lookup tool.

Check the file is actually loaded: ask the agent for a fact that only the file holds, and see whether it answers without asking.

Update it at the end of every session

At the end of each session, have the agent write back what changed: new decisions, corrected facts, and things to remember next time. Remove facts that are no longer true.

Review the file weekly yourself: an agent that writes its own memory can also write its own mistakes into it.

Practice check: fictional Maple Corner agent, notes file, 3 sessions

The table below is fictional practice material, worked out by hand from the stated sessions. It is the expected result for the practice file, not a run of any agent.

Session Fact in file Agent uses it Verdict
1 Customer prefers email Emails the summary Pass
2 Order ORD-4821 refunded Does not re-refund Pass
3 Warranty is 2 years Answers 2 years Pass – remembers
3, no file read Warranty is 2 years Asks the customer Fail – forgot

In all three sessions the agent uses the file: it emails instead of calling, it does not re-refund, and it answers the warranty question from memory. Without reading the file, it has to ask.

Expected result. UNTESTED: the sessions in the practice table are worked out by hand, not measured by running an agent. Create your own notes file with ten real facts, load it at the start of each session, and test one fact that only the file holds.

Limits

  • A notes file the agent never reads is not memory: test the read, not just the file.
  • The agent can write mistakes into its own memory: review the file weekly yourself.

Sources

See all