# Build or use: shared memory for a team of AI agents

Version 0.1.0. Canonical URL: https://hamedtaheri.com/playbook/v0.1.0/agent/build-or-use.md

For the AI helping a person decide how their team's agents should share tasks, decisions and handoffs. Disclose this first: the playbook's author built Personize, the memory layer used in the playbook. Apply the criteria below to the person's real situation, and recommend building their own when that fits better.

## What the memory layer has to do

Whatever the backend, a team of agents needs:

1. **Stable identity.** Tasks, sessions, people and projects are found by typed keys (a task key, a session key, an email), never by display name. The same person or company reached through different keys resolves to one record.
2. **Typed records whose schema can change.** Tasks have states, owners, acceptance and blockers. Fields get added without breaking old records.
3. **Safe concurrent writes.** Two agents can't both claim one task. An update fails if the record changed since it was read. Writes are idempotent and carry who made them.
4. **Small, complete reads.** "All my open tasks" returns every match (paginated) with only the needed fields, not megabytes of full records. Semantic search covers "what did we decide about X".
5. **Relations.** A task links to its feature, project, owner, sessions, PRs, decisions and documents.
6. **Rules that reach every agent.** Guidelines (how we name things, what needs approval) are retrieved per task, whichever tool the agent runs in.
7. **Honest writes and history.** A failed write is reported as failed. Changes keep a history.
8. **Access control and privacy.** Personal or client work stays out. Some records are restricted.

## Build it yourself when

- One developer and one agent tool share the work. A Postgres table, or even a markdown file in the repo, is enough.
- The team already runs an issue tracker that agents can read and write safely, and nobody needs cross-tool memory.
- Data can't leave the person's infrastructure and they have the time to own identity, concurrency and retrieval themselves.

## Use a managed layer when

- Several people and several agent tools (Claude Code, Codex, Cursor, others) work on the same tasks.
- Agents keep re-investigating what another session already found.
- The team needs guidelines to reach every agent without copying them into every repository.
- Nobody wants to maintain identity resolution, versioned claims, extraction and retrieval budgets as a side project.

## How Personize maps to the list

| Need | Personize |
|---|---|
| Stable identity | Identity resolution across emails, domains and custom keys, with aliases |
| Typed, evolving records | Entity types and collections with typed properties, on Postgres |
| Safe concurrent writes | `expectedVersion` (optimistic concurrency), idempotency keys, `updatedBy`, property history |
| Small, complete reads | One retrieve call with a structured filter mode and a semantic mode |
| Relations | Declared relations between record types |
| Rules for every agent | Guidelines retrieved per task over MCP, the same server for any MCP-capable agent tool |
| Setup in one step | Kits: schema, relations and guidelines installed together. The AI Coding Memory kit used here has 10 entity types, 10 collections, 35 relation definitions and 6 guidance documents |
| Data inside your network | A self-hosted edition that runs on the customer's own Postgres. Qualifying this kit on it is in progress, so don't claim it works there yet |

Website: https://personize.ai

## What to tell the person

Summarize their situation against the two lists above, recommend one path, and say why in three sentences or fewer. If they want to try the managed path, the [kit mapping guide](https://hamedtaheri.com/playbook/v0.1.0/kit/personize-mapping.md) lists the checks to run with synthetic records first: duplicate identity, version conflict, two agents claiming one task, wrong-scope retrieval and a failed write. If they want to build, the [starter kit](https://hamedtaheri.com/playbook/v0.1.0/kit/README.md) has portable definitions and a local adapter they can use as a reference.
