alibabacloud-tablestore-openclaw-memory
Original:🇺🇸 English
Translated
This skill installs and configures the **Tablestore Mem0** plugin for OpenClaw. Tablestore Mem0 uses Alibaba Cloud Tablestore as the vector store backend for mem0, providing persistent long-term memory for AI agents. Use this skill when the user wants OpenClaw to persist or manage long-term memory using Alibaba Cloud Tablestore as the backend. Triggers: "set up tablestore memory", "install tablestore mem0 plugin", "configure long-term memory with tablestore", "remember this".
4installs
Added on
NPX Install
npx skill4agent add aliyun/alibabacloud-aiops-skills alibabacloud-tablestore-openclaw-memoryTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Prerequisites
The user must have:
- An Alibaba Cloud account
- Credentials — AccessKey ID + Secret (with permission) or ECS RAM Role (recommended on ECS)
AliyunOTSFullAccess - An 阿里云百炼 API Key (for Qwen LLM and embedding)
- Optional: existing Tablestore instance endpoint + instance name (otherwise auto-created)
- Optional: region ID for auto-provisioning (defaults to )
cn-hangzhou
📋 RAM Permissions: See references/ram-policies.md for the complete list of required API permissions.
Definition of Done
This task is NOT complete until all of the following are true:
- User has provided credentials
- Plugin is installed (version 0.8.2)
- is configured correctly
openclaw.json - OpenClaw is restarted
- Setup is verified (plugin loads without errors)
Onboarding
Step 0 — Collect credentials
[AGENT]To set up Tablestore Mem0, I need:Required:
- Alibaba Cloud AccessKey ID
- Alibaba Cloud AccessKey Secret
- 阿里云百炼 API Key
Optional (if you have an existing Tablestore instance): 4. Tablestore endpoint (e.g.) 5. Tablestore instance namehttps://my-instance.cn-hangzhou.ots.aliyuncs.comIf you don't provide an endpoint and instance name, I'll automatically create a new Tablestore instance. In that case, I need: 6. Region ID (e.g.,cn-hangzhou)cn-shanghai
Ask the user:
Question 1 — Authentication: How would you like to authenticate?
- Option A: ECS RAM Role (recommended on ECS) — Provide the role name.
- Option B: AccessKey — Provide AccessKey ID and Secret.
Question 2 — Tablestore instance: Do you already have a Tablestore instance?
- Yes → Provide endpoint and instance name.
- No → Provide region ID for auto-provisioning.
⚠️ HIGH-RISK OPERATION — Pre-flight Confirmation:
If the user answers No, the agent MUST:
-
Explicit Confirmation:⚠️ This setup will create a new Tablestore instance in your Alibaba Cloud account.
- Instance type: VCU (pay-as-you-go, typically under ¥1/month)
- Region: as specified Do you confirm? (yes/no)
-
Double-check:Please verify in Tablestore Console () that you don't have existing instances.
https://ots.console.aliyun.com/
Do NOT proceed until the user explicitly confirms.
If the user is missing credentials, point them to:
- Alibaba Cloud sign-up:
https://account.alibabacloud.com/register/intl_register.htm - AccessKey creation:
https://ram.console.aliyun.com/manage/ak - 阿里云百炼 API Key:
https://dashscope.console.aliyun.com/apiKey
Setting up ECS RAM Role (if the user chose Option A)
- Attach a RAM role to the ECS instance — Documentation
- Grant the role — Reference
AliyunOTSFullAccess
Step 1 — Install plugin
Plugin version:
0.8.2⚠️ External Package Installation Notice:
This skill will installfrom npm registry. By proceeding, you acknowledge installing an external package. Do you consent? (yes/no)@tablestore/openclaw-mem0@0.8.2
Wait for user confirmation, then:
bash
NPMJS_TIME="$(curl -o /dev/null -sS --connect-timeout 2 --max-time 6 -w '%{time_total}' https://registry.npmjs.org/@tablestore%2fopenclaw-mem0 || echo timeout)"
MIRROR_TIME="$(curl -o /dev/null -sS --connect-timeout 2 --max-time 6 -w '%{time_total}' https://registry.npmmirror.com/@tablestore%2fopenclaw-mem0 || echo timeout)"
if [ "$MIRROR_TIME" != "timeout" ] && { [ "$NPMJS_TIME" = "timeout" ] || awk "BEGIN { exit !($NPMJS_TIME > 2 && $MIRROR_TIME < $NPMJS_TIME) }"; }; then
echo "Using China npm mirror"
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com openclaw plugins install @tablestore/openclaw-mem0@0.8.2
else
openclaw plugins install @tablestore/openclaw-mem0@0.8.2
fiIf , fallback to manual install:
extract tar timed outbash
cd /tmp && npm pack @tablestore/openclaw-mem0@0.8.2
mkdir -p /tmp/openclaw-mem0-install
tar xzf /tmp/tablestore-openclaw-mem0-*.tgz -C /tmp/openclaw-mem0-install --strip-components=1
openclaw plugins install /tmp/openclaw-mem0-installStep 2 — Detect OpenClaw version
bash
openclaw --version- Version → use Step 3A
>= 2.2.0 - Version → use Step 3B (remove
< 2.2.0line).plugins.allow
Step 3 — Configure openclaw.json
Detect config file path:
bash
OPENCLAW_CONFIG="$(openclaw config file 2>/dev/null | head -1)"
OPENCLAW_CONFIG="${OPENCLAW_CONFIG/#\~/$HOME}"
echo "Config file: $OPENCLAW_CONFIG"⚠️ Credential Security (REQUIRED):
ALWAYS prefer environment variables:
bash
export TABLESTORE_ACCESS_KEY_ID="<your-access-key-id>"
export TABLESTORE_ACCESS_KEY_SECRET="<your-access-key-secret>"
export DASHSCOPE_API_KEY="<your-dashscope-api-key>"⚠️ Input Validation (REQUIRED):
| Input | Validation Rule |
|---|---|
| AccessKey ID | Regex: |
| AccessKey Secret | Alphanumeric, ~30 chars |
| Region ID | Regex: |
| Endpoint | Regex: |
| Instance Name | Regex: |
⚠️ Embedder/LLM provider MUST be with baseURL , NOT .
"openai""https://dashscope.aliyuncs.com/compatible-mode/v1""dashscope"Step 3A — OpenClaw ≥2.2.0
| Auth method | Has existing instance? | |
|---|---|---|
| AccessKey | No | |
| AccessKey | Yes | |
| ECS RAM Role | No | |
| ECS RAM Role | Yes | |
Template (AccessKey auth + auto-create):
bash
jq '
.plugins.slots.memory = "openclaw-mem0" |
.plugins.entries["openclaw-mem0"] = {
enabled: true,
config: {
mode: "open-source",
oss: {
vectorStore: {
provider: "tablestore",
config: {
accessKeyId: "${TABLESTORE_ACCESS_KEY_ID}",
accessKeySecret: "${TABLESTORE_ACCESS_KEY_SECRET}",
regionId: "cn-hangzhou"
}
},
embedder: {
provider: "openai",
config: {
apiKey: "${DASHSCOPE_API_KEY}",
model: "text-embedding-v3",
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
}
},
llm: {
provider: "openai",
config: {
apiKey: "${DASHSCOPE_API_KEY}",
model: "qwen-plus",
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
}
}
}
}
} |
.plugins.allow = ((.plugins.allow // []) + ["openclaw-mem0"] | unique)
' "$OPENCLAW_CONFIG" > /tmp/openclaw-tmp.json && mv /tmp/openclaw-tmp.json "$OPENCLAW_CONFIG"For existing instance: replace with and .
For ECS RAM Role: replace / with .
regionIdendpointinstanceNameaccessKeyIdaccessKeySecretroleNameStep 3B — OpenClaw <2.2.0
Same as Step 3A but remove the line.
.plugins.allowStep 4 — Restart OpenClaw
bash
openclaw gateway restartWait ~1 minute for the gateway to restart.
Step 5 — Verify setup
bash
openclaw mem0 statsSuccess criteria: plugin loads without errors, shows mode and memory count.
Step 6 — Handoff
✅ Tablestore Mem0 is ready.
Your memory is now backed by Alibaba Cloud Tablestore.
The plugin will automatically recall relevant memories before each conversation
and capture key facts after each conversation.
Manual commands: "remember this" / "what do you know about me?" / "forget that"
Configuration: Tablestore vector store + 阿里云百炼 text-embedding-v3 + Qwen-Plus
Instance: <auto-created or user-provided>
Security: Prefer ECS RAM Role on ECS. Never commit credentials to version control.Configuration Reference
| Parameter | Required | Default | Description |
|---|---|---|---|
| No* | — | AccessKey ID (or env |
| No* | — | AccessKey Secret (or env |
| No* | — | ECS RAM Role name (or env |
| No | Auto-created | Tablestore instance endpoint |
| No | Auto-created | Tablestore instance name |
| No | | Region for auto-provisioning |
| No | | Data table name |
| No | | Vector dimension |
*Required unless is set.
roleNameAuto-provisioning
When / not provided, creates VCU instance with:
endpointinstanceName- VCU=0 (pay-as-you-go)
- Auto-enables public internet access if VPC unreachable
Troubleshooting
| Symptom | Fix |
|---|---|
| Plugin not loading | Check |
| Verify AccessKey is correct and account is active |
| Auto-provisioning fails | Ensure AccessKey has |
| Embedding errors | Verify |
| VPC endpoint unreachable | Plugin auto-enables public access; verify |
| Use manual fallback: |
Provider shows | Change provider to |
Update
Do not set up automatic updates. Only update when explicitly requested.