Files
memoryweave/docs/p4-prompt-plan.md
T
xiaowei 2a350cf781 fix(distill): max_tokens 800→1200 — Agnes推理token预算不足
Agnes 2.0-flash是推理模型,推理token占大量预算。
800仍不够→JSON截断(parse error: unexpected end of JSON input)。
1200确保推理+正文都够用。
2026-08-20 01:13:06 +08:00

52 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```