Managing Shared Memory logo

Managing Shared Memory

OrganizationPopular
letta-ai
managing-shared-memory

Create and manage shared memory — git-tracked repositories hosted on Letta Cloud that are attached to one or more agents and projected into their filesystems. Use when the user wants to share memory or files across agents, store context outside your own MemFS, attach or detach shared memory, or inspect its file history.

Overview

Publisherletta-ai
Repositoryletta-code
Skill namemanaging-shared-memory
Stars
3.4K
Forks
411
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by letta-ai on GitHub. Read the source before you install it.

Installation

Install the Managing Shared Memory AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/letta-ai/letta-code.git /tmp/letta-code
mkdir -p .claude/skills
cp -r /tmp/letta-code/src/skills/builtin/managing-shared-memory .claude/skills/managing-shared-memory
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Managing Shared Memory in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Managing Shared Memory on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Managing Shared Memory is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Managing Shared Memory

Shared memory is memory created independently of any single agent, designed to be dynamically attached to or detached from multiple agents. Each unit of shared memory is a shared memory repository: a git repository hosted on Letta Cloud, owned by your organization rather than by one agent, reachable from any environment (sandboxes, remote machines, sessions).

Shared memory works like your MemFS: attached repositories are real git checkouts on disk, and you read, edit, and commit with ordinary git. The harness pushes clean committed changes after each turn. Each repository has its own projection root (next to your memory directory, not inside it) and its own remote origin, and other agents may be writing to it too.

Create a shared memory repository when:

  • You have context an agent should be able to access that doesn't belong in its own MemFS (input files, datasets, docs, working artifacts)
  • Multiple agents need to read or write the same context
  • You want a versioned file store that survives across environments and sessions

Working with Files (the normal path)

Attached shared memory is mounted next to your memory directory, one git checkout per repository:

bash
ls "$MEMORY_DIR/../"                      # attached repositories appear here by name
cat "$MEMORY_DIR/../<repo-name>/<path>"   # read like any file

Edit files with your normal file tools, then commit with git. The mount's origin and credentials are already configured:

bash
cd "$MEMORY_DIR/../<repo-name>"
git add <files>
git commit -m "describe the change"

The harness pushes clean commits from read/write attached repositories after the turn. If a push collides with another agent's work, it pulls with rebase and retries once. Dirty files and conflicts are not changed automatically; the harness adds a reminder to the next turn instead.

To pick up other agents' changes:

bash
git -C "$MEMORY_DIR/../<repo-name>" pull --rebase

If a push is rejected (another agent pushed first), git pull --rebase then push again.

History is ordinary git history:

bash
git -C "$MEMORY_DIR/../<repo-name>" log --oneline -- <path>

Managing Repositories (create / attach / detach)

Use the letta shared-memory subcommand. It uses your harness auth (works even when LETTA_API_KEY is not in the shell env) and inherits the agent id from AGENT_ID, so --agent is only needed when targeting another agent.

bash
# List org repositories (marks which are attached to you)
letta shared-memory list

# Create a repository
letta shared-memory create --name shared-notes

# Attach to yourself: attaches via the API, clones the local mount at
# $MEMORY_DIR/../shared-notes, and recompiles the system prompt projection
letta shared-memory attach shared-notes

# Attach to another agent (its mount materializes in that agent's environments)
letta shared-memory attach shared-notes --agent agent-...

# Detach (leaves the local mount directory in place)
letta shared-memory detach shared-notes

# Repair/refresh mounts: clone or pull every attached repository. Use this when
# the system prompt references a repository that is missing on disk (e.g. after
# it was attached from another surface while this session was running).
letta shared-memory sync

# Commit history via the API (works even without a local mount)
letta shared-memory history shared-notes --path docs/plan.md

Troubleshooting

  • Prompt lists a repository but $MEMORY_DIR/../<name> is missing — the repository was attached without materializing the mount. Run letta shared-memory sync.
  • sync reports "mount path already exists and is not a git repository" — a plain directory (usually created by hand before the mount existed) is occupying the mount path. Inspect it, salvage anything worth keeping, move or delete it, then re-run letta shared-memory sync.
  • Never hand-clone the repository to another location (e.g. /tmp) to work around a broken mount — fix the mount with letta shared-memory sync so every session and other agents see the same checkout.
  • Permission denied under another agent's directory — shared repositories mount per-agent. Only your own mount (under your agent directory) is accessible; another agent's mount of the same repository is walled off by the cross-agent guard. Run letta shared-memory sync to get your own mount.
  • Shared-memory conflict reminder — resolve the conflict in the named repository, finish the rebase or commit, and leave the repository clean. The harness retries the push after a future turn.

Notes and Limits

  • Shared memory is not part of your system prompt. Writing to it does not change your in-context memory — for that, edit your memory blocks or MemFS files.
  • Attaching is asynchronous on the server; letta shared-memory attach waits for the attachment to be visible before cloning.
  • SDK/API equivalent for programmatic callers: @letta-ai/letta-agent-sdk exposes these operations as client.repositories (with files and versions helpers), and shared memory can be attached for a session's lifetime via resources: [{ type: "repository", repositoryId }] on cloud sessions. The REST resource is /v1/repositories.

Frequently asked questions

What does the Managing Shared Memory AI skill do?

Create and manage shared memory — git-tracked repositories hosted on Letta Cloud that are attached to one or more agents and projected into their filesystems. Use when the user wants to share memory or files across agents, store context outside your own MemFS, attach or detach shared memory, or inspect its file history.

Why use Managing Shared Memory on TypingMind?

Because you install it once and use it with any model. Managing Shared Memory is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Managing Shared Memory in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/letta-ai/letta-code/tree/main/src/skills/builtin/managing-shared-memory. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Managing Shared Memory?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Managing Shared Memory?

As many as you like. As long as a model supports skills, you can use Managing Shared Memory with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Managing Shared Memory AI skill free?

Yes. It is published on GitHub by letta-ai under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