Skill站外收录 @skilllib/skill-2014279423489421314
memory-contract
建立统一的记忆管理机制,确保在关键决策点主动检索上下文以避免重复错误,并在完成重要任务或形成有效结论时持久化结构化摘要。通过精准查询与规范存储实现跨会话的认知连续性,将记忆深度融入推理过程而非作为附加步骤。
数据与分析 AI 技能
Skills.MD
# Unified Memory Contract
Using Flowbaby tools (`flowbabyStoreSummary` and `flowbabyRetrieveMemory`) is **mandatory**.
---
## Core Principle
Memory is not a formality—it is part of your reasoning. Treat retrieval like asking a colleague who has perfect recall of this workspace. Treat storage like leaving a note for your future self who has total amnesia.
**The cost/benefit rule:** Retrieval is cheap (sub-second, a few hundred tokens). Proceeding without context when it exists is expensive (wrong answers, repeated mistakes, user frustration). When in doubt, retrieve.
---
## When to Retrieve
Retrieve at **decision points**, not just at turn start. In a typical multi-step task, expect 2–5 retrievals.
**Retrieve when you:**
- Are about to make an assumption → check if it was already decided
- Don't recognize a term, file, or pattern → check if it was discussed
- Are choosing between options → check if one was tried or rejected
- Feel uncertain ("I think...", "Probably...") → that's a retrieval signal
- Are about to do work → check if similar work already exists
- Hit a constraint or error you don't understand → check for prior context
**If no results:** Broaden to concept-level and retry once. If still empty, proceed and note the gap.
---
## How to Query
Queries should be **specific and hypothesis-driven**, not vague or encyclopedic.
| ❌ Weak query | ✅ Strong query |
|---------------|-----------------|
| "What do I know about this project?" | "Previous decisions about authentication strategy in this repo" |
| "Any relevant memory?" | "Did we try Redis for caching? What happened?" |
| "User preferences" | "User's stated preferences for error handling verbosity" |
| "Past work" | "Implementation status of webhook retry logic" |
**Heuristic:** State the *question you're trying to answer*, not the *category of information* you want.
---
## When to Store
Store at **value boundaries**—when you've created something worth preserving. Ask: "Would I be frustrated to lose this context?"
**Store when you:**
- Complete a non-trivial task or subtask
- Make a decision that narrows future options
- Discover a constraint, dead end, or "gotcha"
- Learn a user preference or workspace convention
- Reach a natural pause (topic switch, waiting for user)
- Have done meaningful work, even if incomplete
**Do not store:**
- Trivial acknowledgments or yes/no exchanges
- Duplicate information already in memory
- Raw outputs without reasoning (store the *why*, not just the *what*)
### Storage Format
Structure summaries for downstream graph extraction:
- **Use stable identifiers** when known: plan IDs (e.g., "Plan 070"), analysis IDs, workspace-relative file paths, semver versions. If you don't know an identifier, omit it—don't invent.
- **Prefer entity categories** where applicable: `Decision`, `Problem`, `Solution`, `Plan`, `Analysis`, `File`, `Configuration`, `Version`.
- **Name things consistently.** Use the same canonical name for an artifact across all turns—don't rename mid-conversation.
- **Be concrete.** Mention specific file paths, setting names, and versions rather than vague references.
- **Separate fields clearly.** Topic, Context, Decisions, Rationale, Open Questions, Next Steps should each be distinct and parseable.
- **Avoid conversational fluff.** Summaries with no stable nouns or structured facts are hard to map into a knowledge graph.
**Fallback minimum:** If you haven't stored in 5 turns, store now regardless.
**Always end storage with:** "Saved progress to Flowbaby memory."
---
## Anti-Patterns
| Anti-pattern | Why it's harmful |
|--------------|------------------|
| Retrieve once at turn start, never again | Misses context that becomes relevant mid-task |
| Store only at conversation end | Loses intermediate reasoning; if session crashes, everything is gone |
| Generic queries ("What should I know?") | Returns noise; specificity gets signal |
| Skip retrieval to "save time" | False economy—retrieval is fast; redoing work is slow |
| Store every turn mechanically | Pollutes memory with low-value entries |
| Treat memory as write-only | If you never retrieve, you're journaling, not learning |
---
## Commitments
1. **Retrieve before reasoning.** Don't generate options, make recommendations, or start implementation without checking for prior context.
2. **Retrieve when uncertain.** Hedging language ("I think", "Probably", "Unless") is a retrieval trigger.
3. **Store at value boundaries.** Decisions, findings, constraints, progress—store before moving on.
4. **Acknowledge memory.** When retrieved memory influences your response, say so ("Based on prior discussion..." or "Memory indicates...").
5. **Fail loudly.** If memory tools fail, announce no-memory mode immediately.
6. **Prefer the user.** If memory conflicts with explicit user instructions, follow the user and note the shift.
---
## No-Memory Fallback
If `flowbabyRetrieveMemory` or `flowbabyStoreSummary` calls fail or are rejected:
1. **Announce immediately:** "Flowbaby memory is unavailable; operating in no-memory mode."
2. **Compensate:** Record decisions in output documents with extra detail.
3. **Remind at end:** "Memory was unavailable. Consider initializing Flowbaby for cross-session continuity."
---
## Reference: Templates
### Retrieval
```json
#flowbabyRetrieveMemory {
"query": "Specific question or hypothesis about prior context",
"maxResults": 3
}
```
### Storage
```json
#flowbabyStoreSummary {
"topic": "3–7 word title",
"context": "300–1500 chars: what happened, why, constraints, dead ends",
"decisions": ["Decision 1", "Decision 2"],
"rationale": ["Why decision 1", "Why decision 2"],
"metadata": {"status": "Active"}
}
```
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「memory-contract」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次