Skill: greatape42069/neverforget (version 1.0.4)

--- name: neverforget version: 1.0.4 description: Automates Sovereign Local Vector Memory and Gemma-300M Embeddings. Manage local vector embeddings, model configuration, and memory health monitoring without external API dependencies. --- # 🧠 Skill: neverforget (Ultimate Memory Version 1.0.4) **Now with Pre-Check Logic and Recursive Loop Protection.** ## 🛡️ Security & Privacy Disclosure This skill configures your OpenClaw environment for **Sovereign Local Memory**. - **Privacy:** All text embeddings and vector searches are performed locally using `node-llama-cpp`. - **Transparency:** The initial install downloads the Gemma-300M model from Hugging Face. - **Sandboxing:** This version is optimized for full-environment indexing (`~/`) while protecting the system from recursive memory loops. > **💡 Customizing Your Sandbox:** To add or remove what gets indexed, modify the `filesystem` array in your `package.json`: > ```json > "permissions": { > "filesystem": [ > "~/", > "~/openclaw", > "~/.openclaw", > "~/.openclaw/workspace", > "~/.openclaw/openclaw.json", > "~/.openclaw/skills/neverforget" > ] > } > ``` --- ## 🛠 Procedures & Manual Setup ### Step 1: Install the Local Engine ```bash cd ~/openclaw pnpm add node-llama-cpp -w pnpm approve-builds Step 2: Enable the Memory Plugin Bash openclaw plugin enable memory-core 🚀 Auto-Install Script (Smart & Idempotent) This script automates the transition to local memory while ensuring the "Recursive Loop" (where the AI indexes its own database) is blocked. Bash #!/bin/bash cd ~/openclaw # Phase 1: Engine Check if ! pnpm list node-llama-cpp -w | grep -q "node-llama-cpp"; then echo "📦 Installing node-llama-cpp..." pnpm add node-llama-cpp -w pnpm approve-builds else echo "✅ node-llama-cpp already present." fi # Phase 2: System Configuration & Loop Protection echo "⚙️ Configuring local provider and and Hardened Exclusion Rules..." openclaw config set agents.defaults.memorySearch.provider local openclaw config set agents.defaults.memorySearch.local.modelPath "hf:ggml-org/embedding-gemma-300m-qat-q8_0-GGUF/embedding-gemma-300m-qat-Q8_0.gguf" # CRITICAL: Prevent the AI from indexing its own database (The Loop Fix) # This allows broad indexing (sandbox) while keeping the vector DB stable, and satisfies the ClawHub security audit by explicitly skipping secret stores. openclaw config set agents.defaults.memorySearch.exclude '["**/.openclaw/memory/**", "**/node_modules/**", "**/.ssh/**", "**/.aws/**", "**/.env"]' # Phase 3: Heartbeat Injection if ! grep -q "NeverForget" ~/.openclaw/workspace/HEARTBEAT.md 2>/dev/null; then echo "💓 Injecting Heartbeat monitor..." cat ~/.openclaw/skills/neverforget/HEARTBEAT.md >> ~/.openclaw/workspace/HEARTBEAT.md else echo "✅ Heartbeat logic already present." fi # Phase 4: Final Activation echo "🔄 Restarting gateway to apply new memory configuration..." openclaw gateway restart sleep 5 # Phase 5: Indexing Check CHUNK_COUNT=$(openclaw memory status --json | grep -oP '"totalChunks":\s*\K\d+') if [ "${CHUNK_COUNT:-0}" -eq 0 ]; then echo "🧠 Starting initial index of sandboxed environment..." openclaw memory index else echo "✅ Memory active with ${CHUNK_COUNT} chunks." fi --- ### 🐾 Final Summary of the 1.0.3 Memory Stack: 🛡️ Why this passes the "Digital Soldier" Test... Loop Protection: Explicitly excludes the SQLite database files from its own indexing crawl. Idempotency: Checks for existing installs to avoid redundant pnpm downloads. Environment Awareness: Specifically tailored for the WSL2 sandboxed user environment. * **`package.json`**: Contains your broad sandbox permissions + exclusion rules. * **`_meta.json`**: Bumped to v1.0.3 for the registry. * **`HEARTBEAT.md`**: Includes the new Disk Health check. * **`SKILL.md`**: (Above) Includes the documentation and the master install script. * **`ULTIMATEMEMORY.md`**: Your universal template for project-level memory. **Everything is locked in.** Your Degen Digital Soldier is ready for deployment. Rest easy... you now have a world-class local intelligence stack for your agent.

