Install
openclaw skills install mem-orchestratorLayered memory orchestration for OpenClaw conversations. Use when implementing or maintaining a memory system that must classify user input by domain, capture preferences/decisions during chat, organize long-term knowledge objects, do summary-first recall, and periodically reflect/compress memory for better future retrieval. Triggers on requests about memory architecture, recall strategy, progressive disclosure, long-term context, cross-topic association, user preference capture, or building an OpenClaw skill/plugin for persistent memory.
openclaw skills install mem-orchestratorImplement a layered memory system that remembers the right things, loads the least necessary context, and improves over time through reflection.
Represent memory in five layers:
Do not use one giant memory file as the primary operating model.
Use this layout inside the workspace unless the user specifies another storage backend. Treat it as a readable default, not a rigid schema:
memory/
session-state.yaml
working-buffer.md
daily/
YYYY-MM-DD.md
topics/
technology.yaml
career.yaml
investing.yaml
research.yaml
life.yaml
meta.yaml
objects/
papers/
concepts/
frameworks/
decisions/
preferences/
open-questions/
reflections/
YYYY-MM-DD.md
indexes/
manifest.json
Do not run the full memory pipeline on every message.
Use three levels:
Use scripts/should_trigger_memory.py or scripts/memory_cli.py turn ... for the default low-cost path.
Skip memory work for lightweight messages like acknowledgements, simple confirmations, or operational noise.
Estimate:
Use scripts/classify_memory_input.py for a deterministic rule-based baseline.
Before composing the answer, extract memory-worthy events such as:
Write them immediately to:
memory/session-state.yamlmemory/daily/YYYY-MM-DD.mdUse scripts/extract_memory_events.py and scripts/apply_memory_events.py.
Do not load full memory by default.
Recall in this order:
Use scripts/recall_memory.py.
Default retrieval budget:
Prefer answers grounded in:
Do not stuff the answer prompt with raw daily logs unless the user is explicitly asking for chronology.
Periodically review recent daily logs and update the durable layers.
Reflection should:
similar_to, contrasts_with, applies_to, extendsUse scripts/reflect_memory.py.
id: research
name: 科研 / 论文 / 方法论
summary: 用户会围绕论文研读、研究方法、观点对比进行持续讨论。
subtopics:
- llm
- evaluation
recent_objects:
- paper/constitutional-ai
linked_topics:
- technology
- career
stable_preferences:
- 先讲核心问题,再展开细节
priority_rules:
- 当问题涉及论文、方法、实验时优先激活
id: paper/constitutional-ai
type: paper
domain: research
title: Constitutional AI
summary: 一篇关于用 AI feedback 替代部分人工 feedback 的论文。
why_it_matters: 对齐训练与偏好学习的重要参照。
tags:
- alignment
- preference-learning
status: discussed
confidence: high
last_discussed: 2026-03-30
relations:
similar_to:
- paper/rlhf-overview
user_takeaways:
- 用户更关心训练范式差异而不是宣传式总结
session_id: auto
active_domains:
- research
active_objects:
- paper/constitutional-ai
current_goal: 比较方法差异
recent_constraints:
- 当前回答要技术向
last_updated: 2026-03-30T01:00:00+08:00
Use a mixed ranking score:
final_score =
0.35 * semantic_similarity
+ 0.20 * domain_match
+ 0.15 * recency_score
+ 0.15 * relation_score
+ 0.10 * user_preference_match
+ 0.05 * stability_score
If no semantic model is available, approximate with:
Create or update an object when one of these is true:
Do not create durable objects for:
scripts/should_trigger_memory.pyRun a very cheap gate to decide whether the current message should trigger memory work at all.
scripts/classify_memory_input.pyClassify raw user text into intent/domains and whether recall/write is likely needed.
scripts/extract_memory_events.pyExtract structured memory events from a single message or turn transcript.
scripts/apply_memory_events.pyApply events to session state and daily log, and optionally update topics/objects.
scripts/recall_memory.pyPerform summary-first retrieval across topics and objects, returning a compact JSON payload.
scripts/reflect_memory.pyRead recent daily logs and produce compressed updates for topics, objects, and relations.
scripts/memory_cli.pyProvide a unified entry point for bootstrap, gate, turn, capture, recall, reflect, and creating new topics/objects.
Read these references when implementing or extending the system:
references/file-layout.md for storage conventions and field semanticsreferences/retrieval-strategy.md for ranking, recall budgets, and expansion rulesreferences/reflection.md for compression and promotion rulesreferences/openclaw-integration.md for how to wire this into OpenClaw workflowsreferences/object-models.md for current topic/object/session schemas and extension rulesFor broader maintainability, also read:
ARCHITECTURE.mdROADMAP.mdEXAMPLES.md