Skip to content

Latest commit

 

History

History
211 lines (138 loc) · 6.19 KB

File metadata and controls

211 lines (138 loc) · 6.19 KB

MemOS Cloud Skill

English | 中文

This repository contains two complementary skills for the MemOS Cloud platform:

Skill Purpose Install
memos-cloud-server Runtime CLI — Agent calls MemOS APIs directly (search, add, delete, feedback) npx skills add https://github.com/MemTensor/MemOS-Cloud-Skill/memos-cloud-server
memos-cloud-developer Developer guide — helps developers write integration code via natural language npx skills add https://github.com/MemTensor/MemOS-Cloud-Skill --skill memos-cloud-developer --agent cursor -g -y

memos-cloud-server

MemOS Cloud Server API skill. This skill allows Agents or developers to directly call the MemOS Cloud Platform API to retrieve, add, delete, upload, and feedback on memories.

Prerequisites

  • Python: 3.x and above
  • Python Dependencies: requests module (pip3 install requests)

Install

Option A — Command Line (Recommended)

Install from GitHub:

npx skills add https://github.com/MemTensor/MemOS-Cloud-Skill/memos-cloud-server

Option B — Local Path

  1. Clone this repository to your local machine:
    git clone https://github.com/MemTensor/MemOS-Cloud-Skill.git
  2. Install from the local skill directory:
    npx skills add ./MemOS-Cloud-Skill/memos-cloud-server

Environment Variables

This step is critical. You must configure these variables before using the skill.

Where to configure

  • You can configure these globally in your system environment (e.g., ~/.bashrc, ~/.zshrc).
  • Or, you can configure them within your specific AI Agent or framework's environment settings (e.g., .env files for OpenClaw/Moltbot/Clawdbot).

Required

  • MEMOS_API_KEY (required; Token auth) — get it at MemOS API Console
  • MEMOS_USER_ID (required; A deterministic user-defined personal identifier, e.g., hashed email, employee ID) — Do not use random or session IDs.
MEMOS_API_KEY=YOUR_TOKEN
MEMOS_USER_ID=YOUR_USER_ID

Optional

  • MEMOS_CLOUD_URL — API base URL (default: https://memos.memtensor.cn/api/openmem/v1)
  • MEMOS_AGENT_ID — Agent identifier for multi-agent scenarios
  • MEMOS_APP_ID — Application identifier for multi-app scenarios
  • MEMOS_ALLOW_PUBLIC — Allow public memory access, true/false (default: false)
  • MEMOS_ASYNC_MODE — Enable async memory addition, true/false (default: true)
MEMOS_CLOUD_URL=https://memos.memtensor.cn/api/openmem/v1
MEMOS_AGENT_ID=your-agent-id
MEMOS_APP_ID=your-app-id
MEMOS_ALLOW_PUBLIC=false
MEMOS_ASYNC_MODE=true

Quick setup (shell)

echo 'export MEMOS_API_KEY="mpg-..."' >> ~/.bashrc
echo 'export MEMOS_USER_ID="user-123"' >> ~/.bashrc
source ~/.bashrc

Quick setup (Windows PowerShell)

[System.Environment]::SetEnvironmentVariable("MEMOS_API_KEY", "mpg-...", "User")
[System.Environment]::SetEnvironmentVariable("MEMOS_USER_ID", "user-123", "User")

Commands

1. Search Memory

Search for long-term memories relevant to a query.

python3 scripts/memos_cloud.py search [user_id] "<query>" [options]

Options: --conversation-id, --conversation-first-message, --filter, --knowledgebase-ids, --memory-limit-number, --include-preference, --preference-limit-number, --include-tool-memory, --tool-memory-limit-number, --include-skill, --skill-limit-number, --relativity

2. Add Message

Store high-value content from conversations.

python3 scripts/memos_cloud.py add_message [user_id] [conversation_id] '<messages_json>' [options]

Options: --conversation-first-message, --tags, --info, --allow-knowledgebase-ids

3. Delete Memory

Delete stored memories by IDs.

python3 scripts/memos_cloud.py delete "id1,id2,id3"

4. Add Feedback

Add feedback to correct or reinforce memory.

python3 scripts/memos_cloud.py add_feedback [user_id] <conversation_id> "<feedback>" [options]

Options: --allow-knowledgebase-ids, --feedback-time

5. Add Knowledge Base Document

Upload files to a knowledge base.

python3 scripts/memos_cloud.py add_kb_doc <knowledgebase_id> <file1> [file2 ...] [--type document|skill]
python3 scripts/memos_cloud.py add_kb_doc <knowledgebase_id> --stdin [--name filename.ext] [--type document|skill]

6. Get User Profile

Retrieve the consolidated User Memory Profile.

python3 scripts/memos_cloud.py get_user_profile [user_id] [options]

Options: --page, --size, --filter, --include-preference, --include-tool-memory

7. Create Knowledge Base

Create a named container for structured documents.

python3 scripts/memos_cloud.py create_kb "<name>" [--description "<desc>"]

8. Get Knowledge Base Documents

Get document metadata/details. Two modes (mutually exclusive):

python3 scripts/memos_cloud.py get_kb_docs --file-ids "id1,id2"
python3 scripts/memos_cloud.py get_kb_docs --knowledgebase-id "kb-1" [--type document|skill] [--page 1] [--page-size 20]

9. Delete Knowledge Base Documents

Delete documents from a knowledge base.

python3 scripts/memos_cloud.py delete_kb_docs "file-id-1,file-id-2"

10. Remove Knowledge Base

Remove a knowledge base from the project.

python3 scripts/memos_cloud.py remove_kb "kb-123"

Direct Script Usage

For repository-local testing before installation:

python3 memos-cloud-server/scripts/memos_cloud.py --help

memos-cloud-developer

Developer assistant skill that helps integrate MemOS Cloud API/SDK into your applications. It provides documentation guidance and generates runnable code through natural language interaction.

Install

npx skills add https://github.com/MemTensor/MemOS-Cloud-Skill --skill memos-cloud-developer --agent cursor -g -y

What it does

  • Guides developers through MemOS Cloud API integration (addMessage, searchMemory, Chat, etc.)
  • Generates Python SDK / HTTP / cURL code examples on demand
  • Covers features: Knowledge Base, Tool Memory, Multimodal, Filters, Skill, Async Mode
  • Auto-updates its documentation via scripts/upgrade.py