Case studyAI agents, knowledge management20263 min read

A memory shared between agents, partitioned by role

Several agents rely on a shared graph memory, and none of them can reach another’s scope.

MC Studio, research and developmentAI · Project that integrates AI or trains teams to use itDemonstratorInternal project
Contents7

At a glance

In thirty seconds
  1. StakeAgents sharing a memory must not read what another scope entrusted to theirs, and a prompt instruction cannot prevent it.
  2. MechanismThe application checks each actor’s scope before any Cypher query, and the Memgraph database enforces distinct roles from initialisation.
  3. ProofThe public code of the session-ux branch: access rules, unit tests and end-to-end tests against a real Memgraph database.
  4. ImpactShared knowledge that does not leak from one scope to another: the starting condition for agents that remember.
  5. LimitsIsolation is per agent; per-client scopes and offensive tests remain to be done.
Client
MC Studio, research and development
My role
Designer and sole developer of the feature
Setting
Internal project
Team
Solo · 1 person
Technologies

The starting point

As soon as several agents work together, they need memory: what was decided, what was learned, what remains to be done. A shared memory immediately raises another question. If an agent works for a person, a team or a client, it must not be able to read what the others entrusted to theirs. Asking the model “not to look” is not enough.

What I built

On a fork of OpenClaw, an open-source agent project1, I added a graph memory hosted on Memgraph, run in a container. Each actor gets a scope: an agent reads and writes in its own, the operator has an administration scope. Before every query, the application checks that the requested scope is the actor’s own, and refuses otherwise.

OpenClaw is a third-party open-source project…

OpenClaw is a third-party open-source project. Only the partitioned memory feature of this branch is mine, developed alone in February 2026.

The database applies the same logic on its side: distinct roles for administration, agents and teams, created at initialisation with their own users. If a query slipped past the first check by mistake, it would hit the second. Agents and administrators each have a skill that describes how to use the memory.

What the evidence shows

The access rules are covered by unit tests: an agent reaches its own scope and is refused another’s. End-to-end tests run against a real Memgraph database, to check that the whole holds up outside mocks2. The code is public and can be read on the branch3.

Vitest unit tests on the access…

Vitest unit tests on the access rules; end-to-end tests launched by a dedicated script and configuration, against Memgraph in a container.

My presentation of this work also…

My presentation of this work also mentions audit logs and answers that cite their sources. I have not checked them in the branch yet, so I do not claim them here.

The access-rule module and its tests, side by side
The access rule and its tests, side by side: an excerpt of the branch’s public code, laid out for the screenshot.

What it changes

For an organisation that wants agents able to remember, this is the starting condition: shared knowledge that does not leak from one scope to another. The same logic, extended to clients or engagements, would keep an agent from using in one file what it learned in another. That is the direction I propose when an organisation wants agents that remember, without mixing files.

Limits

It is a personal demonstrator: it establishes the mechanism, with no external user, and I claim only what the code shows.

  • Extending it to per-client or per-engagement scopes is a direction, not a delivery.
  • Offensive security tests, prompt injection and cross-scope exfiltration attempts, are planned but not done yet.
  • It is a fork branch, not offered to the upstream project.

Share and reuse

The link, the plain text and visuals ready for LinkedIn.

Embed this card

Paste this code into a web page to show a card for this content.

<iframe src="https://mc-stud.io/embed/en/work/agent-memory-isolation" title="A memory shared between agents, partitioned by role" width="100%" height="360" style="border:0;border-radius:16px;max-width:640px" loading="lazy"></iframe>

Let’s talk about what AI could change for you

A 30-minute discovery call, by video and with no commitment, to talk about your project, your constraints and the best next step.

contact@mc-stud.io