mem0-pin

Pins or unpins Mem0 memories to protect them from pruning during dream consolidation.

64.5k|7.6k|Updated Jun 20, 2023
One-click install
npx skills add https://github.com/mem0ai/mem0 --skill mem0-pin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mem0-pin
Source: https://github.com/mem0ai/mem0/tree/main/integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-pin
Command: npx skills add https://github.com/mem0ai/mem0 --skill mem0-pin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Critical memories such as architecture decisions, security constraints, and team conventions can be removed during memory consolidation. This Skill marks them as pinned so they survive pruning.

Core Features & Use Cases

  • Pin existing memories: Search memories by query or ID, then prepend a [PINNED] marker via the update_memory tool so the protection travels with the memory text.
  • Pin new content: Store new critical text with add_memory using pinned metadata, then confirm creation through get_event_status.
  • Unpin support: Remove the [PINNED] marker to restore normal pruning behavior.
  • Use Case: A team records a security constraint like "never log user tokens" and pins it so the memory persists across all future consolidation cycles.

Quick Start

Ask the assistant to pin the memory about our architecture decision so it is never pruned.

Frequently Asked Questions about mem0-pin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pin a memory in Mem0 so it is never deleted?

Pin a memory by locating it with search_memories or get_memory, then calling update_memory to prepend a [PINNED] marker to its text. The marker travels with the memory and protects it from pruning during dream consolidation.

How do I unpin a pinned Mem0 memory?

Unpin by calling get_memory to read the current content, then use update_memory to write the text back with the [PINNED] prefix removed. The memory then returns to normal pruning behavior.

Can I pin new text that is not stored in Mem0 yet?

Yes. Call add_memory with the text prefixed by [PINNED], metadata containing pinned set to true, and infer set to false. Then call get_event_status with the returned event_id to retrieve the new memory ID.

What kinds of memories should be pinned in Mem0?

Pin memories that must never be removed, such as architecture decisions, security constraints, and immutable team conventions. Routine or temporary context should remain unpinned so consolidation can prune it normally.

Why does the pin marker use text instead of metadata only?

The [PINNED] marker is prepended to the memory text so the protection travels with the memory itself through updates. Metadata alone may not persist reliably across memory operations.