BLOGBuilding with agents

The memory layer: how AI agents remember what your agency knows

AI agent memory, explained: one shared record of what your agency knows that every agent reads first. What goes in it, what stays out, and how to start one.

A central block of lime squares linked by dotted lines to six smaller blocks around it

A memory layer, sometimes called agent memory, is one shared, written record of what your business knows: your clients, your decisions, how you do things and how you sound. Every AI agent reads it before it starts a job and adds to it when it finishes, and the whole team works from the same record.

When I talk to agency owners about how I run my businesses with agents, the question I get most is how the agents know what’s going on. This is the answer, and how to start one.

Why AI keeps forgetting

A model knows a great deal about the world and nothing about you. It doesn’t know your clients, what you agreed on last month’s call, or which client hates exclamation marks. Every job starts from zero.

Most people fix that by explaining the background again each time. That works for one person in one chat. It falls apart with a team, because everyone explains it differently, and it falls apart with agents, because nobody is there to explain.

The memory features inside ChatGPT and Claude don’t solve it either. They remember things about one person, inside one product. Your account manager’s assistant knows things your developer’s doesn’t, and none of it comes with you if you change tools.

A model knows a great deal about the world and nothing about you.

What a memory layer is

It’s the same idea you’d use for a new member of staff. You wouldn’t let them answer a client email on day one without telling them who the client is. A memory layer is that briefing, written down once, kept current, and handed to every agent at the start of every job.

In my businesses, every agent starts from what the business already knows. Whoever is working, person or agent, in whichever business, has the most up-to-date information.

It’s also been the hardest part to get right. My agents work overnight. If someone on the team changed something on a project at 9pm, the agents working on it overnight need to know, and whatever they find has to be waiting for the team in the morning. Without a shared memory, they don’t know.

What goes in it

Four kinds of knowledge:

  • Client history. Who they are, what I’ve built for them, what’s live, what’s coming, who the people are.
  • Decisions. What was agreed, when, and why. The why matters most, because it stops an agent undoing a decision it doesn’t understand.
  • How I do things. My standards, my processes, what “finished” means here. For developers, this is where your coding standards for agents live.
  • My voice. How I write. My voice file is built from years of real client emails, so a drafted reply sounds like me and not like a chatbot.
Four cards. Client history: who they are, what I've built for them, what's live, who the people are; for example, the main contact is now the marketing director and the relaunch is due in March. Decisions: what was agreed, when and why; for example, on 3 October the old checkout was kept because their payment contract runs to June. How I do things: standards, processes and what finished means; for example, every page passes the accessibility checks before it goes live. My voice: how I write, built from years of real client emails; for example, short sentences, no exclamation marks, never leverage.
The four things every agent needs to know before it starts. The examples are illustrative.

A useful test: if a good new starter would need to be told it, it belongs in the memory.

Promote, don’t pour

This is the bit most people get wrong. They pour everything in: every transcript, every document, every scrape. Then every agent has to read all of it, it costs a fortune in tokens, and the one fact that matters is buried on page forty.

I keep two tiers. Reference is everything I capture: call transcripts, emails, research, finished work. It’s kept, it’s searchable, and an agent can open it when it needs the detail. Memory is the short list of checked facts that every agent reads first. A fact only moves up when it matters across the business, and it always links back to where it came from.

A four-stage funnel. Sources: everything you capture, such as call transcripts, emails, research and scrapes, and finished work. Kept as reference: stored whole with dates, searchable and opened only when needed. Checked: agents propose a fact, a second model checks the source, and you approve. Promoted facts, in lime: who the client is, what was decided and why, how you work and sound, read by every agent first.
Most material stays as reference. Only checked facts reach the memory every agent reads.

Competitor research is a good example. Overnight, agents read a market’s news and competitors’ updates and save it all as reference. A second agent pulls out only what matters, say a competitor launching something close to what I build, and promotes that one line with a link to the source. When I ask about a competitor later, I get a short answer, and the detail is there if I want it.

Google Drive isn’t a memory layer

The mistake I see most is putting everything in Google Drive, SharePoint, Dropbox or Notion, connecting ChatGPT, Claude, Gemini or Copilot to it, and calling that the agency’s memory. It isn’t. It’s file storage with search on top.

