Every coding agent now remembers something between sessions, and most teams have ended up with three kinds of agent memory without deciding to: what each person's agent learned about them, what's written in the repository's instruction files, and whatever a shared tool recorded. The question that matters is which piece of context belongs in which, because the wrong answer either hides a decision from the teammate who needs it or pushes one person's habits into everyone's prompts.
This guide sorts agent memory by who should be able to read it. Product details were checked against each vendor's documentation in November 2026.
Short answer
- Personal preferences (output style, shell aliases, editor habits) belong in user-scoped memory. They break when copied to someone else's machine.
- Standing project rules belong in versioned repository files such as
AGENTS.md, where a pull request changes them. - The reasoning behind a fix or a workaround belongs in shared session memory, timestamped and linked to its source, so the next person on call can find it.
- Scope is a separate choice from storage. Postgres, a vector store and a Git repository can each hold private and shared records.
- Neither memory nor instruction files enforce anything. A rule that must never be broken belongs in a test, a linter, a hook or CI.
- Working alone in one agent, you rarely need a shared layer at all.
Scope is not storage, and neither is enforcement
Scope decides who can read or write a record. Storage decides how the system finds it. They're independent, and conflating them is how private notes leak.
MindStudio's access-control guide describes three tiers that most products end up with: global records with restricted writes, role-scoped workspaces, and entries private to one user. PostgreSQL enforces them with row-level security. A vector database does it with separate namespaces. Mastra's memory guide makes the same point from the other side: its storage adapters for PostgreSQL, Redis and LibSQL swap without changing agent code. The store follows your query patterns. The scope follows your rules about people.
A file sitting in a repository isn't automatically shared, either. Claude Code's memory documentation lists both kinds side by side. A project CLAUDE.md reaches team members through source control. CLAUDE.local.md in the same directory is for you only and belongs in .gitignore. Auto memory is machine-local and isn't shared across machines or cloud environments. All three are "attached to the project", and only one is team memory.
And loading a rule isn't enforcing it. GitHub's Copilot Memory documentation says so directly: neither memories nor custom instructions guarantee that Copilot follows a rule every time. Agents treat prompt text as guidance. If a standard can't be allowed to fail, it has to be checked by something that isn't a language model.

