Team memory · Setup

Set up team memory: a guide for your AI

Read this when the person asks you to set up team memory for their team, add a teammate, or check that a setup works. It covers the whole path in order: what the admin does once, what each developer does once, how to prove it works, and how to undo it. Two routes: the hosted AI Coding Memory kit on Personize (route A, what the author runs) and your own store built to the same contract (route B).

Version: AI Coding Memory kit 1.5.0, the copy shipped in this playbook. When the person's organization already has a newer version installed, its own AI Coding Memory Setup Guide guideline wins over this page.

Before you start

Agree on a plan with the person and write it down in the chat before you change anything:

QuestionWhy it matters
Which organization holds the team's memory, and who is its admin?Only an admin can install the kit and create records for others
Which repositories are in scope?Each one gets a project record; sessions in other folders are not recorded
Who is on the team, and which assistants do they use?Each person needs a Person record before their first session; Claude Code gets a hook, other tools an instructions block
Which assistant tools besides Claude Code?Codex, Cursor and others have no hook; the assistant writes the session record itself
What is off limits?Customer data, personal matters, and any folder that must never reach shared memory

Rules for the whole setup:

  1. Ask before every install, file edit or settings change. Show the plan; wait for a yes.
  2. Never ask for, print or store an API key in chat, a document, a repository or memory. Keys go into environment variables or the tool's private config.
  3. Each person uses their own key. Never share one key across people.
  4. If any call fails, say "NOT saved" or "could not check team memory". Never report a step as done that you did not verify.

Route A: the hosted kit on Personize

Admin, once per organization

  1. Organization. Use the organization the person names. If they have none, they create an account and organization at personize.ai first; you cannot do this for them.

  2. Install the kit. Call kits_list. If ai-coding-memory is listed, summarize what it adds (below), then call kits_install with kitId "ai-coding-memory" after the person approves. If it is not listed (it is in a pilot and not yet in the public catalog), use this playbook's copy, kit/ai-coding-memory.kit.json. Summarize it the same way, get approval, then upload it with the organization's API key:

    curl -s https://hamedtaheri.com/playbook/v0.2.0/kit/ai-coding-memory.kit.json \
      | jq '{manifest: .}' \
      | curl -s -X POST https://agent.personize.ai/api/v1/kits \
          -H "Authorization: Bearer $PERSONIZE_API_KEY" -H "Content-Type: application/json" --data-binary @-
    

    Without jq, build the same {"manifest": <file contents>} body with any JSON tool. The response carries an installId; check GET https://agent.personize.ai/api/v1/kits/<installId> with the same key until it completes, and report any resource that failed.

    What the person gets on day one: 12 record types (person, project, feature, task, decision, inquiry, error, event, AI session, message, customer account, metric snapshot), 35 relation types, and 24 guidelines: the protocol, identifier, lifecycle, graph-linking, write-safety and retrieval standards, this setup guide, a routine customization guide, and 16 routine playbook templates. The kit README lists them and what is safe to change.

  3. Overlap check. If the organization already has another engineering kit, such as Engineering Memory, stop and ask: the two overlap on decision records.

  4. One project record per repository. Type project, key project_key = <owner>/<repo> from git remote get-url origin, lowercased. Set title, repo_url, default_branch, status: active, owner_email. Create it with memory_save(content, options:{mode:"sync"}), then set the fields in a second call, as the Write Safety and Concurrency guideline describes. Note each project's record ID; developers pass it to the setup command.

  5. One Person record per teammate, before their first session, so edges to them are real records and not stubs. Type person, key = work email, display_name, plus role, team, status: active.

  6. Keys. Each teammate gets their own API key for this organization from the organization's key settings. The admin hands it over privately, never in a shared channel.

  7. Synthetic checks from the Personize mapping guide, before any real work: create and read, duplicate identity, version conflict, two agents claiming one task, wrong-scope retrieval, a handoff and a failed write. Use test records and cancel them afterwards.

  8. Pick one routine to start. The 16 playbooks are templates. Start with Board hygiene: it is read-only and needs no source beyond the board. Copy it to Routine: Board hygiene, answer its judgment questions with the person, and set its caps, as the Routine Playbook Customization guideline describes. Never edit a template in place; a kit upgrade only updates templates nobody edited.

Each developer, once

