[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71ASJCEH8WX8JDDMTJNB1MT":3,"skill-same:01M71ASJCEH8WX8JDDMTJNB1MT":68},{"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":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":14,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M71ASJCEH8WX8JDDMTJNB1MT","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\u002Fopenclaw\u002Fmemos-sync\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"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\u002Fopenclaw\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":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill memos-sync",{"tool":60,"command":61},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill memos-sync",{"tool":63,"command":64},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill memos-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fmemos-sync\u002FSKILL.md",true,[],[69,92,118,128,141,157],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":80,"publishedAt":43},"01M71ATQRKG48SH06FQ697T5G9","wechat-search","Search WeChat Official Account articles using OpenClaw's web search and fetch capabilities with compliance-focused design.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fwechat-search-release\u002FSKILL.md",[75],{"categoryNo":76,"categoryName":77,"taxonomyType":78,"taxonomyTypeDesc":79},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[81,82,83,84,33,85,86,87,88,89,90,91],"wechat search","wechat","search","capabilities","design","web search","compliance","web","official","fetch","with",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":43},"01M71ATNAVGZB35PFYM2GC5N00","trend-tap","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend tap', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-tap\u002FSKILL.md",[],[99,100,101,102,103,104,83,105,106,107,108,109,110,111,112,113,114,115,116,117],"trend","trend tap","tap","api keys","Bash","time","trending","hacker","aggregator","do","when","brew","live","data","google","install","read","across","api",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":43},"01M71ATJ9AM5KM15AA8PS302EB","trend-radar","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend pulse', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-radar\u002FSKILL.md",[],[125,126,99,110,111,112,113,103,83,115,127,116,117,109,107,106,105,114,104,102],"trend radar","radar","pulse",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":43},"01M71ATGF095N3EJM9G8SD0BB5","tech-news-daily","每日科技新闻汇——从全球多个 RSS 源抓取最新科技新闻，翻译（英→中）、去重、排版成每日简报。当用户询问科技新闻、科技新鲜事、每日科技、技术动态、Daily Tech News 或类似表达时触发此技能。","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftech-news-daily\u002FSKILL.md",[],[135,136,137,138,139,140],"news","tech","tech news daily","daily","rss","翻译",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":150,"publishedAt":43},"01M71ATFAEAMQ17M70NQNY7SR8","summarize","Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsummarize\u002FSKILL.md",[147],{"categoryNo":148,"categoryName":149,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[143,88,151,152,153,91,110,154,155,39,101,156,114],"Audio","cli","youtube","images","https","pdfs",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":43},"01M71ATDNS3R0M4H936PACQAWZ","sonoscli","Control Sonos speakers (discover\u002Fstatus\u002Fplay\u002Fvolume\u002Fgroup).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsonoscli\u002FSKILL.md",[],[159,164,165,166,114,167,155,168,169,170,171,172],"status","play","go","latest","github","discover","control","cmd","volume"]