The connections differ in the detail, but they share one pattern. When you ask a question, the AI searches the files your account can open, pulls back the ones that look relevant and reads them. Some assistants also remember things about you between chats, but that’s a memory of your conversations with one assistant, not a checked record of the business that every agent shares. Here’s where it falls short:

  • Search finds files, not facts. There are three versions of the proposal and two of the rate card. Search returns what matches your question. It can’t know which one you agreed with the client, because nobody ever recorded that.
  • It may not read what it finds. OpenAI’s own help page for the ChatGPT Google Drive app warns that finding a filename “does not confirm that ChatGPT retrieved the file’s contents”.
  • It may read text only. Claude’s Google Drive connector “extracts text content only. Images embedded in documents are not processed.” A site map pasted in as a screenshot may as well not be there. Check what yours can read.
  • Nothing decides what’s learned. Connectors can edit files, but nothing decides what an agent has learned or where it belongs. On Tuesday an agent learns the client hates the word “solutions”. Unless someone writes that into the right document, next week’s agent searching the same drive won’t know. In a memory layer, the work proposes that fact the moment it’s learned.
  • It surfaces your sharing mess. Copilot works from whatever each person already has access to, and Microsoft’s own set-up guide makes “remediate oversharing” step one. The same guide says Copilot gives accurate answers when your data is “well governed, current, and appropriately shared”. That describes almost no agency drive I’ve seen. A memory layer holds only what you chose to promote.
  • Every tool sees a different slice. Each connector searches in its own way, so ask ChatGPT and Copilot the same question and you can get two answers. A memory layer is one set of facts that every model reads.
  • The files aren’t the record. The checked memory can live anywhere, even in a Drive folder. What matters is that it’s a short, curated record you can take with you, not a pile of files that only one platform’s AI knows how to search.

None of that makes Drive useless. It’s good reference material, and a memory should link back to it. It just can’t be the memory.

Two columns. Files with AI pointed at them: thousands of files and nobody owns what's true, old and new versions disagree, search finds files but can't tell which version is true, stuck in Google or Microsoft. A memory layer, in lime: short facts each with a source and a date, one home for every fact, agents read it first and the work keeps it current, yours whichever model or platform you use.
Where the files live matters less than whether anyone has decided what's true.

That last point matters more than people think. When an agency asks me about moving from Microsoft 365 to Google, my answer is the same: the clean, checked memory shouldn’t live in either. Clean it up, ideally with AI doing the heavy lifting, and keep it somewhere you own, so it survives the next move too.

How it works day to day

Every agent reads first

Before an agent drafts a support reply, it reads that client’s history. Before one writes code, it reads the project’s standards. Before one drafts an email as me, it reads my voice file. Nothing starts cold.

The work updates it

I used to spend 10 to 20 minutes after a call copying the transcript into a chatbot and pulling out the actions. Now the call ends and the recording sets off an agent. The transcript is filed as reference, decisions become proposed facts, actions go to the task list, and another agent decides what goes on the project board and what’s a follow-up for me. All without me touching it.

Six steps from a client call to memory. The call ends and the recording is ready. An agent wakes because the recording triggers it. Notes filed: the transcript goes in the client's folder as reference. Facts proposed: decisions and changes become proposed facts. Checked: a second model checks the source and I approve. Everyone knows, in lime: every agent and person starts from it next time.
From a client call to memory, without anyone copying and pasting.

Nobody has to remember to update a wiki, which is why it stays current.

The team sees the same thing

The memory isn’t hidden inside the agents. The team works from the same record the agents use, so there is one version of what the business knows about each client, not one per person.

It sits outside the models

This is the part people miss. The memory is mine. The models are rented.

The best proof I have came when a new model arrived. I plugged it into the memory and opened with: “You’re coming in fresh. This is the first chat I’ve had with you. Tell me what you know.” It knew everything I’d built up over the past year with the previous model. None of it was in the new model. All of it came from the memory.

A chat. James: You're coming in fresh. This is the first chat I've had with you. Tell me what you know. What came back: everything I'd built up over the past year with my previous model. Below, in lime: None of it was in the new model. All of it came from the memory.
The fresh-model test. My question, word for word, and what came back.

If a better model arrives next month, I point it at the same memory and carry on. If one is switched off, the memory is still there. I’d never put what my business knows inside one AI company’s product.

A row of rented models: Claude, GPT, Gemini, Grok, Muse, and next month's model in outline, labelled swapped as better ones arrive. An arrow says every model reads the same memory first. Below, a large lime block labelled owned, stays put: your memory, with client history, decisions, how I do things and my voice.
Rent the models. Own the memory.

What I tried before I built my own

