Логотип Add Mnemon

Add Mnemon

Організація
mnemon-dev
add-mnemon

Add persistent graph-based memory to NanoClaw agents using mnemon. Agents recall context before responding and remember insights after. Each group gets isolated memory with optional global shared store.

Огляд

Видавецьmnemon-dev
Репозиторійmnemon
Назва навичкиadd-mnemon
Зірки
620
Форки
75
Файли в пакеті
1
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 1

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем mnemon-dev. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Add Mnemon у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/mnemon-dev/mnemon/tree/master/internal/memory/setup/assets/nanoclaw
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mnemon-dev/mnemon.git /tmp/mnemon
mkdir -p .claude/skills
cp -r /tmp/mnemon/internal/memory/setup/assets/nanoclaw .claude/skills/add-mnemon
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Add Mnemon в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Add Mnemon, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Add Mnemon не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

/add-mnemon

Add mnemon persistent memory to your NanoClaw installation. After running this skill, every agent session will have access to a per-group memory graph that persists across conversations.

Architecture

Host                              Container
~/.mnemon/data/{group}/ ──rw──→ /home/node/.mnemon/data/default/  (private)
~/.mnemon/data/global/  ──ro──→ /home/node/.mnemon/data/global/   (shared)

Each group gets its own isolated mnemon store. An optional global store provides shared read-only knowledge across all groups.


Phase 1: Pre-flight

  1. Verify mnemon is installed on the host:

    bash
    mnemon --version

    If not installed:

    • Recommended (npm): npm install --global @mnemon-dev/mnemon
    • Alternative (Homebrew): brew install --cask mnemon-dev/tap/mnemon
  2. Verify the container image exists:

    bash
    docker image inspect nanoclaw-agent:latest >/dev/null 2>&1 && echo "OK"
  3. Fetch the latest mnemon version for the Dockerfile:

    bash
    curl -s https://api.github.com/repos/mnemon-dev/mnemon/releases/latest | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | sed 's/^v//'

Phase 2: Apply Code Changes

2a. Install mnemon in the container image

File: container/Dockerfile

Add the following block after the apt-get install section and before the npm install -g line. Replace 0.1.1 with the version from Phase 1 step 3:

dockerfile
# Install mnemon for persistent agent memory
ARG MNEMON_VERSION=0.1.1
RUN ARCH=$(dpkg --print-architecture) && \
    curl -fsSL "https://github.com/mnemon-dev/mnemon/releases/download/v${MNEMON_VERSION}/mnemon_${MNEMON_VERSION}_linux_${ARCH}.tar.gz" \
    | tar -xz -C /usr/local/bin mnemon && \
    chmod +x /usr/local/bin/mnemon

This works for both amd64 and arm64 architectures.

2b. Add the container skill

File: container/skills/mnemon/SKILL.md

Create this file with the mnemon container skill content. This skill teaches the agent inside the container when and how to use mnemon. It should include:

  • Memory stores section: Explain that the default store is per-group (private, read-write) and the global store is shared (read-only, accessed via --store global --readonly).
  • Recall guide: Default recall on every new user message. Use mnemon recall "<query>" --limit 5. Also check the global store: mnemon recall "<query>" --store global --readonly --limit 5. Craft focused keyword-rich queries.
  • Remember guide: Decision tree — Step 1: Does this exchange contain a user directive, reasoning conclusion, or durable observed state? Step 2: Does a memory already exist (create/update/skip)? Step 3: Is it worth storing?
  • Workflow: remember → link (evaluate semantic/causal candidates with judgment) → recall.
  • Commands: Full mnemon command reference (remember, link, recall, search, forget, related, gc, status, log).
  • Guardrails: Never store secrets. Never write to the global store. Categories: preference, decision, insight, fact, context. Max 8,000 chars per insight.

2c. Add volume mounts for mnemon data

File: src/container-runner.ts

In the function that builds volume mounts (where the existing group folder and Claude session mounts are defined), add two new mounts after the Claude sessions mount:

typescript
// Per-group mnemon memory store (private, read-write)
const groupMnemonDir = path.join(homedir(), '.mnemon', 'data', group.folder);
fs.mkdirSync(groupMnemonDir, { recursive: true });
mounts.push({
  hostPath: groupMnemonDir,
  containerPath: '/home/node/.mnemon/data/default',
  readonly: false,
});

// Global shared mnemon memory (read-only, optional)
const globalMnemonDir = path.join(homedir(), '.mnemon', 'data', 'global');
if (fs.existsSync(globalMnemonDir)) {
  mounts.push({
    hostPath: globalMnemonDir,
    containerPath: '/home/node/.mnemon/data/global',
    readonly: true,
  });
}

Adapt the mount syntax to match the existing pattern in container-runner.ts (it may use string format like hostPath:containerPath:ro or an object format — match whichever the file uses).

Important: The mkdirSync call ensures the per-group mnemon directory exists on the host before the container starts, preventing mount failures.

2d. Add lifecycle hook scripts

Create container/hooks/mnemon/ with four shell scripts. These run inside the container at Claude Code lifecycle events to actively drive memory operations.

File: container/hooks/mnemon/prime.sh

bash
#!/bin/bash
# mnemon SessionStart hook — report memory stats on session init.
STATS=$(mnemon status 2>/dev/null)
if [ -n "$STATS" ]; then
  INSIGHTS=$(echo "$STATS" | sed -n 's/.*"total_insights": *\([0-9]*\).*/\1/p' | head -1)
  EDGES=$(echo "$STATS" | sed -n 's/.*"edge_count": *\([0-9]*\).*/\1/p' | head -1)
  echo "[mnemon] Memory active (${INSIGHTS:-0} insights, ${EDGES:-0} edges)."
