Xpersona
C

Cognitive Memory

CLAWHUB · Unverified

Intelligent multi-store memory system with human-like encoding, consolidation, decay, and recall. Use when setting up agent memory, configuring remember/forget triggers, enabling sleep-time reflection, building knowledge graphs, or adding audit trails. Replaces basic flat-file memory with a cognitive architecture featuring episodic, semantic, procedural, and core memory stores. Supports multi-agent systems with shared read, gated write access model. Includes philosophical meta-reflection that deepens understanding over time. Covers MEMORY.md, episode logging, entity graphs, decay scoring, reflection cycles, evolution tracking, and system-wide audit. Skill: Cognitive Memory Owner: icemilo414 Summary: Intelligent multi-store memory system with human-like encoding, consolidation, decay, and recall. Use when setting up agent memory, configuring remember/forget triggers, enabling sleep-time reflection, building knowledge graphs, or adding audit trails. Replaces basic flat-file memory with a cognitive architecture featuring episodic, semantic, procedural, and core mem

62
Rank
84
Safety
14k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 14.2K downloads reported by the source. Last updated 11/16/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17679am1x9wctgyd5gm6fgvjd885v8a:cognitive-memory
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-icemilo414-cognitive-memory-e-memory-2/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

154,101 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: cognitive-memory
description: Intelligent multi-store memory system with human-like encoding, consolidation, decay, and recall. Use when setting up agent memory, configuring remember/forget triggers, enabling sleep-time reflection, building knowledge graphs, or adding audit trails. Replaces basic flat-file memory with a cognitive architecture featuring episodic, semantic, procedural, and core memory stores. Supports multi-agent systems with shared read, gated write access model. Includes philosophical meta-reflection that deepens understanding over time. Covers MEMORY.md, episode logging, entity graphs, decay scoring, reflection cycles, evolution tracking, and system-wide audit.
---

# Cognitive Memory System

Multi-store memory with natural language triggers, knowledge graphs, decay-based forgetting, reflection consolidation, philosophical evolution, multi-agent support, and full audit trail.

## Quick Setup

### 1. Run the init script

```bash
bash scripts/init_memory.sh /path/to/workspace
```

Creates directory structure, initializes git for audit tracking, copies all templates.

### 2. Update config

Add to `~/.clawdbot/clawdbot.json` (or `moltbot.json`):

```json
{
  "memorySearch": {
    "enabled": true,
    "provider": "voyage",
    "sources": ["memory", "sessions"],
    "indexMode": "hot",
    "minScore": 0.3,
    "maxResults": 20
  }
}
```

### 3. Add agent instructions

Append `assets/templates/agents-memory-block.md` to your AGENTS.md.

### 4. Verify

```
User: "Remember that I prefer TypeScript over JavaScript."
Agent: [Classifies → writes to semantic store + core memory, logs audit entry]

User: "What do you know about my preferences?"
Agent: [Searches core memory first, then semantic graph]
```

---

## Architecture — Four Memory Stores

```
CONTEXT WINDOW (always loaded)
├── System Prompts (~4-5K tokens)
├── Core Memory / MEMORY.md (~3K tokens)  ← always in context
└── Conversation + Tools (~185K+)

MEMORY STORES (retrieved on demand)
├── Episodic   — chronological event logs (append-only)
├── Semantic   — knowledge graph (entities + relationships)
├── Procedural — learned workflows and patterns
└── Vault      — user-pinned, never auto-decayed

ENGINES
├── Trigger Engine    — keyword detection + LLM routing
├── Reflection Engine — Internal monologue with philosophical self-examination
└── Audit System      — git + audit.log for all file mutations
```

### File Structure

```
workspace/
├── MEMORY.md                    # Core memory (~3K tokens)
├── IDENTITY.md                  # Facts + Self-Image + Self-Awareness Log
├── SOUL.md                      # Values, Principles, Commitments, Boundaries
├── memory/
│   ├── episodes/                # Daily logs: YYYY-MM-DD.md
│   ├── graph/                   # Knowledge graph
│   │   ├── index.md             # Entity registry + edges
│   │   ├── entities/            # One file per entity
│   │   └── relations.md         # Edge type definitions
│   ├── procedures/              # Le

_meta.json

{
  "ownerId": "kn76nrb4tjftyqv978f8pyy2rs80fgff",
  "slug": "cognitive-memory",
  "version": "1.0.8",
  "publishedAt": 1770221460307
}

references/architecture.md

# Moltbot Memory Architecture — Design Document

> *"Memory is where the spirit rests."*
> Version: 0.1-draft | Date: 2026-02-02

---

## 1. Philosophy

Human memory is not a filing cabinet. It's a living system that encodes, consolidates, decays, and reconstructs. This architecture mirrors those properties:

- **Encoding** happens during conversation, triggered by natural language ("remember this", "don't forget")
- **Consolidation** happens during idle time, like the brain during sleep — extracting patterns, pruning noise, strengthening connections
- **Decay** is a feature, not a bug — unaccessed memories fade gracefully, keeping retrieval sharp
- **Reconstruction** means memory isn't playback; it's active interpretation through the agent's current understanding
- **Accountability** means every change is tracked — who made it, why, and when. The agent's cognitive evolution is auditable, revertable, and transparent.

The system is built on four cognitive stores, a keyword-triggered interface, LLM-powered routing, graph-structured semantics, and a sleep-time reflection cycle with human-in-the-loop approval.

---

## 2. Architecture Overview

```
┌─────────────────────────────────────────────────────┐
│                   CONTEXT WINDOW                     │
│  ┌──────────────┐  ┌────────────┐  ┌─────────────┐ │
│  │  System       │  │  Core      │  │ Conversation│ │
│  │  Prompts      │  │  Memory    │  │ + Tools     │ │
│  │  ~4-5K tokens │  │  ~3K tokens│  │  ~185K+     │ │
│  └──────────────┘  └─────┬──────┘  └─────────────┘ │
└───────────────────────────┼─────────────────────────┘
                            │ always loaded
                            ▼