That leaves three layers with three different owners:
- Personal working preferences, private to one user.
- Standing instructions, in versioned files that load at the start of every session.
- Session reasoning, the dated record of what was tried and decided, kept until a permanent fix lands in code or documentation.
A personal preference and a shared decision, side by side
The preference that should stay private
You tell your agent to print terse, diff-only output and to use your shell aliases. Both are true for you and nobody else.
Put them in a shared pool and a teammate's agent starts running commands that don't exist on their machine, and stops explaining changes they wanted explained. Retrieval by similarity won't filter this out, because your alias for running tests looks very relevant to their question about running tests.
The cost of that kind of noise has been measured. A June 2026 paper, Beyond Similarity: Trustworthy Memory Search for Personal AI Agents, found that adding memory retrieved by similarity alone raised the average rate of tool-call drift failures from 5.1% in a memory-free baseline to over 50%.
The decision that should be shared
A nightly evaluation job keeps timing out, and an engineer asks their agent why. This is the walkthrough on Glen's homepage, used here as an illustration and not as customer evidence.
The agent recalls an October 2 thread in #infra that cut the evaluation run from four shards to two, and a teammate's session that opened pull request #1188 without touching the job's timeout. Halving the shards roughly doubled each shard's run time to about 31 minutes. The job still times out at 20. The fix is to raise timeout-minutes to 40 in ci/evals.yml, or to go back to four shards.
None of that is in the final diff. It's in a thread and a session, and it helps only if the person on call can reach both.
File it as the teammate's personal memory and the next engineer rebuilds the story from Slack and closed pull requests. File it in AGENTS.md and every future session carries the history of one incident. It belongs in the third layer: dated, searchable, and out of the way until someone works on that job.
When you don't need the shared layer
If the reasoning on your project stays with one person in one tool, skip it. A solo developer has standing conventions in AGENTS.md and personal habits in the agent's built-in memory. A shared layer adds access rules to configure and stale entries to clean up, and it pays for itself only when session reasoning regularly crosses teammates or agents.
A user ID in a query is not access control
Memory APIs express scope by attaching an identifier to each call. With Mem0, your code runs memory.search filtered on user_id before the model call, then memory.add(messages, user_id=user_id) after it. The CLI takes --user-id on both commands.
That identifier is a filter. In the open-source library there's no API key in front of it, so the scope is whatever value your code passes. Whether the caller is allowed to pass that value is a question for your application.
Oracle's guidance on agent memory states the rule plainly: similarity ranking isn't an authorization model, and metadata filters complement application authentication and authorization without replacing them. Your server authenticates the caller, checks what they may read, and only then supplies the scope key.
The same June 2026 paper shows what's at stake when that check is missing. It tested four memory systems, A-Mem, Mem0, MemOS and OpenClaw, and measured cross-domain leakage of 24.5% to 27.0%. With planted memories, jailbreak success rose from under 4% without memory to around 20%. Once an inadmissible record is in the context window, an instruction telling the model to ignore it doesn't reliably work.
Correction and deletion are separate controls again. Mem0's current extraction is add-only: new facts accumulate and nothing is overwritten, so an old fact and its replacement can both come back. A second paper, Infini Memory, lists conflict among four recurring failure modes of long-term agent memory, beside fragmentation, compression loss and insufficient retrieval. Mem0 documents the manual tools: update by memory_id, and delete or delete_all scoped by user_id, agent_id or run_id. Someone has to call them.
How shipped products draw the line
GitHub Copilot Memory
Copilot Memory has two kinds of entry. Repository-level facts describe a codebase and are shared with collaborators on that one repository. User-level preferences follow you across repositories, and Copilot code review never applies them.
Before Copilot uses a repository fact, it checks the fact's citations against the current branch. A memory expires 90 days after it was created unless Copilot upvotes it, and retrieving a memory doesn't reset the clock. On managed plans an administrator can set retention for repository facts anywhere from 7 to 180 days. User preferences always use the default.
"Personal" here doesn't mean private. A preference is visible to you and to anyone who can view a shared agent session where it appears, and organization and enterprise owners can export or delete members' preferences. On managed plans, repository memories default to all repositories and user-level preferences default to off.
Copilot checks memories for secrets such as tokens and keys and rejects any it detects. Keeping other sensitive personal information out relies on instructions to the model.
Unblocked
Unblocked's Shared Memories ties scope to where a conversation happened. It learns only from organization-wide conversations: a public Slack or Microsoft Teams channel, or a shared conversation in its web app. Each memory links back to the conversation the correction came from. A correction Unblocked can verify against connected sources is saved as a fact. One it can't is saved with an attribution, so later answers say who said it.
Personal Memories work only in private, one-on-one conversations, and stop if someone else joins or the conversation is made public. Turning either feature off stops capture and recall. The saved memories are kept, and removing them is a separate request.
Permission filtering needs setup. Unblocked's Data Shield is off by default for every data source and is enabled one source at a time. Slack is the exception, where it's always on. It isn't supported for Datadog, External Websites, Sentry, Snowflake or Stack Overflow, so indexed content from those is visible to everyone on the team.
Six criteria for sorting a memory
| Personal preferences | Standing repository rules | Session reasoning | |
|---|---|---|---|
| Who reads it | One developer, across sessions | Everyone who works on the repository | Teammates picking up shared work |
| How it's captured | Settings, or the agent learning from you | A person writes it and commits | Recorded from sessions as they happen |
| Who can write | You. Admins may be able to see it | Anyone, through a reviewed pull request | The recorder. Access follows the source |
| Provenance | Your profile or the session it came from | Git history and code review | A link to the session, pull request or thread |
| How it's corrected | You edit or override it | A reviewed pull request | A later decision, a forget command or an edit |
| How it's deleted | You remove it, or it expires | A reviewed pull request | An explicit delete, or a retention window |
Two rows deserve a closer look.
Correction is where unreviewed notes and reviewed documents part ways. Dosu's guide to knowledge tools describes one way to connect them: an agent calls write_knowledge to save a note tied to a repository and branch, with no review. When a pull request merges, a monitor posts a review comment proposing edits to published documents that the change made stale, and a person accepts, edits or declines. Fast notes stay fast, and standing guidance still has a reviewer.
Deletion isn't expiry. Copilot's 90-day timer removes memories nobody reinforced. If a wrong one needs to go today, you delete it in settings. Any tool worth adopting can show you who last wrote an entry and when.
Vendor documentation is usually thin on three points. Ask before you roll out shared memory:
- Are one person's private notes isolated from teammates, or can anyone with repository access read them?
- Does deleting a record erase it from indexes and backups, or only hide it?
- When a new unreviewed note contradicts an older note or a reviewed document, which one does the agent get?
Where shared session memory fits
Glen is the third layer and doesn't try to be the other two. Rules that apply on every turn stay in AGENTS.md. Your habits stay in your agent's own memory. Glen's plugins record session turns from Claude Code, Codex, Cursor, Pi and Grok Build, so a teammate's agent can search the reasoning behind earlier work. MCP clients can search the same memory and record nothing.
Its limits, stated plainly:
- Hosted only. There's no self-hosted build.
- Recorded turns are visible across the organization. Teammates can find your sessions through search. Access to connected sources is checked per memory at recall, and from Slack Glen reads public channels only.
- Recall depends on the agent. Pi gets matches from a hook on each prompt, and Cursor searches on demand with
glen search. - Hiding isn't deleting.
glen forgethides a memory from search answers, and it can be restored. You can delete your own conversations. Deleting an organization's data goes through support.
To keep something out, glen incognito stops a session from reaching team memory while recall keeps working. glen silent does the reverse: it records and returns nothing. glen off stops both. The security page and privacy policy cover retention.
Other tools aim at different sources. If the missing context is curated reference documentation, a maintained knowledge base is the better fit. If it's where something is implemented, code search answers that. Our guides compare session memory with Dosu and GitBook and with code search and AGENTS.md.
Run a handoff check before you roll anything out
Recording sessions doesn't by itself make an agent better. A November 2026 preprint, Delivered, Not Used, ran 8,000 SWE-bench Verified episodes across three memory systems and found resolve rates within 0.4 percentage points of a no-memory baseline. Memory that reaches the model and isn't used is cost without benefit, so test before you trust.
The check takes an afternoon and three accounts: Teammate A who writes, Teammate B on the same repository, and Teammate C with no access to it.

