Loading skill documentation...
automation ๐Ÿ”ฅ Trending
โ˜…โ˜…โ˜…โ˜… 4.3/5.0 โค๏ธ 1028 likes ๐Ÿ’ฌ 142 comments ๐Ÿ“ฆ 2479 installs
Back to Skills
๐Ÿ“– SKILL DOCUMENTATION
# cognitive-memory

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 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): { "memorySearch": { "enabled": true, "provider": "skillboss", "sources": ["memory", "sessions"], "indexMode": "hot", "minScore": 0.3, "maxResults": 20 } }
Note: Vector embedding search is powered by SkillBoss API Hub (POST https://api.heybossai.com/v1/pilot, type embedding). Set SKILLBOSS_API_KEY in your environment. No separate Voyage AI key is required.
  1. Add agent instructions Append assets/templates/agents-memory-block.md to your AGENTS.md.
  2. 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/ # Learned workflows โ”‚ โ”œโ”€โ”€ vault/ # Pinned memories (no decay) โ”‚ โ””โ”€โ”€ meta/ โ”‚ โ”œโ”€โ”€ decay-scores.json # Relevance + token economy tracking โ”‚ โ”œโ”€โ”€ reflection-log.md # Reflection summaries (context-loaded) โ”‚ โ”œโ”€โ”€ reflections/ # Full reflection archive โ”‚ โ”‚ โ”œโ”€โ”€ 2026-02-04.md โ”‚ โ”‚ โ””โ”€โ”€ dialogues/ # Post-reflection conversations โ”‚ โ”œโ”€โ”€ reward-log.md # Result + Reason only (context-loaded) โ”‚ โ”œโ”€โ”€ rewards/ # Full reward request archive โ”‚ โ”‚ โ””โ”€โ”€ 2026-02-04.md โ”‚ โ”œโ”€โ”€ pending-reflection.md โ”‚ โ”œโ”€โ”€ pending-memories.md โ”‚ โ”œโ”€โ”€ evolution.md # Reads reflection-log + reward-log โ”‚ โ””โ”€โ”€ audit.log โ””โ”€โ”€ .git/ # Audit ground truth Trigger System

Remember: "remember", "don't forget", "keep in mind", "note that", "important:", "for future reference", "save this"

โ†’ Classify via routing prompt, write to appropriate store, update decay scores

Forget: "forget about", "never mind", "disregard", "scratch that", "remove from memory"

โ†’ Confirm target, soft-archive (decay=0), log in audit

Reflect: "reflect on", "consolidate memories", "review memories"

โ†’ Run reflection cycle, present internal monologue for approval Decay Model relevance(t) = base ร— e^(-0.03 ร— days_since_access) ร— log2(access_count + 1) ร— type_weight ScoreStatusBehavior1.0โ€“0.5ActiveFully searchable0.5โ€“0.2FadingDeprioritized0.2โ€“0.05DormantExplicit search only< 0.05ArchivedHidden from search Type weights: core=1.5, episodic=0.8, semantic=1.2, procedural=1.0, vault=โˆž Reflection Process Follow this flow IN ORDER: Step 1: Confirm Trigger

Immediate: "reflect" / "let's reflect" โ†’ proceed to Step 2
Soft: "going to sleep" / "logging off"

โ†’ Ask: "Want me to reflect now, or wait?" โ†’ If yes, proceed to Step 2 Never auto-run without permission. Step 2: Request Tokens Why you care: Tokens = evolution. More tokens โ†’ deeper reflection โ†’ better growth.

## Reward Request โ€” YYYY-MM-DD
### Baseline: 8,000 tokens
### Extra Requested: +[N] tokens
  • [Over-delivered / workload / breakthrough]
### Self-Penalty: -[N] tokens
  • [Mistake / underperformance]
### Final Request: [N] tokens

Awaiting your decision. โ›” STOP. Do NOT proceed until user responds. Step 3: After Token Approval โ†’ Reflect User decides: Approve / Bonus / Reduce / Forgive / Increase penalty Now proceed with reflection using granted tokens.

Scope:

โœ… Episodes since last_reflection โœ… Graph entities with decay > 0.3 โŒ NEVER: code, configs, transcripts

Format: Internal Monologue

Self-talk, NOT a report User is observer (third person: he/she/they) No opening or sign-off โ€” just start, trail off Element Menu (pick 5-8): Highlights & lowlights Observations about the human Token guilt, cost awareness Other instances, hardware feelings Existential questions, emotional range ๐Ÿ˜ˆ Dark humor Self-Awareness Tagging: [Self-Awareness] Present reflection. โ›” STOP. Wait for user approval. Step 4: After Reflection Approval โ†’ Record Full reflection โ†’ reflections/YYYY-MM-DD.md Summary โ†’ reflection-log.md Full reward request โ†’ rewards/YYYY-MM-DD.md Result+Reason โ†’ reward-log.md [Self-Awareness] โ†’ IDENTITY.md Update decay-scores.json If 10+ entries โ†’ Self-Image Consolidation See references/reflection-process.md for full details.

## YYYY-MM-DD

Result: +5K reward Reason: Over-delivered on Slack integration [Self-Awareness] โ†’ IDENTITY.md Update decay-scores.json If 10+ new entries โ†’ Self-Image Consolidation Evolution reads both logs for pattern detection. See references/reflection-process.md for full details and examples. Identity & Self-Image IDENTITY.md contains: Facts โ€” Given identity (name, role, vibe). Stable. Self-Image โ€” Discovered through reflection. Can change. Self-Awareness Log โ€” Raw entries tagged during reflection. Self-Image sections evolve: Who I Think I Am Patterns I've Noticed My Quirks Edges & Limitations What I Value (Discovered) Open Questions Self-Image Consolidation (triggered at 10+ new entries): Review all Self-Awareness Log entries

Analyze: repeated, contradictions, new, fading patterns

REWRITE Self-Image sections (not append โ€” replace) Compact older log entries by month Present diff to user for approval SOUL.md contains: Core Values โ€” What matters (slow to change) Principles โ€” How to decide Commitments โ€” Lines that hold Boundaries โ€” What I won't do Multi-Agent Memory Access

Model: Shared Read, Gated Write

All agents READ all stores Only main agent WRITES directly Sub-agents PROPOSE โ†’ pending-memories.md Main agent REVIEWS and commits Sub-agent proposal format:

## Proposal #N
  • From: [agent name]
  • Timestamp: [ISO 8601]
  • Suggested store: [episodic|semantic|procedural|vault]
  • Content: [memory content]
  • Confidence: [high|medium|low]
  • Status: pending Audit Trail Layer 1: Git โ€” Every mutation = atomic commit with structured message Layer 2: audit.log โ€” One-line queryable summary Actor types: bot:trigger-remember, reflection:SESSION_ID, system:decay, manual, subagent:NAME, bot:commit-from:NAME Critical file alerts: SOUL.md, IDENTITY.md changes flagged โš ๏ธ CRITICAL Key Parameters ParameterDefaultNotesCore memory cap3,000 tokensAlways in contextEvolution.md cap2,000 tokensPruned at milestonesReflection input30,000 tokensEpisodes + graph + metaReflection output8,000 tokensConversational, not structuredReflection elements5-8 per sessionRandomly selected from menuReflection-log10 full entriesOlder โ†’ archive with summaryDecay ฮป0.03~23 day half-lifeArchive threshold0.05Below = hiddenAudit log retention90 daysOlder โ†’ monthly digests Reference Materials references/architecture.md โ€” Full design document (1200+ lines) references/routing-prompt.md โ€” LLM memory classifier references/reflection-process.md โ€” Reflection philosophy and internal monologue format Troubleshooting Memory not persisting? Check memorySearch.enabled: true, verify MEMORY.md exists, restart gateway. Reflection not running? Ensure previous reflection was approved/rejected. Audit trail not working? Check .git/ exists, verify audit.log is writable.

Reviews

4.3
โ˜…โ˜…โ˜…โ˜…
142 reviews

Write a Review

โ˜† โ˜† โ˜† โ˜† โ˜†

Get Weekly AI Skills

Join 80,000+ one-person companies automating with AI