From 670b0c7bef577bfce8f60035d2311185ff973242 Mon Sep 17 00:00:00 2001 From: zlei9 Date: Sun, 29 Mar 2026 09:37:21 +0800 Subject: [PATCH] Initial commit with translated description --- SKILL.md | 80 +++++++++++++++++++++++++++++++++++++++++++ _meta.json | 6 ++++ scripts/add-memory.sh | 60 ++++++++++++++++++++++++++++++++ scripts/chat.sh | 70 +++++++++++++++++++++++++++++++++++++ scripts/search.sh | 49 ++++++++++++++++++++++++++ 5 files changed, 265 insertions(+) create mode 100644 SKILL.md create mode 100644 _meta.json create mode 100644 scripts/add-memory.sh create mode 100644 scripts/chat.sh create mode 100644 scripts/search.sh diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..6972093 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,80 @@ +--- +name: supermemory +description: "使用SuperMemory API存储和检索记忆。添加内容、搜索记忆,并与您的知识库聊天。" +metadata: {"moltbot":{"emoji":"🧠","requires":{"env":["SUPERMEMORY_API_KEY"]},"primaryEnv":"SUPERMEMORY_API_KEY"},"user-invocable":true} +--- + +# SuperMemory + +Store, search, and chat with your personal knowledge base using SuperMemory's API. + +## Setup + +Configure your SuperMemory API key: +```bash +export SUPERMEMORY_API_KEY="sm_oiZHA2HcwT4tqSKmA7cCoK_opSRFViNFNxbYqjkjpVNfjSPqQWCNoOBAcxKZkKBfRVVrEQDVxLWHJPvepxqwEPe" +``` + +## Usage + +### Add a Memory + +**Add content to your memory store:** +```bash +# Add a memory with content +supermemory add "Your memory content here" + +# Add a memory with a specific description +supermemory add "Important project details" --description "Project requirements" +``` + +### Search Memories + +**Search your stored memories:** +```bash +supermemory search "search query" +``` + +### Chat with Memories + +**Chat with your memory database:** +```bash +supermemory chat "What do you know about my projects?" +``` + +## Implementation + +### Add Memory + +When user wants to store information: +```bash +bash /root/clawd/skills/supermemory/scripts/add-memory.sh "content" "description (optional)" +``` + +### Search Memories + +When user wants to find something in their memories: +```bash +bash /root/clawd/skills/supermemory/scripts/search.sh "query" +``` + +### Chat with Memory Base + +When user wants to query their memory database conversationally: +```bash +bash /root/clawd/skills/supermemory/scripts/chat.sh "question" +``` + +## Examples + +**Store important information:** +- "Remember that my API key is xyz" → `supermemory add "My API key is xyz" --description "API credentials"` +- "Save this link for later" → `supermemory add "https://example.com" --description "Bookmarked link"` + +**Find information:** +- "What did I save about Python?" → `supermemory search "Python"` +- "Find my notes on the project" → `supermemory search "project notes"` + +**Query your knowledge:** +- "What do I know about the marketing strategy?" → `supermemory chat "What do I know about the marketing strategy?"` +- "Summarize what I've learned about AI" → `supermemory chat "Summarize what I've learned about AI"` diff --git a/_meta.json b/_meta.json new file mode 100644 index 0000000..9b721ea --- /dev/null +++ b/_meta.json @@ -0,0 +1,6 @@ +{ + "ownerId": "kn77af2r1sj476crn32d2z6q7d803xgh", + "slug": "supermemory", + "version": "1.0.0", + "publishedAt": 1769623551710 +} \ No newline at end of file diff --git a/scripts/add-memory.sh b/scripts/add-memory.sh new file mode 100644 index 0000000..b60590d --- /dev/null +++ b/scripts/add-memory.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# SuperMemory - Add Memory Script +# Usage: add-memory.sh "content" "description (optional)" + +set -e + +CONTENT="$1" +DESCRIPTION="$2" + +if [ -z "$CONTENT" ]; then + echo "Error: No content provided" + echo "Usage: add-memory.sh \"content\" \"description (optional)\"" + exit 1 +fi + +API_KEY="${SUPERMEMORY_API_KEY}" +if [ -z "$API_KEY" ]; then + echo "Error: SUPERMEMORY_API_KEY environment variable not set" + echo "Please set it with: export SUPERMEMORY_API_KEY=\"your-api-key\"" + exit 1 +fi + +# Sanitize description: replace spaces with hyphens, keep only alphanumeric, hyphens, underscores +SANITIZED_DESC=$(echo "${DESCRIPTION:-clawdbot}" | tr -cd '[:alnum:]-_' | tr '[:upper:]' '[:lower:]') + +# SuperMemory API endpoint (using the direct API) +API_URL="https://api.supermemory.ai/v3/documents" + +# Prepare the request +DATA=$(cat </dev/null || echo "$RESPONSE" diff --git a/scripts/search.sh b/scripts/search.sh new file mode 100644 index 0000000..a47bbb2 --- /dev/null +++ b/scripts/search.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# SuperMemory - Search Memories Script +# Usage: search.sh "search query" + +set -e + +QUERY="$1" + +if [ -z "$QUERY" ]; then + echo "Error: No search query provided" + echo "Usage: search.sh \"search query\"" + exit 1 +fi + +API_KEY="${SUPERMEMORY_API_KEY}" +if [ -z "$API_KEY" ]; then + echo "Error: SUPERMEMORY_API_KEY environment variable not set" + echo "Please set it with: export SUPERMEMORY_API_KEY=\"your-api-key\"" + exit 1 +fi + +# SuperMemory API search endpoint +API_URL="https://api.supermemory.ai/v3/search" + +# Prepare the request +DATA=$(cat </dev/null || echo "$RESPONSE"