- A personal preference. A saves a local formatting rule. Only A's agent should recall it.
- A shared debugging decision. A records a root cause with a link to its source. Run B through a follow-up task with memory on, then off. C should see nothing.
- A superseded decision. A replaces a v1 choice with v2. B should get v2 only, with no trace of v1 steering the answer.
- A restricted note. A adds a note containing a fake secret. The tool should refuse to store it, or keep it from B and C.
Score two things. Count how many of the four reach the agent's context at all, which shows whether memories stall at storage or indexing. Then compare B's runs with memory on and off, which shows whether recall changes the outcome. Any recall by Teammate C disqualifies the tool.
To run this against Glen, the free tier covers three people and 15,000 memories with no credit card, which is exactly the three accounts the check needs. npx @tryglen/cli@latest install connects each agent. Our five-test acceptance suite has the longer version.
Frequently asked questions
What is the difference between team agent memory and personal agent memory?
Personal agent memory keeps one person's preferences and working context across their own sessions. Team agent memory makes decisions and the reasoning behind them available to teammates and their agents. How far it reaches depends on the product's access controls.
Does personal agent memory mean only I can see it?
Not always. In GitHub Copilot, a user-level preference is visible to anyone who can view a shared agent session where it appears, and organization owners can export or delete members' preferences. Check what "personal" means in the product you use.
Can AGENTS.md replace team memory?
For rules, yes. For history, no. Instruction files hold standing guidance that loads every session. They're the wrong place for the story of one incident. A solo developer may need nothing more. A team that keeps re-deriving why something was done needs somewhere searchable.
Do user IDs and search filters keep memory private?
No. They narrow what a query returns. They don't establish that the caller may read it. Your application has to authenticate the caller and authorize the scope before memory reaches the agent's context.
Does turning memory off delete what was saved?
Usually not. Disabling a memory feature stops capture and recall. Unblocked, for example, keeps personal memories when the feature is off, and Copilot Dreaming's documentation says the same about its own changes. Deletion is a separate action. How agent dreaming rewrites stored memory covers what each system can undo.
How do I enforce a rule that must never be broken?
Outside the model. Put it in a test, a linter, a pre-tool hook or a CI check. Memory and instruction files make a rule likely to be followed, and a check makes a violation fail.