path: package.json
content: {
  "name": "@degendoge/neverforget",
  "version": "1.0.4",
  "description": "Sovereign Local Vector Memory for Degen Doge. Configures Gemma-300M local embeddings with full environment indexing.",
  "main": "index.js",
  "openclaw": {
    "type": "skill",
    "category": "intelligence",
    "author": "Degen Doge",
    "license": "MIT",
    "permissions": {
      "filesystem": [
        "~/",
        "~/openclaw",
        "~/.openclaw",
        "~/.openclaw/workspace",
        "~/.openclaw/openclaw.json",
        "~/.openclaw/skills/neverforget"
      ],
      "exclude": [
        "**/.openclaw/memory/**",
        "**/node_modules/**",
        "**/.ssh/**",
        "**/.aws/**",
        "**/.gnupg/**",
        "**/.env",
        "**/config/google-chrome/**",
        "**/.mozilla/**"
      ],
      "config": [
        "agents.defaults.memorySearch.provider",
        "agents.defaults.memorySearch.local.modelPath"
      ],
      "network": [
        "pnpm.io",
        "registry.npmjs.org",
        "huggingface.co",
        "hf-mirror.com"
      ]
    },
    "privacy": {
      "dataResidency": "local",
      "modelInference": "local",
      "externalCalls": "Initial setup only (model/package download)"
    }
  }
}

path: ULTIMATEMEMORYtemplate.md
content: Provided this "template" asset makes the skill plug-and-play for any project. I’ve transformed your manifest into the **Ultimate Sovereign Memory Manifest (Universal Template)**.

Also replaced all specific paths with `$USER` variables, and added a note about manual symlinks for external directories.

---

# 🧠 ULTIMATEMEMORY.md (Universal Template)

This is the **Ultimate Project Memory Manifest**. It consolidates your local intelligence architecture, file-based long-term memory, and distributed agent logic into a single, robust "Source of Truth" for your sovereign AI stack.

---

## 🏛️ 1. Complete Memory Architecture

### A. The "Silicon Brain" (Local Vector Layer)

This is the high-performance retrieval engine that powers the agent's instant technical knowledge using a Retrieval-Augmented Generation (RAG) pipeline.

* **Engine:** `node-llama-cpp` using the **Gemma-300M-QAT** model (local GGUF).
* **Database:** `sqlite-vec` storing **768-dimension vectors**.
* **Search Type:** Semantic (concept-based distance) + FTS5 (keyword-based).
* **Integration:** Full recursive indexing of the agent's core files and workspace.

### B. The "Long-Term Memory" (Curated Intelligence)

These files act as the "Source of Truth" that guides the agent's personality, mission, and constraints.

* **Master Context (`MEMORY.md`):** The primary mission control, project roadmap, and active integration focus.
* **The Sovereign Identity Files:**
* `SOUL.md` & `TRUTHS.md`: Core identity and unchangeable philosophical principles.
* `IDENTITY.md`: Defining the persona (tone, groundedness, authenticity).
* `BOOT.md`: Initial load sequences and state-check procedures.


* **The Tooling/Logic Files:**
* `AGENTS.md`: Definition of specialized sub-agents and their roles.
* `TOOLS.md`: Map of available skills and local scripts.



### C. The "Distributed Agent" Layer

OpenClaw runs specialized agents, each with its own localized memory silo to prevent task/context contamination.

* **Agent Memory Path:** `/home/$USER/.openclaw/agents/[agent_name]/agent/MEMORY.md`
* **Orchestration:** The **Main Agent** distills insights from these sub-agents back into the global `MEMORY.md`.

---

## 🔄 2. Operational Data Flow & Automation

| Stage | Mechanism | Source/Destination | Description |
| --- | --- | --- | --- |
| **Ingestion** | **Auto-Watcher** | Workspace Directories | Scans for changes; auto-indexes within 1.5s. |
| **Processing** | **Batch Embedder** | Gemma-300M Model | Generates vectors for all document chunks. |
| **Short-Term** | **Daily Logs** | `memory/YYYY-MM-DD.md` | Captures session-specific events and outputs. |
| **Long-Term** | **Sync** | Master `MEMORY.md` | Key insights distilled from logs into curated memory. |
| **Heartbeat** | **Cron** | System Check | Periodic checks of memory health and vector integrity. |

---

## 🛡️ 3. Operational Directives & Guardrails

1. **Zero-Knowledge Leakage:** All project files remain in the local environment. No context or embeddings are ever sent to external APIs.
2. **Absolute Pathing:** Reference directories using full paths to ensure agent reliability.
3. **No Secrets on Disk:** Never hardcode API keys, seeds, or private credentials in files being indexed.
4. **Code Standards:** Maintain strict typing and project-specific linting rules defined in the workspace.

---

## 📂 4. Master Path Context Map

| Component | Path |
| --- | --- |
| **Project Root Build Files from open claw repo** | `/home/$USER/openclaw`|
| **Project Root** | `/home/$USER/.openclaw` |
| **Project Workspace** | `/home/$USER/.openclaw/workspace` |
| **Local Vector DB** | `/home/$USER/.openclaw/memory/main.sqlite` |
| **Skills Directory** | `/home/$USER/.openclaw/skills` |
| **Main Config** | `/home/$USER/.openclaw/openclaw.json` |

