Lesson 1161 of 1455
Giving Your AI Agent a Memory File It Can Read and Write
A simple `memory.md` the agent can update lets it remember across runs without a database.
Builders · Agentic AI · ~4 min read
The big idea
Agents forget everything between runs by default. The cheapest fix is a single file the agent can read and append to — no vector DB, no infrastructure, just a Markdown scratchpad.
Some examples
- Claude with a memory.md tool remembers your name on the third session even though it's a stateless API.
- An agent appends 'user prefers dark mode' to its memory after you say so once.
- ChatGPT given a memory file recalls last week's project context when you start a new chat.
- A coding agent writes 'project uses pnpm not npm' to memory and stops suggesting npm commands.
Try it!
Add a readMemory and appendMemory tool to any agent. Tell it to remember three things across two sessions.
Key terms in this lesson
Practice this safely
Try this with a school, hobby, or family example where the stakes are low. Use the AI output as a draft you can question, not as the final answer.
- 1Ask AI to explain memory in plain language, then underline anything that sounds uncertain or too broad.
- 2Give it one detail from "Giving Your AI Agent a Memory File It Can Read and Write" and ask for two possible next steps plus one reason each step might be wrong.
- 3Check persistence against a trusted source, teacher, adult, expert, or original document before you use it.
End-of-lesson quiz
Check what stuck
8 questions · Score saves to your progress.
Lesson help
Questions are best handled with a grown-up here.
For this age range, Tendril keeps freeform AI chat paused until parent/guardian consent and child-safe moderation are fully verified. Use the quiz, notes, and related lessons below, or ask a parent, guardian, teacher, or librarian to work through the question with you.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Builders · 7 min
Short-Term vs Long-Term Memory for Agents
Know which facts the agent should remember within a run vs across runs.
Creators · 11 min
Personal Study Agent
Build an AI study agent that tracks what you've learned, plans your week, and adapts when you fall behind. Beyond chatbot prompting, into actual agentic study.
Adults & Professionals · 11 min
AI agents and memory eviction policies
Decide what an agent forgets so context windows stay useful.