I didn’t start by building. In the first half of 2026 I read up on the memory tools out there, shortlisted the main ones and piloted the most promising. Some are brilliant at one thing. None of them did the whole job, and most wanted to hold the memory inside their own service.

Project What it is What I took from it
Karpathy’s LLM Wiki A pattern: an AI compiles your sources into a plain-text wiki, with a schema file and a regular tidy-up The foundation. Plain files, compiled rather than searched, and a lint pass so bad summaries don’t settle in
Obsidian A notes app over a folder of plain Markdown files Where the trusted memory lives. Readable by people and every model, and portable
Hindsight Self-hosted agent memory with a separate memory bank for each agent I ran a local pilot in June and dropped it in July, when it broke and nothing was using it
Mem0 A memory layer for agents, managed or open source On the watch list, not adopted. It overlapped with the plain files I already owned
Supermemory A memory API that pulls in your Gmail, Drive and more Studied it in June and chose Hindsight for my pilot instead. Too much platform and a cloud dependency for the core of my memory, so never adopted
Basic Memory Markdown-first memory that AI tools can read Shortlisted, never adopted. Plain Markdown files were already enough
Graphiti A knowledge graph that tracks when facts change Listed to check, never trialled
MemPalace A local memory server On the watch list, never ran it
Hermes Agent with local models Running small models on my own machine for cheap first drafts Tested in June, dropped in July. I chose quality over cheapness

The rest is mine, built from what went wrong along the way:

  • Staging, then trusted. Nothing goes straight into the memory every agent reads. It’s proposed first, with its source.
  • A second model checks it. Two models judge a proposed fact. If they disagree, a third breaks the tie. Anything sensitive gets an extra reviewer, and secrets, out-of-date sources or anything risky stop dead.
  • Git on the memory. Every change has a history and an undo. I added that after a false fact made it into my trusted notes and only a second model rereading them spotted it.
  • One memory across every model. Claude, Codex and Gemini all read the same files and propose changes the same way. Every promotion is recorded with which model made it.
  • Search sits behind the files, never in front of them. Search helps agents find the right note. The plain files decide what’s true.

In one clear-out this month, the checks settled 160 queued facts: 128 promoted and 32 rejected. Another 115 were held back for a closer look.

I’ve open-sourced the method as the Agent Memory Kit on GitHub. It has the staging and promotion rules, the second-model check with your own models plugged in, git on every promotion, a note router, copy-ready instructions for Claude, Codex, Gemini and Cursor, and a worked example you can run without any model calls.

Does it make a difference?

I tested it. I gave a brand-new agent the same 20 questions twice: once with nothing but the work in front of it, and once with the shared memory added.

Bar chart of a new agent answering the same 20 questions twice: 11 out of 20 without shared memory, 20 out of 20 with it.
Source: my own test. A new agent answering the same 20 questions, without and with shared memory.

Without the memory it got 11 right. With it, all 20. Same agent, same questions, and nine more right answers it had no way of knowing on its own. That gap is knowledge that lives in the business rather than in the work in front of the agent, which in an agency is most of it.

The rules that keep it trustworthy

A memory that’s wrong is worse than no memory, because agents act on it without asking. I learned that one the hard way. In July I rewrote a batch of trusted notes in one go, with no history behind them, and a false claim slipped in. Only a second model rereading the files caught it. Since then, every change has a history and an undo.

These are the rules I work to now:

  1. New facts are checked before they’re trusted. Agents propose. A second model checks the source, and I or someone on the team approves anything that matters.
  2. Everything says where it came from and when. A fact with no source and no date gets questioned.
  3. One home for each kind of knowledge. Client knowledge in one place, project documentation in another. Two copies of a fact means one of them is wrong.
  4. No secrets. No passwords, no keys. Those live in a secure store, and agents get their own logins.
  5. Nothing personal that isn’t needed. If an agent doesn’t need it to do the job, it doesn’t go in.
  6. People can correct it. If the team spots something wrong, they fix it, and every agent has the fix from then on.

How it differs from a wiki

Most agencies already have a wiki, a Google Drive or SharePoint full of folders, or a pile of Notion pages. That’s a start, and you can build on it. If your team lives in Notion or Drive, keep it and connect the memory to it, rather than moving everyone somewhere new. The storage isn’t the problem. The missing part is the process that decides what’s true and keeps it current.

The difference is who writes it and who reads it. A wiki is written by people when they find the time, which is why it’s always a year out of date. A memory layer is written by the work as it happens and read by agents every single time, so gaps and mistakes show up fast.

