写入用户认知记忆
cognitive_writePersist conversation insights as structured cognitive memories: facts, preferences, emotional patterns, values, and workflows. For rules, include causal context so future actions respect user intent.
Instructions
写入一条关于用户的认知记忆。适用于对话中出现的:客观事实、明确的偏好或规则、表达的真实含义、情绪模式、价值观、工作流程、重要事件。
规则类记忆(protocol/pragmatic)必须带因果说明:记录"为什么"而不是扁平结论。例如不要只记"用户发长段落时不要直接执行",而要记"用户长文+探讨意图=头脑风暴的邀请,直接动手会打断思路"。
Args:
type (string, 必填): 内容类型,见下方枚举说明
content (string 或 object): 记忆内容
domain (string, 可选): 主生活域
scope (string[], 可选): 场景标签
depth (string, 可选): D1-D4 抽象深度,默认 D1
confidence (number, 0-1, 默认 0.7): 置信度
is_dynamic (boolean, 默认 false): 动态内容
pending_follow_up (boolean, 默认 false): 待跟进
Returns: { "memory_id": string, // 新记忆 ID "type": string, "content": ..., "domain": string, "confidence": number }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | 内容类型:fact(客观事实)/protocol(交互规则偏好)/pragmatic(表达真实含义)/emotional(情绪状态模式)/value(价值观)/procedure(工作流)/episodic(具体事件) | |
| depth | No | 抽象深度:D1 事件 / D2 模式 / D3 规则 / D4 内核(默认 D1) | |
| scope | No | 适用场景标签(如 ["汇报","PPT"]) | |
| domain | No | 生活域(默认 uncategorized) | |
| content | Yes | 记忆内容。规则类(protocol/pragmatic)建议带因果说明,如"长文+探讨意图=头脑风暴邀请,直接动手会打断思路";事实类可为键值对象 | |
| confidence | No | 置信度 0-1(默认 0.7) | |
| is_dynamic | No | 是否为动态内容(如临时状态) | |
| message_id | No | 来源消息 ID | |
| conversation_id | No | 来源会话 ID | |
| pending_follow_up | No | 是否有待跟进事项 |