[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71AJW8K7NW9K5D6CH1DNFZP":3,"skill-same:01M71AJW8K7NW9K5D6CH1DNFZP":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":14,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":48,"install":49,"resources":62},"01M71AJW8K7NW9K5D6CH1DNFZP","memos-sync",null,"Synchronize OpenClaw local memory to MemOS master database. Automatically sync memory files, learning logs, preferences, and important events to the centralized MemOS instance at 100.106.127.15:8000. Supports bidirectional sync, conflict resolution, and intelligent memory management.","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Fmemos-sync\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"sync","memos sync","memory management","management","resolution","preferences","learning","conflict","events","openclaw","master","at","sync memory","logs","database","files","local","conflict resolution","memory","2026-11-10 10:12:30",false,"---\nname: memos-sync\ndescription: \"Synchronize OpenClaw local memory to MemOS master database. Automatically sync memory files, learning logs, preferences, and important events to the centralized MemOS instance at 100.106.127.15:8000. Supports bidirectional sync, conflict resolution, and intelligent memory management.\"\n---\n\n# MemOS Sync — Centralized Memory Synchronization\n\n## Overview\n\nThis skill synchronizes OpenClaw's local memory system with a centralized **MemOS database** running at `100.106.127.15:8000` via Tailscale. It enables:\n\n1. **Centralized memory storage** — All memories in one searchable database\n2. **Cross-device access** — Access memories from any device\n3. **Collaborative memory** — Share memories across team members\n4. **Backup and recovery** — Never lose important memories\n5. **Advanced search** — Powerful semantic search across all memories\n\n## MemOS API Configuration\n\n### Base Configuration\n```yaml\n# ~\u002F.openclaw\u002Fworkspace\u002Fmemos-config.yaml\nmemos:\n  # MemOS server configuration\n  server:\n    base_url: \"http:\u002F\u002F100.106.127.15:8000\"\n    api_prefix: \"\u002Fproduct\"\n    timeout: 30\n    retry_attempts: 3\n    \n  # Authentication (if required)\n  auth:\n    enabled: false\n    token: \"\"\n    user_id: \"\"\n    \n  # Sync settings\n  sync:\n    auto_sync: true\n    sync_interval: 300  # seconds\n    batch_size: 50\n    max_file_size: 10485760  # 10MB\n    \n  # Memory types to sync\n  memory_types:\n    - daily_notes    # memory\u002FYYYY-MM-DD.md\n    - long_term      # MEMORY.md\n    - learnings      # memory\u002Flearnings\u002F*.md\n    - preferences    # memory\u002Fpreferences.md\n    - skills         # skills\u002F*\u002FSKILL.md (metadata only)\n    - events         # Important events and decisions\n    \n  # Conflict resolution\n  conflict_resolution: \"server_wins\"  # or: local_wins, merge, prompt\n```\n\n## Core Sync Operations\n\n### 1. Initial Setup & Health Check\n```bash\n# Test connection to MemOS\nmemos-sync health\n\n# Get server status\nmemos-sync status\n\n# Initialize sync configuration\nmemos-sync init --server 100.106.127.15:8000\n```\n\n### 2. One-Time Full Sync\n```bash\n# Sync all local memories to MemOS\nmemos-sync push --all\n\n# Sync specific memory types\nmemos-sync push --type daily_notes --date 2026-04-01\nmemos-sync push --type learnings --category technical\n\n# Sync with custom tags\nmemos-sync push --tag \"openclaw\" --tag \"skills\" --tag \"installation\"\n```\n\n### 3. Incremental Sync\n```bash\n# Sync new memories since last sync\nmemos-sync push --incremental\n\n# Sync recent daily notes\nmemos-sync push --recent 7  # Last 7 days\n\n# Sync only changed files\nmemos-sync push --changed\n```\n\n### 4. Pull from MemOS\n```bash\n# Pull memories from MemOS to local\nmemos-sync pull --all\n\n# Pull specific memory by ID\nmemos-sync pull --memory-id \"mem_abc123\"\n\n# Pull memories with specific tags\nmemos-sync pull --tag \"decision\" --tag \"important\"\n```\n\n### 5. Bidirectional Sync\n```bash\n# Full bidirectional sync\nmemos-sync sync --bidirectional\n\n# Sync with conflict resolution\nmemos-sync sync --resolve merge\n\n# Dry run (show what would be synced)\nmemos-sync sync --dry-run\n```\n\n## Memory Mapping\n\n### Local → MemOS Mapping\n```\nLocal Structure                    MemOS Structure\n---------------                    ---------------\nmemory\u002F2026-04-01.md              → Daily memory with date tag\nMEMORY.md                         → Long-term curated memories\nmemory\u002Flearnings\u002Fapi_errors.md    → Learning memory with category\nmemory\u002Fpreferences.md             → Preference memory\nskills\u002Fevolver\u002FSKILL.md           → Skill metadata\nworkspace\u002Fdecisions.json          → Decision memory\n```\n\n### Memory Metadata\n```json\n{\n  \"source\": \"openclaw\",\n  \"source_id\": \"local_memory_123\",\n  \"type\": \"daily_note|learning|preference|skill|event|decision\",\n  \"timestamp\": \"2026-04-01T09:31:00Z\",\n  \"created_at\": \"2026-04-01T08:00:00Z\",\n  \"updated_at\": \"2026-04-01T09:31:00Z\",\n  \"tags\": [\"openclaw\", \"skills\", \"installation\", \"memOS\"],\n  \"category\": \"technical|personal|work|learning\",\n  \"priority\": \"low|medium|high|critical\",\n  \"privacy\": \"private|shared|public\",\n  \"version\": 1,\n  \"checksum\": \"sha256:abc123...\"\n}\n```\n\n## API Integration Examples\n\n### 1. Health Check\n```python\ndef check_memos_health():\n    \"\"\"Check if MemOS server is healthy\"\"\"\n    response = requests.get(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fhealth\",\n        timeout=10\n    )\n    return response.status_code == 200\n```\n\n### 2. Add Memory\n```python\ndef add_memory_to_memos(content, metadata):\n    \"\"\"Add a memory to MemOS\"\"\"\n    payload = {\n        \"content\": content,\n        \"metadata\": metadata,\n        \"tags\": metadata.get(\"tags\", []),\n        \"category\": metadata.get(\"category\", \"general\"),\n        \"priority\": metadata.get(\"priority\", \"medium\")\n    }\n    \n    response = requests.post(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fadd\",\n        json=payload,\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json().get(\"memory_id\")\n    else:\n        raise Exception(f\"Failed to add memory: {response.text}\")\n```\n\n### 3. Search Memories\n```python\ndef search_memos(query, filters=None):\n    \"\"\"Search memories in MemOS\"\"\"\n    payload = {\n        \"query\": query,\n        \"filters\": filters or {},\n        \"limit\": 20,\n        \"offset\": 0\n    }\n    \n    response = requests.post(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fsearch\",\n        json=payload,\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json().get(\"memories\", [])\n    else:\n        raise Exception(f\"Search failed: {response.text}\")\n```\n\n### 4. Get Memory by ID\n```python\ndef get_memory_by_id(memory_id):\n    \"\"\"Retrieve a specific memory\"\"\"\n    response = requests.get(\n        f\"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fget_memory\u002F{memory_id}\",\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json()\n    elif response.status_code == 404:\n        return None\n    else:\n        raise Exception(f\"Failed to get memory: {response.text}\")\n```\n\n### 5. Batch Operations\n```python\ndef batch_add_memories(memories):\n    \"\"\"Add multiple memories in batch\"\"\"\n    responses = []\n    for memory in memories:\n        try:\n            memory_id = add_memory_to_memos(\n                memory[\"content\"],\n                memory[\"metadata\"]\n            )\n            responses.append({\n                \"success\": True,\n                \"memory_id\": memory_id,\n                \"source_id\": memory[\"metadata\"].get(\"source_id\")\n            })\n        except Exception as e:\n            responses.append({\n                \"success\": False,\n                \"error\": str(e),\n                \"source_id\": memory[\"metadata\"].get(\"source_id\")\n            })\n    return responses\n```\n\n## Sync Strategies\n\n### Strategy 1: Real-time Sync\n```yaml\n# Sync immediately when important events occur\ntriggers:\n  - memory file created or modified\n  - skill installed or updated\n  - important decision made\n  - learning captured\n  - preference changed\n```\n\n### Strategy 2: Scheduled Sync\n```bash\n# Cron job for regular sync\n# Every 5 minutes\n*\u002F5 * * * * memos-sync sync --incremental\n\n# Daily full sync at 2 AM\n0 2 * * * memos-sync sync --full\n\n# Weekly cleanup and optimization\n0 3 * * 0 memos-sync optimize --cleanup\n```\n\n### Strategy 3: Event-driven Sync\n```python\n# Example: Sync when daily note is completed\ndef on_daily_note_completed(date, content):\n    \"\"\"Sync daily note to MemOS\"\"\"\n    metadata = {\n        \"type\": \"daily_note\",\n        \"date\": date,\n        \"tags\": [\"daily\", \"log\", date],\n        \"category\": \"personal\",\n        \"priority\": \"medium\"\n    }\n    \n    memory_id = add_memory_to_memos(content, metadata)\n    \n    # Store mapping for future reference\n    store_mapping(f\"daily_{date}\", memory_id)\n    \n    return memory_id\n```\n\n## Conflict Resolution\n\n### Resolution Strategies\n```python\ndef resolve_conflict(local_memory, remote_memory, strategy=\"server_wins\"):\n    \"\"\"Resolve sync conflicts\"\"\"\n    \n    if strategy == \"server_wins\":\n        return remote_memory\n        \n    elif strategy == \"local_wins\":\n        return local_memory\n        \n    elif strategy == \"merge\":\n        # Merge content intelligently\n        merged = merge_memories(local_memory, remote_memory)\n        return merged\n        \n    elif strategy == \"prompt\":\n        # Ask user to resolve\n        resolution = prompt_user_resolution(local_memory, remote_memory)\n        return resolution\n        \n    elif strategy == \"new_version\":\n        # Create new version with both\n        return create_merged_version(local_memory, remote_memory)\n```\n\n### Merge Algorithm\n```python\ndef merge_memories(local_mem, remote_mem):\n    \"\"\"Intelligently merge two memories\"\"\"\n    \n    # Use newer content as base\n    if local_mem[\"updated_at\"] > remote_mem[\"updated_at\"]:\n        base = local_mem.copy()\n        other = remote_mem\n    else:\n        base = remote_mem.copy()\n        other = local_mem\n    \n    # Merge tags (unique)\n    base_tags = set(base.get(\"tags\", []))\n    other_tags = set(other.get(\"tags\", []))\n    base[\"tags\"] = list(base_tags.union(other_tags))\n    \n    # Merge metadata\n    for key in [\"category\", \"priority\", \"privacy\"]:\n        if key in other and key not in base:\n            base[key] = other[key]\n    \n    # Add merge note\n    if \"content\" in base and \"content\" in other:\n        merge_note = f\"\\n\\n---\\n*Merged from local and remote versions*\"\n        base[\"content\"] += merge_note\n    \n    return base\n```\n\n## Integration with OpenClaw Memory System\n\n### Ready-to-Use Implementation\nA complete MemOS sync implementation is available in your workspace:\n\n```bash\n# Location of implementation files\nls ~\u002F.openclaw\u002Fworkspace\u002Fscripts\u002Fmemos_*\n\n# Files included:\n# 1. memos_sync.py          - Main sync script\n# 2. memos_sync_config.yaml - Configuration\n# 3. memos_sync_usage.md    - Usage instructions\n# 4. start_memos_sync.bat   - Windows batch script\n```\n\n### Quick Test\n```bash\n# Test connection to MemOS server\ncd ~\u002F.openclaw\u002Fworkspace\u002Fscripts\npython memos_sync.py --health\n\n# First full sync\npython memos_sync.py --full\n\n# Or use the batch script (Windows)\nstart_memos_sync.bat health\nstart_memos_sync.bat full\n```\n\n### Integration with Daily Workflow\nAdd to your HEARTBEAT.md or create a cron job:\n\n```bash\n# Add to HEARTBEAT.md\n- Check MemOS sync status and sync if needed\n\n# Cron job for automatic sync (every 5 minutes)\n*\u002F5 * * * * cd ~\u002F.openclaw\u002Fworkspace\u002Fscripts && python memos_sync.py --incremental\n```\n\n### Automatic Sync Triggers\n```python\n# Sync triggers for different memory types\nSYNC_TRIGGERS = {\n    \"memory\u002F*.md\": {\n        \"priority\": \"medium\",\n        \"delay\": 60,  # seconds\n        \"batch\": True\n    },\n    \"MEMORY.md\": {\n        \"priority\": \"high\",\n        \"delay\": 10,\n        \"batch\": False\n    },\n    \"memory\u002Flearnings\u002F*.md\": {\n        \"priority\": \"high\",\n        \"delay\": 30,\n        \"batch\": True\n    },\n    \"memory\u002Fpreferences.md\": {\n        \"priority\": \"high\",\n        \"delay\": 5,\n        \"batch\": False\n    }\n}\n```\n\n## Usage Examples\n\n### Example 1: Daily Sync Workflow\n```bash\n# Morning: Check sync status\nmemos-sync status\n\n# During day: Auto-sync important events\n# (configured in triggers)\n\n# Evening: Full sync\nmemos-sync sync --full --verbose\n\n# Verify sync\nmemos-sync verify --date $(date +%Y-%m-%d)\n```\n\n### Example 2: Recovery Workflow\n```bash\n# Local memory corruption - restore from MemOS\nmemos-sync pull --type daily_notes --date 2026-04-01\nmemos-sync pull --type learnings --all\nmemos-sync pull --type preferences\n\n# Verify restoration\nmemos-sync verify --local --remote\n```\n\n### Example 3: Collaborative Workflow\n```bash\n# Share memories with team\nmemos-sync share --tag \"team_project\" --users \"user1,user2\"\n\n# Get team memories\nmemos-sync pull --shared --tag \"team_project\"\n\n# Merge team insights\nmemos-sync merge --source team --strategy intelligent\n```\n\n### Example 4: Search Across All Memories\n```bash\n# Search local and remote memories\nmemos-sync search \"OpenClaw技能安装\" --global\n\n# Search with filters\nmemos-sync search \"记忆同步\" --type learning --date \"2026-03-01..2026-04-01\"\n\n# Get suggestions\nmemos-sync suggest --context \"MemOS API\"\n```\n\n## Advanced Features\n\n### 1. Memory Compression & Optimization\n```bash\n# Compress old memories\nmemos-sync compress --older-than 30\n\n# Remove duplicates\nmemos-sync deduplicate --auto\n\n# Optimize storage\nmemos-sync optimize --strategy balanced\n```\n\n### 2. Memory Analytics\n```bash\n# Get memory statistics\nmemos-sync stats --detailed\n\n# Analyze memory patterns\nmemos-sync analyze --pattern frequency\n\n# Export analytics\nmemos-sync export-analytics --format json --output stats.json\n```\n\n### 3. Backup & Migration\n```bash\n# Create backup\nmemos-sync backup --output backup.tar.gz\n\n# Migrate to new server\nmemos-sync migrate --new-server new.memos.example.com\n\n# Verify migration\nmemos-sync verify-migration --source old --target new\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Connection failed**\n   ```bash\n   # Check Tailscale connection\n   tailscale status\n   \n   # Test direct connection\n   curl -v http:\u002F\u002F100.106.127.15:8000\u002Fhealth\n   \n   # Check firewall rules\n   memos-sync diagnose --network\n   ```\n\n2. **Sync conflicts**\n   ```bash\n   # List conflicts\n   memos-sync conflicts --list\n   \n   # Resolve all conflicts\n   memos-sync conflicts --resolve-all --strategy merge\n   \n   # Manual resolution\n   memos-sync conflicts --interactive\n   ```\n\n3. **Performance issues**\n   ```bash\n   # Enable compression\n   memos-sync config set compression.enabled true\n   \n   # Reduce sync frequency\n   memos-sync config set sync.interval 600\n   \n   # Use smaller batches\n   memos-sync config set sync.batch_size 20\n   ```\n\n4. **Memory not found**\n   ```bash\n   # Rebuild index\n   memos-sync index --rebuild\n   \n   # Force resync\n   memos-sync push --force --all\n   \n   # Check mappings\n   memos-sync mappings --verify\n   ```\n\n## Security Considerations\n\n### Data Privacy\n```yaml\n# Privacy configuration\nprivacy:\n  # Never sync sensitive files\n  exclude_patterns:\n    - \"*password*\"\n    - \"*secret*\"\n    - \"*key*\"\n    - \"*token*\"\n    - \"*credential*\"\n  \n  # Encrypt sensitive memories\n  encryption:\n    enabled: true\n    algorithm: \"AES-256-GCM\"\n    \n  # Anonymize personal data\n  anonymize:\n    enabled: true\n    fields: [\"email\", \"phone\", \"address\"]\n```\n\n### Access Control\n```bash\n# Set memory privacy levels\nmemos-sync privacy set memory_id --level private\nmemos-sync privacy set memory_id --level shared --users user1,user2\nmemos-sync privacy set memory_id --level public\n\n# Audit access\nmemos-sync audit --user all --timeframe \"7d\"\n```\n\n---\n\n*\"记忆不是存储，而是连接。MemOS Sync确保你的每一个重要想法都不会丢失，并且可以在需要时被找到。\"*\n\n**记住**: 这个技能将你的本地记忆系统与中央MemOS数据库连接起来，创建了一个强大、可搜索、可共享的记忆生态系统。","# MemOS Sync — Centralized Memory Synchronization\n\n## Overview\n\nThis skill synchronizes OpenClaw's local memory system with a centralized **MemOS database** running at `100.106.127.15:8000` via Tailscale. It enables:\n\n1. **Centralized memory storage** — All memories in one searchable database\n2. **Cross-device access** — Access memories from any device\n3. **Collaborative memory** — Share memories across team members\n4. **Backup and recovery** — Never lose important memories\n5. **Advanced search** — Powerful semantic search across all memories\n\n## MemOS API Configuration\n\n### Base Configuration\n```yaml\n# ~\u002F.openclaw\u002Fworkspace\u002Fmemos-config.yaml\nmemos:\n  # MemOS server configuration\n  server:\n    base_url: \"http:\u002F\u002F100.106.127.15:8000\"\n    api_prefix: \"\u002Fproduct\"\n    timeout: 30\n    retry_attempts: 3\n    \n  # Authentication (if required)\n  auth:\n    enabled: false\n    token: \"\"\n    user_id: \"\"\n    \n  # Sync settings\n  sync:\n    auto_sync: true\n    sync_interval: 300  # seconds\n    batch_size: 50\n    max_file_size: 10485760  # 10MB\n    \n  # Memory types to sync\n  memory_types:\n    - daily_notes    # memory\u002FYYYY-MM-DD.md\n    - long_term      # MEMORY.md\n    - learnings      # memory\u002Flearnings\u002F*.md\n    - preferences    # memory\u002Fpreferences.md\n    - skills         # skills\u002F*\u002FSKILL.md (metadata only)\n    - events         # Important events and decisions\n    \n  # Conflict resolution\n  conflict_resolution: \"server_wins\"  # or: local_wins, merge, prompt\n```\n\n## Core Sync Operations\n\n### 1. Initial Setup & Health Check\n```bash\n# Test connection to MemOS\nmemos-sync health\n\n# Get server status\nmemos-sync status\n\n# Initialize sync configuration\nmemos-sync init --server 100.106.127.15:8000\n```\n\n### 2. One-Time Full Sync\n```bash\n# Sync all local memories to MemOS\nmemos-sync push --all\n\n# Sync specific memory types\nmemos-sync push --type daily_notes --date 2026-04-01\nmemos-sync push --type learnings --category technical\n\n# Sync with custom tags\nmemos-sync push --tag \"openclaw\" --tag \"skills\" --tag \"installation\"\n```\n\n### 3. Incremental Sync\n```bash\n# Sync new memories since last sync\nmemos-sync push --incremental\n\n# Sync recent daily notes\nmemos-sync push --recent 7  # Last 7 days\n\n# Sync only changed files\nmemos-sync push --changed\n```\n\n### 4. Pull from MemOS\n```bash\n# Pull memories from MemOS to local\nmemos-sync pull --all\n\n# Pull specific memory by ID\nmemos-sync pull --memory-id \"mem_abc123\"\n\n# Pull memories with specific tags\nmemos-sync pull --tag \"decision\" --tag \"important\"\n```\n\n### 5. Bidirectional Sync\n```bash\n# Full bidirectional sync\nmemos-sync sync --bidirectional\n\n# Sync with conflict resolution\nmemos-sync sync --resolve merge\n\n# Dry run (show what would be synced)\nmemos-sync sync --dry-run\n```\n\n## Memory Mapping\n\n### Local → MemOS Mapping\n```\nLocal Structure                    MemOS Structure\n---------------                    ---------------\nmemory\u002F2026-04-01.md              → Daily memory with date tag\nMEMORY.md                         → Long-term curated memories\nmemory\u002Flearnings\u002Fapi_errors.md    → Learning memory with category\nmemory\u002Fpreferences.md             → Preference memory\nskills\u002Fevolver\u002FSKILL.md           → Skill metadata\nworkspace\u002Fdecisions.json          → Decision memory\n```\n\n### Memory Metadata\n```json\n{\n  \"source\": \"openclaw\",\n  \"source_id\": \"local_memory_123\",\n  \"type\": \"daily_note|learning|preference|skill|event|decision\",\n  \"timestamp\": \"2026-04-01T09:31:00Z\",\n  \"created_at\": \"2026-04-01T08:00:00Z\",\n  \"updated_at\": \"2026-04-01T09:31:00Z\",\n  \"tags\": [\"openclaw\", \"skills\", \"installation\", \"memOS\"],\n  \"category\": \"technical|personal|work|learning\",\n  \"priority\": \"low|medium|high|critical\",\n  \"privacy\": \"private|shared|public\",\n  \"version\": 1,\n  \"checksum\": \"sha256:abc123...\"\n}\n```\n\n## API Integration Examples\n\n### 1. Health Check\n```python\ndef check_memos_health():\n    \"\"\"Check if MemOS server is healthy\"\"\"\n    response = requests.get(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fhealth\",\n        timeout=10\n    )\n    return response.status_code == 200\n```\n\n### 2. Add Memory\n```python\ndef add_memory_to_memos(content, metadata):\n    \"\"\"Add a memory to MemOS\"\"\"\n    payload = {\n        \"content\": content,\n        \"metadata\": metadata,\n        \"tags\": metadata.get(\"tags\", []),\n        \"category\": metadata.get(\"category\", \"general\"),\n        \"priority\": metadata.get(\"priority\", \"medium\")\n    }\n    \n    response = requests.post(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fadd\",\n        json=payload,\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json().get(\"memory_id\")\n    else:\n        raise Exception(f\"Failed to add memory: {response.text}\")\n```\n\n### 3. Search Memories\n```python\ndef search_memos(query, filters=None):\n    \"\"\"Search memories in MemOS\"\"\"\n    payload = {\n        \"query\": query,\n        \"filters\": filters or {},\n        \"limit\": 20,\n        \"offset\": 0\n    }\n    \n    response = requests.post(\n        \"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fsearch\",\n        json=payload,\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json().get(\"memories\", [])\n    else:\n        raise Exception(f\"Search failed: {response.text}\")\n```\n\n### 4. Get Memory by ID\n```python\ndef get_memory_by_id(memory_id):\n    \"\"\"Retrieve a specific memory\"\"\"\n    response = requests.get(\n        f\"http:\u002F\u002F100.106.127.15:8000\u002Fproduct\u002Fget_memory\u002F{memory_id}\",\n        timeout=30\n    )\n    \n    if response.status_code == 200:\n        return response.json()\n    elif response.status_code == 404:\n        return None\n    else:\n        raise Exception(f\"Failed to get memory: {response.text}\")\n```\n\n### 5. Batch Operations\n```python\ndef batch_add_memories(memories):\n    \"\"\"Add multiple memories in batch\"\"\"\n    responses = []\n    for memory in memories:\n        try:\n            memory_id = add_memory_to_memos(\n                memory[\"content\"],\n                memory[\"metadata\"]\n            )\n            responses.append({\n                \"success\": True,\n                \"memory_id\": memory_id,\n                \"source_id\": memory[\"metadata\"].get(\"source_id\")\n            })\n        except Exception as e:\n            responses.append({\n                \"success\": False,\n                \"error\": str(e),\n                \"source_id\": memory[\"metadata\"].get(\"source_id\")\n            })\n    return responses\n```\n\n## Sync Strategies\n\n### Strategy 1: Real-time Sync\n```yaml\n# Sync immediately when important events occur\ntriggers:\n  - memory file created or modified\n  - skill installed or updated\n  - important decision made\n  - learning captured\n  - preference changed\n```\n\n### Strategy 2: Scheduled Sync\n```bash\n# Cron job for regular sync\n# Every 5 minutes\n*\u002F5 * * * * memos-sync sync --incremental\n\n# Daily full sync at 2 AM\n0 2 * * * memos-sync sync --full\n\n# Weekly cleanup and optimization\n0 3 * * 0 memos-sync optimize --cleanup\n```\n\n### Strategy 3: Event-driven Sync\n```python\n# Example: Sync when daily note is completed\ndef on_daily_note_completed(date, content):\n    \"\"\"Sync daily note to MemOS\"\"\"\n    metadata = {\n        \"type\": \"daily_note\",\n        \"date\": date,\n        \"tags\": [\"daily\", \"log\", date],\n        \"category\": \"personal\",\n        \"priority\": \"medium\"\n    }\n    \n    memory_id = add_memory_to_memos(content, metadata)\n    \n    # Store mapping for future reference\n    store_mapping(f\"daily_{date}\", memory_id)\n    \n    return memory_id\n```\n\n## Conflict Resolution\n\n### Resolution Strategies\n```python\ndef resolve_conflict(local_memory, remote_memory, strategy=\"server_wins\"):\n    \"\"\"Resolve sync conflicts\"\"\"\n    \n    if strategy == \"server_wins\":\n        return remote_memory\n        \n    elif strategy == \"local_wins\":\n        return local_memory\n        \n    elif strategy == \"merge\":\n        # Merge content intelligently\n        merged = merge_memories(local_memory, remote_memory)\n        return merged\n        \n    elif strategy == \"prompt\":\n        # Ask user to resolve\n        resolution = prompt_user_resolution(local_memory, remote_memory)\n        return resolution\n        \n    elif strategy == \"new_version\":\n        # Create new version with both\n        return create_merged_version(local_memory, remote_memory)\n```\n\n### Merge Algorithm\n```python\ndef merge_memories(local_mem, remote_mem):\n    \"\"\"Intelligently merge two memories\"\"\"\n    \n    # Use newer content as base\n    if local_mem[\"updated_at\"] > remote_mem[\"updated_at\"]:\n        base = local_mem.copy()\n        other = remote_mem\n    else:\n        base = remote_mem.copy()\n        other = local_mem\n    \n    # Merge tags (unique)\n    base_tags = set(base.get(\"tags\", []))\n    other_tags = set(other.get(\"tags\", []))\n    base[\"tags\"] = list(base_tags.union(other_tags))\n    \n    # Merge metadata\n    for key in [\"category\", \"priority\", \"privacy\"]:\n        if key in other and key not in base:\n            base[key] = other[key]\n    \n    # Add merge note\n    if \"content\" in base and \"content\" in other:\n        merge_note = f\"\\n\\n---\\n*Merged from local and remote versions*\"\n        base[\"content\"] += merge_note\n    \n    return base\n```\n\n## Integration with OpenClaw Memory System\n\n### Ready-to-Use Implementation\nA complete MemOS sync implementation is available in your workspace:\n\n```bash\n# Location of implementation files\nls ~\u002F.openclaw\u002Fworkspace\u002Fscripts\u002Fmemos_*\n\n# Files included:\n# 1. memos_sync.py          - Main sync script\n# 2. memos_sync_config.yaml - Configuration\n# 3. memos_sync_usage.md    - Usage instructions\n# 4. start_memos_sync.bat   - Windows batch script\n```\n\n### Quick Test\n```bash\n# Test connection to MemOS server\ncd ~\u002F.openclaw\u002Fworkspace\u002Fscripts\npython memos_sync.py --health\n\n# First full sync\npython memos_sync.py --full\n\n# Or use the batch script (Windows)\nstart_memos_sync.bat health\nstart_memos_sync.bat full\n```\n\n### Integration with Daily Workflow\nAdd to your HEARTBEAT.md or create a cron job:\n\n```bash\n# Add to HEARTBEAT.md\n- Check MemOS sync status and sync if needed\n\n# Cron job for automatic sync (every 5 minutes)\n*\u002F5 * * * * cd ~\u002F.openclaw\u002Fworkspace\u002Fscripts && python memos_sync.py --incremental\n```\n\n### Automatic Sync Triggers\n```python\n# Sync triggers for different memory types\nSYNC_TRIGGERS = {\n    \"memory\u002F*.md\": {\n        \"priority\": \"medium\",\n        \"delay\": 60,  # seconds\n        \"batch\": True\n    },\n    \"MEMORY.md\": {\n        \"priority\": \"high\",\n        \"delay\": 10,\n        \"batch\": False\n    },\n    \"memory\u002Flearnings\u002F*.md\": {\n        \"priority\": \"high\",\n        \"delay\": 30,\n        \"batch\": True\n    },\n    \"memory\u002Fpreferences.md\": {\n        \"priority\": \"high\",\n        \"delay\": 5,\n        \"batch\": False\n    }\n}\n```\n\n## Usage Examples\n\n### Example 1: Daily Sync Workflow\n```bash\n# Morning: Check sync status\nmemos-sync status\n\n# During day: Auto-sync important events\n# (configured in triggers)\n\n# Evening: Full sync\nmemos-sync sync --full --verbose\n\n# Verify sync\nmemos-sync verify --date $(date +%Y-%m-%d)\n```\n\n### Example 2: Recovery Workflow\n```bash\n# Local memory corruption - restore from MemOS\nmemos-sync pull --type daily_notes --date 2026-04-01\nmemos-sync pull --type learnings --all\nmemos-sync pull --type preferences\n\n# Verify restoration\nmemos-sync verify --local --remote\n```\n\n### Example 3: Collaborative Workflow\n```bash\n# Share memories with team\nmemos-sync share --tag \"team_project\" --users \"user1,user2\"\n\n# Get team memories\nmemos-sync pull --shared --tag \"team_project\"\n\n# Merge team insights\nmemos-sync merge --source team --strategy intelligent\n```\n\n### Example 4: Search Across All Memories\n```bash\n# Search local and remote memories\nmemos-sync search \"OpenClaw技能安装\" --global\n\n# Search with filters\nmemos-sync search \"记忆同步\" --type learning --date \"2026-03-01..2026-04-01\"\n\n# Get suggestions\nmemos-sync suggest --context \"MemOS API\"\n```\n\n## Advanced Features\n\n### 1. Memory Compression & Optimization\n```bash\n# Compress old memories\nmemos-sync compress --older-than 30\n\n# Remove duplicates\nmemos-sync deduplicate --auto\n\n# Optimize storage\nmemos-sync optimize --strategy balanced\n```\n\n### 2. Memory Analytics\n```bash\n# Get memory statistics\nmemos-sync stats --detailed\n\n# Analyze memory patterns\nmemos-sync analyze --pattern frequency\n\n# Export analytics\nmemos-sync export-analytics --format json --output stats.json\n```\n\n### 3. Backup & Migration\n```bash\n# Create backup\nmemos-sync backup --output backup.tar.gz\n\n# Migrate to new server\nmemos-sync migrate --new-server new.memos.example.com\n\n# Verify migration\nmemos-sync verify-migration --source old --target new\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Connection failed**\n   ```bash\n   # Check Tailscale connection\n   tailscale status\n   \n   # Test direct connection\n   curl -v http:\u002F\u002F100.106.127.15:8000\u002Fhealth\n   \n   # Check firewall rules\n   memos-sync diagnose --network\n   ```\n\n2. **Sync conflicts**\n   ```bash\n   # List conflicts\n   memos-sync conflicts --list\n   \n   # Resolve all conflicts\n   memos-sync conflicts --resolve-all --strategy merge\n   \n   # Manual resolution\n   memos-sync conflicts --interactive\n   ```\n\n3. **Performance issues**\n   ```bash\n   # Enable compression\n   memos-sync config set compression.enabled true\n   \n   # Reduce sync frequency\n   memos-sync config set sync.interval 600\n   \n   # Use smaller batches\n   memos-sync config set sync.batch_size 20\n   ```\n\n4. **Memory not found**\n   ```bash\n   # Rebuild index\n   memos-sync index --rebuild\n   \n   # Force resync\n   memos-sync push --force --all\n   \n   # Check mappings\n   memos-sync mappings --verify\n   ```\n\n## Security Considerations\n\n### Data Privacy\n```yaml\n# Privacy configuration\nprivacy:\n  # Never sync sensitive files\n  exclude_patterns:\n    - \"*password*\"\n    - \"*secret*\"\n    - \"*key*\"\n    - \"*token*\"\n    - \"*credential*\"\n  \n  # Encrypt sensitive memories\n  encryption:\n    enabled: true\n    algorithm: \"AES-256-GCM\"\n    \n  # Anonymize personal data\n  anonymize:\n    enabled: true\n    fields: [\"email\", \"phone\", \"address\"]\n```\n\n### Access Control\n```bash\n# Set memory privacy levels\nmemos-sync privacy set memory_id --level private\nmemos-sync privacy set memory_id --level shared --users user1,user2\nmemos-sync privacy set memory_id --level public\n\n# Audit access\nmemos-sync audit --user all --timeframe \"7d\"\n```\n\n---\n\n*\"记忆不是存储，而是连接。MemOS Sync确保你的每一个重要想法都不会丢失，并且可以在需要时被找到。\"*\n\n**记住**: 这个技能将你的本地记忆系统与中央MemOS数据库连接起来，创建了一个强大、可搜索、可共享的记忆生态系统。",{"name":5,"description":7},"main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fhermes\u002Fmemos-sync","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill memos-sync",{"tool":55,"command":56},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill memos-sync",{"tool":58,"command":59},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill memos-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fhermes\u002Fmemos-sync\u002FSKILL.md",true,[],[64,74,81,89,95,103],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":69,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":73},"01M72R8PZX1ABFHJGTYPA4CAF1","webapp-testing","To test local web applications, write native Python Playwright scripts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":73},"01M72QG37MMZNDY7X7GXPAK5W6","python-packaging","Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fpython-packaging\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":73},"01M72NXR0QMP9G46TW6A2DH59C","canvas-design","These are instructions for creating design philosophies - aesthetic movements that are then EXPRESSED VISUALLY. Output only .md files, .pdf files, and .png files.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FSKILL.md",[],[],{"skillNo":90,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":91,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":73},"01M72N55TK3EEQ4QK4AWDC2KZS","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":99,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":73},"01M72MTWC150CFAP4Y5GSNKF80","slack-gif-creator","A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":73},"01M72KPT3VVNSP88MNAY466TZT","frontend-design","You are a frontend designer-engineer, not a layout generator.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FSKILL.md",[],[]]