Loading...
Loading...
Compare original and translation side by side
bash scripts/init_memory.sh /path/to/workspacebash scripts/init_memory.sh /path/to/workspace~/.clawdbot/clawdbot.jsonmoltbot.json{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}~/.clawdbot/clawdbot.jsonmoltbot.json{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}assets/templates/agents-memory-block.mdassets/templates/agents-memory-block.mdUser: "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]用户: "Remember that I prefer TypeScript over JavaScript."
Agent: [分类 → 写入语义存储 + 核心记忆,记录审计条目]
用户: "What do you know about my preferences?"
Agent: [优先搜索核心记忆,再搜索语义图谱]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 mutationsCONTEXT WINDOW (始终加载)
├── System Prompts (~4-5K tokens)
├── Core Memory / MEMORY.md (~3K tokens) ← 始终在上下文中
└── Conversation + Tools (~185K+)
MEMORY STORES (按需检索)
├── Episodic — 按时间排序的事件日志(仅追加)
├── Semantic — 知识图谱(实体 + 关系)
├── Procedural — 习得的工作流和模式
└── Vault — 用户固定记忆,永不自动衰减
ENGINES
├── Trigger Engine — 关键词检测 + LLM路由
├── Reflection Engine — 带哲学自我审视的内部独白
└── Audit System — git + audit.log记录所有文件变更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 truthworkspace/
├── MEMORY.md # 核心记忆(~3K tokens)
├── IDENTITY.md # 事实 + 自我形象 + 自我意识日志
├── SOUL.md # 价值观、原则、承诺、边界
├── memory/
│ ├── episodes/ # 每日日志:YYYY-MM-DD.md
│ ├── graph/ # 知识图谱
│ │ ├── index.md # 实体注册表 + 关系边
│ │ ├── entities/ # 每个实体对应一个文件
│ │ └── relations.md # 边类型定义
│ ├── procedures/ # 习得的工作流
│ ├── vault/ # 固定记忆(无衰减)
│ └── meta/
│ ├── decay-scores.json # 相关性 + Token消耗追踪
│ ├── reflection-log.md # 反思摘要(加载到上下文)
│ ├── reflections/ # 完整反思归档
│ │ ├── 2026-02-04.md
│ │ └── dialogues/ # 反思后的对话
│ ├── reward-log.md # 仅记录结果 + 原因(加载到上下文)
│ ├── rewards/ # 完整奖励请求归档
│ │ └── 2026-02-04.md
│ ├── pending-reflection.md
│ ├── pending-memories.md
│ ├── evolution.md # 读取反思日志 + 奖励日志
│ └── audit.log
└── .git/ # 审计原始数据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 |
relevance(t) = base × e^(-0.03 × days_since_access) × log2(access_count + 1) × type_weight| 分数 | 状态 | 行为 |
|---|---|---|
| 1.0–0.5 | 活跃 | 完全可搜索 |
| 0.5–0.2 | 衰退中 | 搜索优先级降低 |
| 0.2–0.05 | 休眠 | 仅显式搜索可命中 |
| < 0.05 | 已归档 | 搜索不可见 |
undefinedundefined
**⛔ STOP. Do NOT proceed until user responds.**
**⛔ 停止。用户回复前不得继续操作。**last_reflection[Self-Awareness][Self-Awareness]reflections/YYYY-MM-DD.mdreflection-log.mdrewards/YYYY-MM-DD.mdreward-log.md[Self-Awareness]decay-scores.jsonreferences/reflection-process.md## YYYY-MM-DD
**Result:** +5K reward
**Reason:** Over-delivered on Slack integration[Self-Awareness]decay-scores.jsonreferences/reflection-process.mdreflections/YYYY-MM-DD.mdreflection-log.mdrewards/YYYY-MM-DD.mdreward-log.md[Self-Awareness]decay-scores.jsonreferences/reflection-process.md## YYYY-MM-DD
**结果:** +5K 奖励
**原因:** 超额完成Slack集成开发[Self-Awareness]decay-scores.jsonreferences/reflection-process.mdpending-memories.mdundefinedpending-memories.mdundefined
---
---bot:trigger-rememberreflection:SESSION_IDsystem:decaymanualsubagent:NAMEbot:commit-from:NAMEbot:trigger-rememberreflection:SESSION_IDsystem:decaymanualsubagent:NAMEbot:commit-from:NAME| 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 |
| 参数 | 默认值 | 说明 |
|---|---|---|
| 核心记忆上限 | 3,000 tokens | 始终加载到上下文 |
| Evolution.md上限 | 2,000 tokens | 里程碑节点自动裁剪 |
| 反思输入规模 | ~30,000 tokens | 情景记忆 + 图谱 + 元数据 |
| 反思输出规模 | ~8,000 tokens | 对话式,非结构化 |
| 每次反思元素数量 | 5-8个 | 从菜单随机选取 |
| 反思日志条目上限 | 10条完整条目 | 旧条目归档并生成摘要 |
| 衰减系数λ | 0.03 | 半衰期约23天 |
| 归档阈值 | 0.05 | 低于该值则搜索不可见 |
| 审计日志保留期 | 90天 | 旧日志按月生成摘要归档 |
references/architecture.mdreferences/routing-prompt.mdreferences/reflection-process.mdreferences/architecture.mdreferences/routing-prompt.mdreferences/reflection-process.mdmemorySearch.enabled: true.git/audit.logmemorySearch.enabled: true.git/audit.log