529279917/memory-persistence/SKILL.md
Multi-backend memory system with optional embedding, private/shared memories, conversation summarization, and maintenance tools. For AI agents to store and retrieve persistent memories.
npx skillsauth add openclaw/skills memory-persistenceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A flexible memory system for AI agents with optional embedding support and multiple storage backends.
pip install sentence-transformers scikit-learn pyyaml numpy
from memory_system import MemoryManager
# Initialize (local storage)
mm = MemoryManager(backend='local')
# Add
mm.add("User prefers dark theme", tags=["preference"])
# Search
results = mm.search("dark theme preference")
# List
entries = mm.list(tags=["preference"])
# Add
python3 memory_cli.py add "User feedback: slow page load" --tags "bug,performance"
# List
python3 memory_cli.py list
# Search
python3 memory_cli.py -e search "performance issue"
# Semantic search (with embedding)
python3 memory_cli.py -e search "dark mode"
| Type | Storage | Access | Use Case |
|------|---------|--------|----------|
| Private | ./memory_data/ | Current agent only | User preferences, personal notes |
| Shared | ./shared_memory/ | All agents | Team decisions, collaboration |
Default: All memories are private. Use shared add only when other agents need to know.
# Private memory - user says "remember..."
mm.add("User name is Zhang San")
# Shared memory - user says "tell other agents..."
smm.add("Team decision: use React", agent_id="agent_a")
mm = MemoryManager(backend='local')
mm = MemoryManager(backend='sqlite', base_path='./memory.db')
export GITHUB_TOKEN="your_token"
mm = MemoryManager(
backend='github',
repo='owner/repo',
branch='main'
)
export GITEE_TOKEN="your_token"
mm = MemoryManager(
backend='gitee',
repo='owner/repo',
branch='master'
)
Embedding is optional and auto-downloads on first use.
# Enable embedding
mm = MemoryManager(backend='local', use_embedding=True)
# Add (auto-generates vector)
mm.add("User works from 9am to 6pm")
# Semantic search - finds similar content
results = mm.search("what time does user work")
CLI with embedding:
python3 memory_cli.py -e search "working hours"
from memory_system import SharedMemoryManager
# Initialize
smm = SharedMemoryManager(backend='local', shared_path='./shared_memory')
# Add shared memory (from an agent)
smm.add("Bug #123 fixed", agent_id='agent_b')
# List shared memories
shared = smm.list()
# By agent
by_agent = smm.get_by_agent('agent_b')
CLI:
# Add shared
python3 memory_cli.py shared add "Team decision: use Vue" --agent "agent_a"
# List
python3 memory_cli.py shared list
# Search
python3 memory_cli.py -e shared search "Vue decision"
Auto-extract key information from conversation history.
from memory_system import MemoryManager, MemorySummarizer, ConversationMemoryProcessor
mm = MemoryManager(use_embedding=True)
summarizer = MemorySummarizer() # Auto-detects OpenClaw model
processor = ConversationMemoryProcessor(mm, summarizer, auto_save=True)
conversation = """
User: I prefer dark theme
Assistant: Changed to dark theme
User: Page loads slowly
Assistant: Optimized images
"""
memories = processor.process(conversation)
CLI:
python3 memory_cli.py summarize --file conversation.txt --save
# Generate report
python3 memory_cli.py maintenance report
# Review old memories
python3 memory_cli.py maintenance review --days 7
# Find similar memories
python3 memory_cli.py maintenance consolidate
# Suggest tags for untagged memories
python3 memory_cli.py maintenance suggest-tags
# Mark as outdated
python3 memory_cli.py maintenance outdated --mark <id> --reason "expired"
Predefined formats for quick memory creation.
# List templates
python3 memory_cli.py template list
# Show template
python3 memory_cli.py template show task
# Use template
python3 memory_cli.py template use task \
--field title="Complete report" \
--field priority="high"
Organize memories into groups.
# Add to group
python3 memory_cli.py add "work task" --tags "work" --group "work"
# List groups
python3 memory_cli.py group list
# Show group
python3 memory_cli.py group show "work"
# Batch add tags
python3 memory_cli.py batch-add-tags id1,id2 --tags "important,priority"
# Batch delete (requires confirmation)
python3 memory_cli.py batch-delete id1,id2 --force
| Method | Description |
|--------|-------------|
| add(content, tags, metadata, group) | Add memory |
| get(id) | Get by ID |
| delete(id) | Delete |
| list(tags, limit, offset) | List with pagination |
| search(query, tags, top_k, threshold) | Search |
| batch_delete(ids) | Batch delete |
| list_groups() | List groups |
| export_json(filepath) | Export JSON |
| Method | Description |
|--------|-------------|
| add(content, agent_id, tags) | Add shared memory |
| list(tags) | List shared |
| get_by_agent(agent_id) | By agent |
| search(query) | Search shared |
memory_system/
├── memory_manager.py # Core manager
├── shared_memory.py # Shared
├── summarizer.py # LLM summarization
├── maintenance.py # Maintenance tools
├── templates.py # Templates
├── embedding.py # Embedding handler
├── storage/ # Storage backends
│ ├── local.py
│ ├── sqlite.py
│ ├── github.py
│ └── gitee.py
└── memory_cli.py # CLI entry (run with python3)
config.yaml:
STORAGE_BACKEND: "local"
USE_EMBEDDING: false
EMBEDDING_MODEL: "sentence-transformers/all-MiniLM-L6-v2"
storage:
local:
base_path: "./memory_data"
sqlite:
base_path: "./memory.db"
github:
repo: "owner/repo"
token_env: "GITHUB_TOKEN"
gitee:
repo: "owner/repo"
token_env: "GITEE_TOKEN"
MIT
tools
Use when the user wants to connect to, test, or use the McDonalds service at mcp.mcd.cn, including checking authentication, probing MCP endpoints, listing tools, or calling McDonalds MCP tools through a reusable local CLI.
development
Web scraping platform — Twitter/X data, Vinted marketplace, and general web scraping API
development
SlowMist AI Agent Security Review — comprehensive security framework for skills, repositories, URLs, on-chain addresses, and products (Claude Code version)
data-ai
去除中文文本中的 AI 写作痕迹,使其读起来自然。基于维基百科 AI 写作特征指南,检测 24 种 AI 模式。触发词:humanizer-cn、去除 AI 痕迹、去除 AI 写作痕迹、中文文本人性化。