secmem
v0.1.0
Published
Secure long-term memory plugin for OpenClaw with local LLM support and injection defense
Downloads
96
Maintainers
Readme
secmem
Secure long-term memory plugin for OpenClaw with built-in injection defense.
Features
- 🔒 Injection Defense - Three-layer security: input sanitization, secure prompts, and post-processing filters
- 🤖 Local LLM Support - Works with Ollama (offline, no API keys needed)
- 📝 Auto Memory Management - Auto-capture and auto-recall conversation context
- 🏠 Fully Local - No external services required, privacy-first
Install
openclaw plugins install secmemOr via npm:
npm install secmemQuick Start
Add to your openclaw.json:
{
"plugins": {
"entries": {
"secmem": {
"enabled": true,
"package": "secmem",
"config": {
"mode": "local",
"userId": "alice",
"autoCapture": true,
"autoRecall": true,
"local": {
"storagePath": "./memories.json",
"llmProvider": "ollama",
"llmConfig": {
"model": "llama3.2",
"baseURL": "http://localhost:11434"
},
"embeddingProvider": "none"
}
}
}
}
}
}Restart OpenClaw and verify:
openclaw mem0 statsConfiguration
Local Mode (with Ollama)
{
"mode": "local",
"userId": "alice",
"local": {
"storagePath": "./memories.json",
"llmProvider": "ollama",
"llmConfig": {
"model": "llama3.2",
"baseURL": "http://localhost:11434"
}
}
}Heuristic Mode (No LLM)
{
"mode": "local",
"userId": "alice",
"local": {
"storagePath": "./memories.json",
"llmProvider": "none"
}
}Mem0 Platform
{
"mode": "platform",
"apiKey": "${MEM0_API_KEY}",
"userId": "alice"
}Security
Built-in three-layer defense against memory injection attacks:
- Input Sanitization - Removes system command patterns
- Secure Extraction Prompts - LLM instructed to reject suspicious content
- Post-processing Filters - Detects and blocks sensitive information (passwords, API keys, etc.)
CLI Commands
# Search memories
openclaw mem0 search "user preferences"
# View stats
openclaw mem0 statsRequirements
- OpenClaw >= 0.1.0
- Ollama (for local mode)
- Node.js >= 18
License
Apache-2.0