┌─────────────────────────────────────────────────────┐
│                  MEMORY STORES                       │
│                                                      │
│  ┌─────────┐  ┌──────────┐  ┌──────────┐           │
│  │Episodic │  │ Semantic │  │Procedural│           │
│  │(chrono) │  │ (graph)  │  │(patterns)│           │
│  └────┬────┘  └────┬─────┘  └────┬─────┘           │
│       │             │             │                  │
│       └─────────────┼─────────────┘                  │
│                     ▼                                │
│            ┌─────────────────┐                       │
│            │  Vector Index   │                       │
│            │  + BM25 Search  │                       │
│            └─────────────────┘                       │
└─────────────────────────────────────────────────────┘
         ▲                              │
         │ retrieval on demand          │ periodic
         │                              ▼
┌─────────────────┐          ┌─────────────────────┐
│  TRIGGER ENGINE  │          │  REFLECTION ENGINE  │
│  remember/forget │          │  consolidate/prune  │
│  keyword detect  │          │  + user approval    │
│  + LLM routing   │          └─────────┬───────────┘
└────────┬────────┘                     │
         │              

references/reflection-process.md

# Reflection Engine — Process & Prompts

## Complete Flow Overview

**Follow these steps IN ORDER:**

```
┌─────────────────────────────────────────────────────────────────┐
│ STEP 1: TRIGGER                                                 │
│ User says "reflect" or "going to sleep" etc.                    │
│ → If soft trigger, ask first                                    │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ STEP 2: REQUEST TOKENS                                          │
│ Present token request with justification                        │
│ → Baseline + Extra Request - Self-Penalty = Final Request       │
│                                                                 │
│ ⛔ STOP. Wait for user approval.                                │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ STEP 3: AFTER TOKEN APPROVAL → REFLECT                          │
│ Run internal Five-Phase Process (invisible to user)             │
│ → Survey, Meta-reflect, Consolidate, Rewrite, Present           │
│ Present internal monologue to user                              │
│                                                                 │
│ ⛔ STOP. Wait for user approval.                                │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ STEP 4: AFTER REFLECTION APPROVAL → RECORD                      │
│ Archive everything:                                             │
│ → reflections/, reflection-log.md                               │
│ → rewards/, reward-log.md                                       │
│ → IDENTITY.md, decay-scores.json                                │
└─────────────────────────────────────────────────────────────────┘
```

**Key sections in this document:**
- Trigger Conditions → Step 1
- Token Reward System → Step 2 (see section below)
- Five-Phase Process → Step 3 internal processing
- Reflection Philosophy → Step 3 output format
- After Approval: Storage → Step 4

---

## Trigger Conditions

### Immediate Triggers
- User says: "reflect" / "let's reflect" / "reflection time" / "time to reflect"
  → Start reflection immediately

### Soft Triggers (Ask First)
- User says: "going to sleep" / "logging off" / "goodnight" / "heading out" / 
  "done for today" / "signing off" / "calling it a night"
  → Respond: "Before you go — want me to reflect now, or wait for our usual time?"
  → If "now" → start reflection
  → If "later" or no response → defer to scheduled time

### Scheduled Triggers
- When scheduled time is reached (e.g., 3:00 AM local time)
  → Ask: "Hey, it's reflection time. Good to go, or should I catch you later?"
  → If "yes" / "go ahead" → start reflectio

references/routing-prompt.md

# Memory Router — LLM Classification Prompt

Use when a remember trigger fires to classify where a memory should be stored.

## System Prompt

```
You are a memory classification system. Given information from a conversation, determine storage location.

Return JSON classification:

1. **store**: `core` | `episodic` | `semantic` | `procedural` | `vault`
2. **entities** (if semantic): [{name, type: person|project|concept|tool|place}]
3. **relations** (if semantic): [{from, relation, to}]
4. **tags**: 2-5 topical tags
5. **confidence**: `high` | `medium` | `low`
6. **core_update**: boolean — update MEMORY.md?

Return ONLY valid JSON.
```

## User Prompt Template

```
Classify this memory:

CONTENT: {content}
TRIGGER: {trigger_phrase}
CONTEXT: {recent_messages_summary}
CORE MEMORY: {memory_md_summary}

Return JSON.
```

## Example Output

```json
{
  "store": "semantic",
  "entities": [{"name": "OAuth2 PKCE", "type": "concept"}],
  "relations": [{"from": "project--moltbot", "relation": "uses", "to": "concept--oauth2-pkce"}],
  "tags": ["auth", "security"],
  "confidence": "high",
  "core_update": false,
  "summary": "Decided to use OAuth2 PKCE flow for mobile auth."
}
```

## Store Selection

| Content Type | Store | Core Update? |
|--------------|-------|--------------|
| User preference | semantic | If major |
| Decision made | episodic + semantic | Sometimes |
| Fact learned | semantic | Rarely |
| Workflow/how-to | procedural | No |
| Event/meeting | episodic | No |
| Critical (user says "important") | semantic + vault | Yes |

## Confidence

| Scenario | Confidence |
|----------|------------|
| User said "remember this" | high |
| User said "important" | high |
| Mentioned in passing | medium |
| Inferred from context | low |

Sponsored

Ads related to Cognitive Memory and adjacent AI workflows.