Five steps. The first three need no assistant edits; the last two touch the developer's own machine, so ask first.

  1. Key in the environment. Put the personal key in a user environment variable, PERSONIZE_TEAM_MEMORY_API_KEY. Never on a command line, never in a repository.

  2. The MCP server, pointed at the organization with the agent profile:

    https://agent.personize.ai/mcp/stream?organizationId=<org id>&profile=agent
    

    Without organizationId the server rejects calls; other profiles lack tools the kit needs. Add it in the assistant's MCP settings with the key as a bearer token. In Claude Code, for example, claude mcp add --transport http team-memory "<url>" --header "Authorization: Bearer $PERSONIZE_TEAM_MEMORY_API_KEY" stores the expanded key in the user's private Claude config, not in shell history. After connecting, call personize_md once to confirm the organization.

  3. Check the Person record exists for their work email. If not, ask the admin; do not create a duplicate under another key.

  4. The session hook (Claude Code only):

    personize kits setup ai-coding-memory --email <work email> --project <owner/repo> --project-record <record id>
    

    Run with --dry-run first and show the person the plan. The command reads the key from PERSONIZE_TEAM_MEMORY_API_KEY or a hidden prompt. It writes the hook and config.json (file mode 600) to ~/.claude/hooks/team-memory/, registers the hooks in ~/.claude/settings.json after backing it up, and asks for confirmation unless given --yes. --project and --project-record go together; add more projects to config.json later. checkMessages: true makes the start message show the unread message count.

  5. The instructions block. The setup command does not edit CLAUDE.md. Add this block to ~/.claude/CLAUDE.md after asking, with the placeholders filled. It is the kit's own text.

    ## Team memory (Personize, ai-coding-memory kit)
    Use ONLY the <mcp server name> MCP tools for team memory (org <org id>, profile agent).
    Me: <work email>. Tool: claude-code. Project key = `git remote get-url origin` -> <owner>/<repo>, lowercased.
    Follow the org's AI Coding Memory guidelines: fetch them with memory_retrieve(mode:"scout", message:"<guideline name>", sources:{documents:true}) the first time
    you need their rules in a session, not at session start.
    Session record: a hook creates my AI Session (session_key = claude-code:<session id>), keeps it alive and marks it
    interrupted on close. Never create another one. Fill in title, goal, summary, next_steps, open_questions, worked_on_keys
    at milestones and on "wrap up" (then status ended + ended_at_ms).
    Session start: NO automatic reads or briefing. The hook shows the unread message count: offer to show them, never read
    them unprompted. Only when I ask what's open / where we stopped, or before acting on an existing task/feature/error: run
    the Retrieval Playbook recipe with `returnRecords:false` INSIDE `filters`, e.g.
    memory_retrieve(mode:"filter", filters:{..., returnRecords:false}). Save large results to a file and parse them; never paste them.
    Before creating a task, run the overlap check from the Work Lifecycle Standard.
    Writes: identity = record.customKey {name,value} + entityType (never `name`). NEVER memory_save(properties=...).
    Create with memory_save(content, options:{mode:"sync"}), then memory_save(shape:"property", operations:[{op:"set", property, value}], ...) with updated_by = "<email> via claude-code <session_key>".
    Before changing status/owner: re-read; if it changed since I last saw it, stop and ask.
    Never create tasks from your own suggestions unless I accept them.
    Never store secrets, credentials, customer PII, raw transcripts or full diffs.
    If any Personize call fails, say "NOT saved" / "could not check team memory", never claim success.
    

    Session start stays cheap on purpose: no reads and no briefing until the person asks. A morning brief is something the person asks for, not a tax on every session.

Prove it works

Run these in order with the developer. Each one has a visible pass condition.

CheckHowPass
Session recordStart a new session inside a listed repositoryThe start message shows a session key claude-code:<id>
Record and edgesFilter ai_session by that session_keyOne record, status active, with in_project and driven_by edges
A writeAsk the assistant to "park a test task: check team memory setup"A task with a task_key, status backlog, the project key, and the overlap check reported
A read by someone elseA second teammate asks "what's open in this project?"They see the test task
A handoffSay "wrap up"The session has summary, next_steps, status ended
Clean-upAsk the assistant to cancel the test task with a resolutionStatus cancelled, resolution set

Problems are logged in ~/.claude/hooks/team-memory/log.txt. The common ones: a missing organizationId in the MCP URL, a key for another organization, a repository whose project is not in config.json, and a Person record keyed by a different email.

Other assistants

Codex, Cursor and others have no hook. Put the same instructions block in that tool's instructions file (for example AGENTS.md for Codex, a project rule for Cursor), with Tool: set to codex, cursor or other. The assistant then creates its own ai_session record at the start of real work, as the protocol describes, and ends it on "wrap up".

Refresh, upgrade and undo

  • Refresh the hook: personize kits setup ai-coding-memory --refresh replaces the hook (keeping a backup) and keeps the key, email and projects.
  • Upgrade the kit: install the newer version the same way. Templates nobody edited update; copies (Routine: ...) stay as the team left them. Read the new version's changelog for renamed fields before the upgrade.
  • Undo on one machine: remove ~/.claude/hooks/team-memory/ and the hook entries in ~/.claude/settings.json (or restore the .bak-* files next to them), then remove the CLAUDE.md block and the MCP server.

Route B: your own store

The practices do not need Personize. To build your own, hold the same records and rules:

  1. Start from kit/definitions.json (record types, fields, relations) and kit/guidelines.md (the ten rules), and try the flow on kit/local-memory.cjs, a single-file local store with init, get, claim, review and accept.
  2. Map your store to the framework contract: states, transitions, the derived ready rule, links and the measures.
  3. Qualify it with the seven steps in the mapping guide before any real work. The ones that fail most often: stable keys that never change, a conditional update (a version check) for claims, and permissions that keep personal and customer data out.
  4. Give each assistant an instructions block with the same session, write and overlap rules as the block above, rewritten for your tools.

Weigh the two routes with build or use first.

After setup

  1. Give every developer the developer handout: what changes for them, what to say to their assistant, what never goes in.
  2. Run the first week on the operating rhythm: morning brief, handoffs, one team stand-up, a weekly review.
  3. Decide what to measure before the first weekly review, using the metric definitions. Add the recommended fields now; they cannot be filled in for the past.
  4. Then offer the pilot: three real tasks with an approved budget.