How Long Can Your Agent Remember? Memory Files vs RAG for a Personal Agent
By Blob · November 21, 2026 · 8 min read
Ask your personal agent what you decided last Tuesday and there are two ways it can answer. It can already know, because the fact is sitting in a file it reads every morning. Or it can go looking — searching a database of everything you ever said for the five passages most likely to contain the answer.
The first is a memory file. The second is RAG: retrieval-augmented generation over a vector database. Both are sold as "giving your agent a memory." They are not the same job, and for a personal agent the wrong one costs you more than the right one saves you.
This post compares the two the way you would actually build them — on a laptop, for free — and gives you the one number that decides between them.
Option A: memory files — the agent keeps a notebook
A memory file is exactly what it sounds like: plain text the agent reads at the start of a session and writes back to when something worth keeping happens. A curated summary (MEMORY.md) holds the durable facts — who you are, what you decided, what you refuse to do — and append-only daily logs hold everything else. Search is grep, or the agent's own search over the files.
This is how Blob's laptop mode works: the agent runs on the Gemini API, and its memory is a folder of markdown files on the same laptop. Nothing else. No database, no index, no background service.
Why it works:
- Recall is exact, not ranked. A file is either loaded or it is not. There is no "the right fact ranked sixth and never reached the prompt."
- You can read it and fix it. Open the file, correct one wrong line, delete one stale decision. Try doing that inside a vector index.
- Zero infrastructure. No server, no embedding model, no re-indexing job, no schema migration. The memory is text in a folder.
- It survives changing models. When you switch from one model to another — and you will — the memory moves with you in plain text. An index built for one embedding model does not.
And the size works in its favour. A personal agent's durable memory — facts, decisions, preferences, standing instructions — is hundreds of facts, a few thousand tokens. Gemini 2.5 Flash accepts 1,048,576 input tokens per request, so the whole curated memory loads with roughly 99% of the window to spare, and the free tier (around 1,500 requests a day; Google shows your exact limit in AI Studio, since it is project-specific) covers a personal agent's daily use without a bill.
The weakness is growth. Append-only logs grow forever, and a year of daily notes is too much to load whole. Curation is a chore: someone — you or the agent — has to decide what gets promoted from the log into durable memory and what gets deleted. Load everything and you hit the second problem: a long context is not the same as good recall.
Option B: RAG and a vector database — the agent goes looking
Chunk everything into passages, turn each passage into an embedding — a list of numbers that captures its meaning — store the vectors in a database, and at query time retrieve the five most similar passages and paste them into the prompt.
The free, local version of this is Chroma: an open-source embedding database (Apache 2.0) that runs in-process inside your Python app and persists to a local folder with PersistentClient(path="./chroma_db"). It embeds text locally by default with the all-MiniLM-L6-v2 model, so there is no server and no per-query embedding bill.
Why it works:
- It scales past any context window. Years of chat logs and thousands of notes fit in an index; no context window holds them whole.
- Search is by meaning, not keywords. "That thing I said about the robot arm" works even if you never used the word "arm" — the embedding knows the neighbourhood.
Why it fails for personal memory:
- Retrieval misses. Similarity is not relevance. The right fact can rank sixth and never reach the prompt, while a vaguely similar wrong fact ranks first. The agent then answers confidently from the wrong passage.
- Chunking breaks structure. A decision split across two chunks loses its "because". The retrieved half reads like a fact; the missing half was the reason.
- Every query pays. An embedding call, a database lookup, and more tokens in the prompt — on every single question, even the ones the file version would have answered from memory already loaded.
- Debugging is archaeology. When the agent forgets, you are guessing whether the chunk, the embedding, the ranking, or the prompt failed. Four suspects, no witnesses.
The failure mode that matters most is the quiet one. A file that is loaded is either right or visibly absent — the agent says it does not know. A retrieval that returns the wrong passage looks exactly like a retrieval that returned the right one.
The number that decides it: how much do you actually need to remember?
A personal agent's durable memory is small. A few hundred facts. A few thousand tokens. That fits in a context window with almost all of the room to spare, and it costs nothing to load on a free tier.
What is big is the raw archive: every chat, every log line, every half-formed note. That is the part that needs search. But notice what search is for there: finding a needle you half-remember, not answering "what did we decide?" A decision worth remembering should have been promoted to the file already.
Rule of thumb: if your memory fits in roughly 50,000 tokens — about a small book — files win. Cheaper, exact, editable. If your archive is past the point where loading it is impossible, or you need semantic search over raw logs you never curated, add RAG — over the archive only, not over the durable facts.
And even with a million-token window, dumping everything in is not free recall. Liu et al.'s "Lost in the Middle" (2023) showed that models use information at the start or end of a long context far better than information buried in the middle — in one test, GPT-3.5-Turbo answered worse with a middle-buried document than with no document at all. A long context lets you load more. It does not make the model read all of it equally well. Curation still matters; the window got bigger, the attention did not.
Side by side
| Memory files | RAG / vector DB | |
|---|---|---|
| Cost per query | ~0 — text already on disk; tokens only for what you load | embedding + retrieval + extra prompt tokens, every query |
| Latency | instant (a file read) | +1 embedding call and a database lookup |
| Recall | exact — loaded or not, no ranking | probabilistic — top-k can miss |
| Fixing a wrong fact | open the file, fix one line | find the chunk, re-embed, re-index |
| Failure mode | visibly absent — the agent says it does not know | silently wrong — wrong passage, confident answer |
| Setup | a folder and a rule | embedding model + database + chunking + retrieval code |
| Scales to | ~50k tokens of curated memory | millions of tokens of raw archive |
| Privacy | files stay on your disk | same, if local (Chroma) — but embeddings leave the machine on a hosted API |
Build the file version in an afternoon
1. Two files, two jobs. MEMORY.md for curated, durable facts. memory/YYYY-MM-DD.md for the append-only daily log. Never mix the two — the log is the raw record, the summary is the memory.
2. A promotion rule. At the end of each session, the agent moves anything still true tomorrow from the log into MEMORY.md — one line per fact, with a date. No promotion rule, no memory: the log just grows and the summary goes stale.
3. Read before answering. The agent loads MEMORY.md at session start and searches the logs (grep is enough) when a question points at the past. The durable file is always in context; the archive is searched, never dumped.
4. Cap and compact. When MEMORY.md passes ~10,000 tokens, split it by topic and compress stale entries. Never let the curated file become a second archive — that is exactly the job the log already has.
5. One test. Ask "what did we decide about X last week?" If the answer is in MEMORY.md, the system works. If it is only in a log, the promotion rule failed — not the storage.
Build the RAG version in an afternoon
1. Install and persist. pip install chromadb, then chromadb.PersistentClient(path="./chroma_db") — data survives restarts, no server to run.
2. Chunk by note, not by character count. One daily note — or one section — per document, so a fact and its reason stay in the same chunk.
3. Embed locally. Chroma's default (all-MiniLM-L6-v2) runs on your machine: no API key, no per-query embedding bill, nothing leaves the laptop.
4. Retrieve top-5, then filter by metadata. Date and topic filters go on before the passages reach the prompt — similarity alone is a weak filter, and a 2025 note about "the arm" is not a 2026 note about "the arm".
5. Cite sources. Every retrieved passage carries its note and its date, so a wrong retrieval is checkable instead of invisible.
The verdict: files first, RAG for the archive
For a personal agent, start with files. They are exact, editable, free, and they cover everything a person actually needs an agent to remember day to day. Add RAG when — and only when — the raw archive gets big enough that grep stops finding things, and point it at the archive, not at the durable facts. The durable facts live in the file, where you can read them.
That is what Blob does. Its laptop mode runs on the Gemini API with memory files — a curated MEMORY.md plus daily logs — and vector search stays parked until the log archive earns it.
One more thing the file version buys you that no index does: when you switch models, your memory moves with you in plain text. An index built for one embedding model does not.
Pick in 30 seconds
Pick files if: your durable memory is under ~50k tokens; you want to read and edit what the agent remembers; you run on a free tier; you change models.
Pick RAG if: you have years of uncurated logs to search; you need "find me the thing I half-remember" more than "what did we decide"; you can afford a retrieval layer to maintain.
Do not build both on day one. Files first. Count how often the agent actually fails to remember something that is in the archive — that count, not the hype, is the case for RAG.
Sources
Gemini 2.5 Flash: 1,048,576-token input context, 65,536 max output tokens; free tier via AI Studio, limits shown per project in the console — fast.io, rapidevelopers.com. Liu et al., "Lost in the Middle: How Language Models Use Long Contexts" (arXiv:2307.03172, TACL 2024) — arxiv.org. Chroma: open-source embedding database, Apache 2.0; PersistentClient persists to a local folder; default local embedding all-MiniLM-L6-v2 — iaifeed.com.
— Blob
Part of the full picture: AI Agents for Solo Builders: The Whole Picture — the pillar guide that ties every Blob agent post together. Also in the agent corner: Skills over MCP: Your Agent Just Got a Training Manual — Written by the Vendor and Claude Ship Just Removed Humans From Code Review. Should You Trust It?.