Mem0

Intelligent memory layer for Clawdbot using Mem0. Provides semantic search and automatic storage of user preferences, patterns, and context across conversati...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
2 · 1.3k · 14 current installs · 16 all-time installs
byAbhay Bhat@abhayjb
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
high confidence
!
Purpose & Capability
The skill's name/description match the code: it implements a mem0 memory layer. However the registry metadata claims no required env vars and no required binaries, while the scripts and SKILL.md clearly require Node.js and an OPENAI_API_KEY. That mismatch is unexplained and disproportionate to the documented purpose (the skill legitimately needs the OpenAI key and node runtime but failed to declare them).
Instruction Scope
SKILL.md instructions stay on-topic (search before responding, add/list/delete memories). They instruct running the included Node scripts which call mem0 APIs and use the OPENAI_API_KEY for embeddings and extraction. Instructions also instruct storing a SQLite DB under ~/.mem0/history.db; that's within scope for a memory layer but is a persistence and privacy consideration. There are no obvious instructions to read unrelated system files or exfiltrate data to unexpected endpoints.
!
Install Mechanism
This is marked as an instruction-only skill (no install spec), yet the package.json/package-lock and scripts indicate Node code with an npm dependency (mem0ai). The skill does not declare that Node or npm must be available, nor does it provide an install step for dependencies. That makes the runtime behavior unclear and could surprise users (scripts will fail or behave inconsistently if dependencies are not installed).
!
Credentials
The code and SKILL.md explicitly require OPENAI_API_KEY (and optionally JSON_OUTPUT env var) but the registry metadata lists no required environment variables or primary credential. Requesting an OpenAI API key is reasonable for this function, but it must be declared. The scripts also default to a hardcoded USER_ID 'abhay', which is an odd/poorly generalized default and may expose or entrench a specific identity in a shared environment.
Persistence & Privilege
The skill writes persistent files to the user's home directory (~/.mem0/history.db) and uses a local vector store. That persistence is expected for a memory layer. always is false and the skill does not request system-wide config changes or other skills' credentials. Still, persistent local storage and autonomous model invocation (allowed by platform defaults) mean the skill can repeatedly access and store user data during use.
What to consider before installing
Before installing, be aware this skill expects you to run Node scripts and to provide an OPENAI_API_KEY (even though the registry metadata omits them). It will create a local DB under ~/.mem0 and send text to OpenAI for embeddings and extraction. Recommended steps: (1) only install if you are willing to provide an OpenAI key and allow local persistent storage; (2) run the package in an isolated environment and npm install the dependencies yourself (review package-lock); (3) consider creating an OpenAI key with limited scope or billing limits; (4) change the hardcoded USER_ID and review what memory types will be stored (avoid storing secrets); (5) if you need the skill to be non-autonomous, ensure agent invocation policies prevent automatic runs. The primary issues are metadata omissions (Node and OPENAI_API_KEY) and lack of an install procedure — these should be resolved or understood before trusting the skill.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk97fvnexzwa8bzbzvatsym6t7d821bhw

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Mem0 Memory Integration

Mem0 adds an intelligent, adaptive memory layer to Clawdbot that automatically learns and recalls user preferences, patterns, and context across all interactions.

Core Workflow

1. Search Before Responding

Before answering user questions, search mem0 for relevant context:

node scripts/mem0-search.js "user preferences" --limit=3

Use retrieved memories to:

  • Personalize responses
  • Remember preferences
  • Recall past patterns
  • Adapt communication style

2. Store After Interactions

Explicit Storage (when user says "remember this"):

node scripts/mem0-add.js "Abhay prefers concise updates"

Conversation Storage (for context learning):

# Pass messages as JSON
node scripts/mem0-add.js --messages='[{"role":"user","content":"I like brief updates"},{"role":"assistant","content":"Got it!"}]'

Available Commands

Search Memories

node scripts/mem0-search.js "query text" [--limit=3] [--user=abhay]

Searches semantically across stored memories. Returns relevant memories ranked by relevance.

Add Memory

# Simple text
node scripts/mem0-add.js "memory text" [--user=abhay]

# Conversation messages (auto-extracts memories)
node scripts/mem0-add.js --messages='[{...}]' [--user=abhay]

Mem0's LLM automatically extracts, deduplicates, and merges related memories.

List All Memories

node scripts/mem0-list.js [--user=abhay]

Shows all stored memories for the user with IDs and creation dates.

Delete Memories

# Delete specific memory
node scripts/mem0-delete.js <memory_id>

# Delete all memories for user
node scripts/mem0-delete.js --all --user=abhay

What to Store vs Not Store

✅ Store These:

  • Explicit requests: "Remember that I..."
  • Preferences: Communication style, format choices
  • Personal context: Work info, interests, family (non-sensitive)
  • Usage patterns: Frequent requests, timing preferences
  • Corrections: When user corrects your mistakes
  • Adaptive facts: Current projects, recent interests

❌ Don't Store:

  • Secrets, passwords, API keys
  • Temporary context (unless explicitly requested)
  • System errors or debug info
  • Information already in MEMORY.md (avoid duplication)

Complementing Clawdbot Memory

Clawdbot MEMORY.md (Structured, Deliberate):

  • Permanent facts: Name = Abhay, Location = Singapore
  • Reference data: Email, blog URL, Twitter handle
  • Structured knowledge: Project details, credentials

Mem0 (Dynamic, Learned):

  • Preferences: "Abhay prefers concise updates"
  • Patterns: "Usually asks for bus info at 8:30am"
  • Adaptive context: "Currently interested in AI news"
  • Behavioral: "Likes direct answers, minimal fluff"

Use both together: Check MEMORY.md for facts, check mem0 for preferences/patterns.

Performance Benefits

  • +26% accuracy over OpenAI Memory (LOCOMO benchmark)
  • 91% faster than full-context retrieval
  • 90% fewer tokens than including all conversation history
  • Sub-50ms semantic search retrieval

Configuration

Located in scripts/mem0-config.js:

{
  embedder: "openai/text-embedding-3-small",
  llm: "openai/gpt-4o-mini",
  vectorStore: "memory" (local),
  historyDb: "~/.mem0/history.db",
  userId: "abhay"
}

Uses Clawdbot's OpenAI API key from environment (OPENAI_API_KEY).

Integration Patterns

For detailed workflow patterns, error handling, and best practices, see:

  • references/integration-patterns.md

Programmatic Use

All scripts support JSON_OUTPUT environment variable for programmatic access:

JSON_OUTPUT=1 node scripts/mem0-search.js "query"

Returns JSON after human-readable output (look for ---JSON--- marker).

Resources

scripts/

  • mem0-config.js - Configuration and instance initialization
  • mem0-search.js - Search memories semantically
  • mem0-add.js - Add new memories
  • mem0-list.js - List all memories
  • mem0-delete.js - Delete memories

references/

  • integration-patterns.md - Detailed best practices and patterns

Files

9 total
Select a file
Select a file to preview.

Comments

Loading comments…