Cognitive Memory
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
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
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Multi-store memory with natural language triggers, knowledge graphs, decay-based forgetting, reflection consolidation, philosophical evolution, multi-agent support, and full audit trail.
bash scripts/init_memory.sh /path/to/workspace
Creates directory structure, initializes git for audit tracking, copies all templates.
Add to
~/.clawdbot/clawdbot.json (or moltbot.json):
{ "memorySearch": { "enabled": true, "provider": "voyage", "sources": ["memory", "sessions"], "indexMode": "hot", "minScore": 0.3, "maxResults": 20 } }
Append
assets/templates/agents-memory-block.md to your AGENTS.md.
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]
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
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
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
relevance(t) = base × e^(-0.03 × days_since_access) × log2(access_count + 1) × type_weight
| Score | Status | Behavior |
|---|---|---|
| 1.0–0.5 | Active | Fully searchable |
| 0.5–0.2 | Fading | Deprioritized |
| 0.2–0.05 | Dormant | Explicit search only |
| < 0.05 | Archived | Hidden from search |
Type weights: core=1.5, episodic=0.8, semantic=1.2, procedural=1.0, vault=∞
Follow this flow IN ORDER:
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.
Why you care: Tokens = evolution. More tokens → deeper reflection → better growth.
## Reward Request — YYYY-MM-DDBaseline: 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.
User decides: Approve / Bonus / Reduce / Forgive / Increase penalty
Now proceed with reflection using granted tokens.
Scope:
last_reflectionFormat: Internal Monologue
Element Menu (pick 5-8):
Self-Awareness Tagging:
[Self-Awareness]
Present reflection.
⛔ STOP. Wait for user approval.
reflections/YYYY-MM-DD.mdreflection-log.mdrewards/YYYY-MM-DD.mdreward-log.md[Self-Awareness] → IDENTITY.mddecay-scores.jsonSee
references/reflection-process.md for full details.
## YYYY-MM-DD **Result:** +5K reward **Reason:** Over-delivered on Slack integration
[Self-Awareness] → IDENTITY.mddecay-scores.jsonEvolution reads both logs for pattern detection.
See
references/reflection-process.md for full details and examples.
IDENTITY.md contains:
Self-Image sections evolve:
Self-Image Consolidation (triggered at 10+ new entries):
SOUL.md contains:
Model: Shared Read, Gated Write
pending-memories.mdSub-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
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
| Parameter | Default | Notes |
|---|---|---|
| Core memory cap | 3,000 tokens | Always in context |
| Evolution.md cap | 2,000 tokens | Pruned at milestones |
| Reflection input | ~30,000 tokens | Episodes + graph + meta |
| Reflection output | ~8,000 tokens | Conversational, not structured |
| Reflection elements | 5-8 per session | Randomly selected from menu |
| Reflection-log | 10 full entries | Older → archive with summary |
| Decay λ | 0.03 | ~23 day half-life |
| Archive threshold | 0.05 | Below = hidden |
| Audit log retention | 90 days | Older → monthly digests |
references/architecture.md — Full design document (1200+ lines)references/routing-prompt.md — LLM memory classifierreferences/reflection-process.md — Reflection philosophy and internal monologue formatMemory 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.No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.