else
  echo "[mnemon] Memory active."
fi

File: container/hooks/mnemon/user_prompt.sh

bash
#!/bin/bash
# mnemon UserPromptSubmit hook — remind agent to evaluate recall/remember.
echo "[mnemon] Evaluate: recall needed? After responding, evaluate: remember needed?"

File: container/hooks/mnemon/stop.sh

bash
#!/bin/bash
# mnemon Stop hook — remind agent to consider remember after responding.
INPUT=$(cat)
MSG=$(echo "$INPUT" | jq -r '.last_assistant_message // ""' 2>/dev/null)
if echo "$MSG" | grep -qiE "mnemon remember|sub-agent.*remember|Stored.*imp="; then
  exit 0
fi
echo "[mnemon] Consider: does this exchange warrant a remember sub-agent?"

File: container/hooks/mnemon/compact.sh

bash
#!/bin/bash
# mnemon PreCompact hook — save key insights before context compaction.
echo "[mnemon] Context compaction starting. Review this session and remember the most valuable insights (up to 5) before context is compressed. Delegate to Task sub-agents now."

Make all scripts executable: chmod +x container/hooks/mnemon/*.sh

2e. Copy hooks into container and register in settings.json

File: container/Dockerfile

Add after the mnemon binary install block:

dockerfile
# Copy mnemon hook scripts
COPY hooks/mnemon/ /app/hooks/mnemon/
RUN chmod +x /app/hooks/mnemon/*.sh

File: src/container-runner.ts

In the block where settings.json is created for each group session (look for writeFileSync with settings.json), merge mnemon hooks into the settings object:

typescript
// Register mnemon lifecycle hooks
const mnemonHooks = {
  SessionStart: [{
    hooks: [{ type: 'command', command: '/app/hooks/mnemon/prime.sh' }]
  }],
  UserPromptSubmit: [{
    hooks: [{ type: 'command', command: '/app/hooks/mnemon/user_prompt.sh' }]
  }],
  Stop: [{
    hooks: [{ type: 'command', command: '/app/hooks/mnemon/stop.sh' }]
  }],
  PreCompact: [{
    hooks: [{ type: 'command', command: '/app/hooks/mnemon/compact.sh' }]
  }],
};

// Merge into existing settings.hooks (preserve any existing hooks)
const existingHooks = settings.hooks || {};
for (const [event, entries] of Object.entries(mnemonHooks)) {
  existingHooks[event] = [...(existingHooks[event] || []), ...entries];
}
settings.hooks = existingHooks;

Adapt this to match the existing settings.json construction pattern in container-runner.ts.


Phase 3: Setup

  1. Initialize the global shared store on the host (optional — skip if you don't need cross-group shared memory):

    bash
    mnemon store create global
  2. Rebuild the container image:

    bash
    ./container/build.sh
  3. Restart the NanoClaw service:

    bash
    # macOS with launchd:
    launchctl kickstart -k "gui/$(id -u)/com.nanoclaw"
    # Or manually:
    npm run dev

Phase 4: Verify

  1. Verify mnemon works inside the container:

    bash
    docker run --rm --entrypoint mnemon nanoclaw-agent:latest --version
  2. Verify mnemon status inside a running container:

    bash
    docker run --rm --entrypoint mnemon nanoclaw-agent:latest status
  3. Send a test message to the WhatsApp bot and check that the agent mentions memory operations in its reasoning.

  4. Verify data persistence on the host:

    bash
    ls ~/.mnemon/data/
    # Should show directories for each active group

Removal

To remove mnemon from your NanoClaw installation:

  1. Remove from Dockerfile: delete the ARG MNEMON_VERSION + RUN ... mnemon block and the COPY hooks/mnemon/ line
  2. Remove container skill: rm -rf container/skills/mnemon/
  3. Remove hook scripts: rm -rf container/hooks/mnemon/
  4. Remove volume mounts from src/container-runner.ts: delete the mnemon mount blocks
  5. Remove hooks registration from src/container-runner.ts: delete the mnemon hooks merge in settings.json
  6. Rebuild: ./container/build.sh
  7. (Optional) Remove data: rm -rf ~/.mnemon/data/

Recall Intent

Keep focused queries and memories in their original language. When the user's meaning is clear, choose --intent WHY (reasons), --intent WHEN (timing), --intent ENTITY (what/who), or --intent GENERAL (neutral retrieval). For example: mnemon recall "<query>" --intent WHY. The override works in any language; --verbose reports meta.intent and meta.intent_source (auto or override).

Automatic cues cover some forms in English, Mandarin Chinese (simplified and traditional), Hindi (Devanagari), Spanish, Modern Standard Arabic, French, Bengali (Bengali script), Portuguese, Indonesian (Latin script), Russian (Cyrillic), and German. Unrecognized forms use GENERAL; conflicting cues involving additional languages also use GENERAL. English/Chinese-only scoring is preserved. This is a lexical heuristic, not full language understanding. See the supported forms, script variants, and limits.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Add Mnemon?

Add persistent graph-based memory to NanoClaw agents using mnemon. Agents recall context before responding and remember insights after. Each group gets isolated memory with optional global shared store.

Навіщо використовувати Add Mnemon у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Add Mnemon — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Add Mnemon у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/mnemon-dev/mnemon/tree/master/internal/memory/setup/assets/nanoclaw. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Add Mnemon?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Add Mnemon?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Add Mnemon — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Add Mnemon?

Так. Навичку опубліковано на GitHub: mnemon-dev, за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