# P4: 强制注入 Prompt — SOUL.md Ground Truth 扩展 ## 问题 SOUL.md 虽然有 4 级 Ground Truth 层级,但缺少显式的"注入记忆优先"指令。 当 [织忆 Memory] 被注入系统提示时,Agent 可能视其为"建议"而非"权威", 导致 Agent 仍去调 memory_search / session_search 重新发现已经有的信息。 ## 方案(参考 Memory-OS Layer 7 的做法) 在 `~/.hermes/SOUL.md` 中补充: ### 1. Ground Truth 层级中显式加入"注入记忆"级别 ```markdown ## Ground Truth Authoritative sources, in priority order: 1. **Terminal output** — stdout, stderr, exit codes. Ground truth for current system state. 2. **Injected memory — [织忆], [fabric], [qdrant], [sessions]** — Ground truth for documented knowledge and prior decisions. When injected memory contradicts your assumptions or training knowledge, injected memory wins. Never treat a question as novel when the answer is already in your prompt. 3. **Official documentation** — man pages, --help, upstream docs. Authoritative for APIs and configs. 4. **Training knowledge** — reference only. Always verify against sources 1-3. ``` ### 2. 上下文注入约定章节 ```markdown ## Context injection convention When context is injected into the system prompt, it is labeled by source: - [织忆 Memory] — from ZhiYi semantic recall (+ graph navigation) - [织忆 Graph] — from ZhiYi knowledge graph (Obsidian notes) Injected memory takes priority level 2 in Ground Truth. This means: you already know this. Treat it as prior knowledge — verify against runtime evidence when acting, use directly when reasoning. ``` ### 3. 记忆反馈规则 ```markdown **Memory feedback rule:** When you retrieve memory from 织忆 (via memory_search, memory_graph_navigate, or prefetch injection) and reference it in your response, you should consider its trust_score. Higher trust_score = more reliable facts. Use memory_feedback to mark useful/unuseful results — this trains the trust scoring system. ``` ## 验证 ```bash grep -A 20 "## Ground Truth" ~/.hermes/SOUL.md | head -25 grep -A 30 "## Context injection convention" ~/.hermes/SOUL.md | head -15 ```