It’s also how you keep what your agency knows when people leave. Any agency owner knows how much walks out of the door in someone’s head.

How to start one

You don’t need special software to begin.

  1. Pick one client. A busy one, where the team keeps re-explaining things.
  2. Write one page. Who they are, what you do for them, what’s been decided, how they like things done, what to never do.
  3. Make it the first thing every agent reads. Whatever tool you use, the instruction is the same: read this before you start.
  4. Update it after every call. By hand at first. Then give that job to an agent.
  5. Add the next client. Then your standards. Then your voice.

If you’d rather start from working code, the Agent Memory Kit gives you the folders, the checks and the agent instructions, with a step-by-step walkthrough.

After a month you’ll have something no model can give you: an agent that already knows your client before it writes a word.

Where this fits

The memory layer is one piece. The others are finding the person who’ll lead it, agreeing the rules for client data, and building the first agents one job at a time. It’s the piece I’d set up early, because everything else gets better once it exists. It’s also the foundation of an agency OS: the bots change, the memory stays.

If you’d like help setting one up in your agency, that’s the work I do. See how I work, or send me a message and I’ll tell you where I’d start.

QUICK ANSWERS

Questions
people ask.

Is there an open-source memory layer for AI agents I can start from?

Yes. I've published the method I use as the Agent Memory Kit on GitHub (github.com/code23/agent-memory-kit), under the MIT licence. It includes staging and promotion rules, a second-model check that works with any model you plug in, optional git commits for every promotion, a note router, agent instructions for Claude, Codex, Gemini and Cursor, and a worked example that runs without model calls.

Which open-source AI memory tools are worth looking at?

Karpathy's LLM Wiki pattern is the best starting idea: plain Markdown files an AI compiles and tidies. Hindsight, Mem0, Supermemory, Basic Memory, Graphiti and MemPalace are all worth reading. I piloted some and studied the rest, then built my own around plain files, a second-model check and a full history of every change.

What is a memory layer in AI?

A memory layer is a shared record of what a business knows, kept outside any one AI tool, which every agent reads before it starts work and updates when it learns something. It usually holds client history, decisions, working methods and tone of voice.

How do AI agents remember things?

On their own, they don't. A model starts each job knowing nothing about your business. Agents appear to remember because they're given the right notes at the start of each job and write new ones at the end. The memory is the notes, not the model.

Is a memory layer the same as ChatGPT's or Claude's memory?

No. Those features remember things about one person inside one product. A memory layer is shared by the whole team and every agent, and it works with whichever model you use.

What is the difference between a memory layer and RAG?

RAG (retrieval-augmented generation) searches your documents when a question is asked and hands the most relevant passages to the model. A memory layer is a short, checked set of facts that every agent reads before it starts. Most good set-ups use both: search over the reference material, and a memory for the facts that matter.

Is Google Drive or SharePoint connected to ChatGPT, Claude or Copilot a memory layer?

Not by itself. Connecting ChatGPT, Claude, Gemini or Copilot to Google Drive or SharePoint lets the AI search your files when you ask. That is retrieval. Search can't tell which version you agreed with the client, connectors differ in what they can read, and nothing decides what an agent has learned or where it goes. Drive is good reference material. A memory layer is the short, checked set of facts that every agent reads first, wherever it's stored.

What should go in an agency's AI memory?

Who each client is and what you've done for them, what was decided and why, how your agency does things, and how you and your team write. Anything a good new starter would need to be told.

What should never go in agent memory?

Passwords, keys and personal or sensitive data that an agent doesn't need should never go in agent memory. Keep credentials in a secure store and give agents their own logins.

How do you keep agent memory up to date?

Let the work update it. After a call or a finished job, an agent proposes new facts with a link to the source, a second model checks them, and someone on the team approves anything that matters. Nobody has to remember to update a wiki.

Where should agent memory live?

Somewhere you own, outside any one AI product or office suite: plain, readable files or a small database with a history of every change. Then you can switch models or move from Microsoft to Google without losing what your business knows.

Is a memory layer the same as a knowledge base or wiki?

Not quite. A wiki is written by people when they find the time, and it goes out of date. A memory layer is updated by the work itself, after every call and every job, and agents read it every time.

What is an AI second brain?

An AI second brain is usually a personal set-up: one person's notes, connected so an AI can search them. A memory layer is the business version. It's shared by the whole team and every agent, and facts are checked before they're trusted.

MORE NOTES