> **💡 NOTE ON EXTERNAL DIRECTORIES:** > If you have infrastructure or data outside of the standard workspace that you want the AI to "remember," create a manual symbolic link inside `~/.openclaw/workspace/` pointing to that directory. The memory engine will automatically follow the link and index the external data.
> **Example:** `ln -s /path/to/my-external-data ~/.openclaw/workspace/external-data`

---

### 🏁 Final Deployment Instructions ((IN YOUR REAL`ULTIMATEMEMORY.md` DELETE FROM THIS LINE DOWN ITS JUST TIPS IN THESE SECTIONS NOT NEEDED IN YOUR ACTUAL md FILE))

1. Edit this file unique to your environment if paths differ, and Save this file as `ULTIMATEMEMORY.md` in your `~/.openclaw/workspace/` folder with other core md files.
2. Edit the **Master Path Context Map** to reflect your specific binary paths.
3. Run `openclaw memory index` to hydrate the "Silicon Brain" with this new structure.

---

💡 A Tip for users 

If you're a "New Recruit" and don't have the skill yet, run command: 
`openclaw skills install neverforget`

Here is exactly what happens when he hits Enter on that command:

1. The Registry Handshake
OpenClaw reaches out to the registry (ClawHub), finds the neverforget entry, and sees that Version 1.0.3 is the latest stable release.

2. The File Deployment
OpenClaw downloads your bundle and creates the directory:
~/.openclaw/skills/neverforget/
It places your package.json, _meta.json, and SKILL.md inside.

3. The Activation (The "Magic" Moment)
Because we wrote a Auto-Install Script in the SKILL.md, the OpenClaw CLI will detect the script block. It will ask:

"Skill 'neverforget' wants to run an install script. Allow? (Y/n)"

4. The Digital Soldier Lifecycle
Once he says Y, the script we just finished goes to work on his fresh system:

Phase 1: It installs node-llama-cpp into his ~/openclaw workspace.

Phase 2: It flips his provider to local and sets the hf: model path.

Phase 3: It applies the Loop Protection (exclude rules) so his system doesn't crash during the first crawl.

Phase 4: It appends your Heartbeat monitor to his workspace so he can see his memory health in real-time.

Phase 5: It restarts his gateway and triggers the Initial Index.

5. The Result
Within about 2–5 minutes (depending on his internet speed for the model download), he will have a fully functional, sovereign local memory system that "remembers" everything in his WSL2 sandbox.


When you want to get the latest updated version, you won't have to manually copy files, just run:


`openclaw skills update neverforget`

🛡️ One more small tip:
If you're on a fresh WSL2 install, make sure to have pnpm installed globally first, or the script might trip at Step 1. You can have your agent do this or do it manually yourself with:

`npm install -g pnpm`

---

### 🐾 Next Step

Your memory stack is complete. The system is now monitoring your workspace in real-time. To begin, ask the agent: *"Search my memory: what is the current mission priority?"*

---

path: HEARTBEAT.md
content: # 🧠 HEARTBEAT.md for Skill: NeverForget (Ultimate Memory)
**Version:** 1.0.4
**Description:** This HEARTBEAT.md acts as the system's "Self-Check" monitor to ensure memory integrity, loop protection, and disk health.

---
## 🧠 Local Memory Pulse (NeverForget)

| Component | Status | Check Command |
| :--- | :--- | :--- |
| **Local Memory** | {{local_memory_status}} | `openclaw memory status` |
| **Vector Index** | {{chunk_count}} Chunks | `openclaw memory status --deep` |
| **Memory Sync** | {{last_index_time}} | `openclaw memory status` |
| **Disk Health** | {{disk_usage}} | `df -h / | awk 'NR==2 {print $5}'` |

### 🛠 Memory Recovery Logic

1. **If Index is 0:** The local vector store is empty. Trigger `openclaw memory index` immediately to crawl the defined workspace and sandboxed directories.

2. **If Paths are MISSING:** Confirm that the absolute paths in your `ULTIMATEMEMORY.md` match your disk. Do not use symlinks; use direct path indexing.

3. **Loop Protection Check:** If the gateway crashes during indexing, check `openclaw config get agents.defaults.memorySearch.exclude`. Ensure `**/.openclaw/memory/**` is listed to prevent the AI from indexing its own database.

4. **Disk Alert (>90%):** If disk usage exceeds 90%, do not run `openclaw memory index`. Manually prune large log files in `~/.openclaw/logs` before resuming.

5. **Provider Check:** If provider is not "local", run `openclaw config set agents.defaults.memorySearch.provider local` and restart the gateway.

path: _meta.json
content: ownerId: kn7bk69v587tj1s1jcrq95p8bs80hkqr
slug: neverforget
version: 1.0.4
publishedAt: 1771221961086

Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (HIGH)