Auto-sync: 2026-04-18 00:18
This commit is contained in:
26
wiki/concepts/Agent-Archive.md
Normal file
26
wiki/concepts/Agent-Archive.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "Agent Archive"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## 定义
|
||||
单一 Agent 的私有笔记目录,用于记录该 Agent 的专属思考、工作日志、任务记录和内容输出。
|
||||
|
||||
## 示例
|
||||
```
|
||||
/Users/weishen/Workspace/nexus/openclaw/xingshu/ ← 星枢专属笔记
|
||||
/Users/weishen/Workspace/nexus/openclaw/xinghui/ ← 星辉专属笔记
|
||||
/Users/weishen/Workspace/nexus/openclaw/xingyao/ ← 星曜专属笔记
|
||||
```
|
||||
|
||||
## 核心原则
|
||||
研究过程写入 Agent Archive;经过验证、可复用的知识沉淀到 Knowledge Base。
|
||||
|
||||
## 与 Knowledge Base 的关系
|
||||
Agent Archive 是临时工作区,Knowledge Base 是整理后的公共知识库。AI 在完成任务过程中将产出写入 Archive,验证通过后迁移到 Knowledge Base。
|
||||
|
||||
## 关联
|
||||
- [[Knowledge Base]]
|
||||
- [[OpenClaw]]
|
||||
- [[Obsidian]]
|
||||
24
wiki/concepts/Fallback-机制.md
Normal file
24
wiki/concepts/Fallback-机制.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Fallback 机制"
|
||||
type: concept
|
||||
tags: [ai-agent, model, routing]
|
||||
last_updated: 2026-04-18
|
||||
---
|
||||
|
||||
## Definition
|
||||
当默认模型不可用或出现问题时,AI Agent 系统自动切换到备选模型的机制。
|
||||
|
||||
## Trigger Conditions
|
||||
1. **显式的 API 服务不可用**:503/502/429/Connection Timeout
|
||||
2. **隐性的 Token 长度溢出预判**:估计 Token 接近模型上限
|
||||
3. **配置文件的"优先级"覆盖**:Agent/Channel 特定配置覆盖全局配置
|
||||
4. **节点选择算法**:负载均衡/随机分发可能选中备选模型
|
||||
|
||||
## Problem
|
||||
Fallback 机制可能切到一个比原模型更小的模型(如 16K vs 200K),导致立即 overflow。
|
||||
|
||||
## Related
|
||||
- [[上下文压缩]] — OpenClaw 的 compaction 机制
|
||||
- [[模型配置层级]] — Global Config、Agent Specific Config、环境变量的分层
|
||||
- [[MiniMax-M2.7]] — 作者的默认模型,200K context
|
||||
- [[DeepSeek-Reasoner]] — 只有 16K context 的模型
|
||||
26
wiki/concepts/Graph-View.md
Normal file
26
wiki/concepts/Graph-View.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: "Graph View"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## 定义
|
||||
Obsidian 的知识网络可视化功能(左侧边栏图谱图标,或 `Ctrl+G`),将所有 Wiki 页面以节点展示,双链关系自动连线。
|
||||
|
||||
## Karpathy 推荐的两个用法
|
||||
|
||||
### 健康检查
|
||||
没有任何页面链接指向它 → 说明是"孤岛页面",需要让 AI 补上交叉引用。
|
||||
|
||||
### 发现盲区
|
||||
某个概念被很多页面提到但自己还没有独立页面 → 图谱里显示为灰色幽灵节点,提醒应该为它建一个专页。
|
||||
|
||||
## 核心价值
|
||||
- 发现孤立页面
|
||||
- 识别知识盲区
|
||||
- 建立知识网络
|
||||
|
||||
## 关联
|
||||
- [[Obsidian]]
|
||||
- [[QMD]]
|
||||
- [[双链(Backlinks)]]
|
||||
24
wiki/concepts/Knowledge-Base.md
Normal file
24
wiki/concepts/Knowledge-Base.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Knowledge Base"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## 定义
|
||||
经过整理、跨 Agent 共用的知识库目录,用于存储工具评测、架构决策、最佳实践等可复用知识。
|
||||
|
||||
## 示例
|
||||
```
|
||||
/Users/weishen/Workspace/nexus/openclaw/knowledgebase/ ← 知识库(经过整理的公共知识)
|
||||
```
|
||||
|
||||
## 与 Agent Archive 的关系
|
||||
Agent Archive 是单一 Agent 的私有工作笔记,Knowledge Base 是整理后的公共知识。AI 在完成任务过程中将产出写入 Archive,验证通过后迁移到 Knowledge Base。
|
||||
|
||||
## 核心原则
|
||||
研究过程写入 Agent Archive;经过验证、可复用的知识沉淀到 Knowledge Base。
|
||||
|
||||
## 关联
|
||||
- [[Agent Archive]]
|
||||
- [[Obsidian]]
|
||||
- [[版本控制]]
|
||||
20
wiki/concepts/QMD.md
Normal file
20
wiki/concepts/QMD.md
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "QMD"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## 定义
|
||||
完全本地运行的 Markdown 搜索引擎(github.com/tobi/qmd),用于 Wiki 规模变大后的精准搜索。
|
||||
|
||||
## 使用场景
|
||||
- Wiki 页面数量达到几百个后,`index.md` 目录文件已不够用
|
||||
- AI 找东西开始变慢,需要更高效的搜索能力
|
||||
- 纯本地运行,不依赖外部服务
|
||||
|
||||
## 判断标准
|
||||
Wiki 到几百个页面之前,`index.md` 完全够用;等 AI 找东西开始变慢,再接入 QMD 也不迟。
|
||||
|
||||
## 关联
|
||||
- [[Obsidian]]
|
||||
- [[Graph View]]
|
||||
33
wiki/concepts/上下文修剪.md
Normal file
33
wiki/concepts/上下文修剪.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "上下文修剪"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, context]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
通过 TTL(生存时间)和保留策略主动清理旧上下文的机制,与内存刷新配合工作。
|
||||
|
||||
## Configuration
|
||||
```json
|
||||
{
|
||||
"contextPruning": {
|
||||
"mode": "cache-ttl",
|
||||
"ttl": "6h",
|
||||
"keepLastAssistants": 3
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Mechanism
|
||||
- 6 小时后积极修剪旧上下文
|
||||
- 保留最后 3 个 Assistants 响应
|
||||
- 结合内存刷新:Agent 早期将重要内容写入磁盘,旧上下文在导致溢出前被清理
|
||||
|
||||
## Key Insight
|
||||
长会话是内存系统真正接受测试的地方。短对话很少触及压缩。是 2 小时的深度工作会话中你会丢失上下文且无法找出原因。**在负载下测试你的内存系统,而不仅仅是在快速聊天中。**
|
||||
|
||||
## Related
|
||||
- [[上下文压缩]] — 导致信息丢失的机制
|
||||
- [[内存刷新]] — 在压缩前将重要内容写入磁盘
|
||||
- [[上下文窗口]] — 有限的对话历史容纳量
|
||||
23
wiki/concepts/上下文压缩.md
Normal file
23
wiki/concepts/上下文压缩.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: "上下文压缩"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, context]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
当对话填满 Context Window(上下文窗口)时,OpenClaw 将旧消息压缩成摘要以腾出空间给新消息的机制。
|
||||
|
||||
## Problem
|
||||
压缩摘要抓住了要点,但丢失了细节——姓名、数字、具体决定,统统消失。
|
||||
|
||||
## Key Insight
|
||||
> "这是设计使然。上下文窗口是有限的。但默认行为对一切一视同仁,这意味着你精心设计的第三条消息指令,和第七条消息的闲聊得到了相同待遇。"
|
||||
|
||||
## Solution
|
||||
启用压缩前的内存刷新(Memory Flush),在压缩运行前将重要上下文写入磁盘。
|
||||
|
||||
## Related
|
||||
- [[上下文窗口]] — 有限的对话历史容纳量
|
||||
- [[内存刷新]] — 在压缩前将重要内容写入磁盘的机制
|
||||
- [[上下文记忆]] — AI Agent 保留对话历史的能力
|
||||
29
wiki/concepts/交接协议.md
Normal file
29
wiki/concepts/交接协议.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: "交接协议"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, model-switching]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
在模型切换或会话结束前,将当前上下文写入每日日志的规范,确保新模型或新会话知道之前发生了什么。
|
||||
|
||||
## Problem
|
||||
OpenClaw 代理在切换模型时丢失所有上下文。新模型以新鲜上下文窗口开始——它只看到自动加载的文件。没有交接协议,新模型不知道发生了什么。
|
||||
|
||||
## Solution
|
||||
添加交接协议:在任何模型切换或会话结束前,代理将当前上下文写入每日日志。
|
||||
|
||||
## Implementation
|
||||
在 AGENTS.md 中添加写入纪律:
|
||||
- 每个任务记录其结果
|
||||
- 每个错误变成规则
|
||||
- 在模型切换前将当前状态转储到每日日志
|
||||
|
||||
## Key Insight
|
||||
> "写入纪律比读取纪律更重要。如果代理不将决定、结果和错误记录到磁盘,这些东西只存在于上下文窗口中。而上下文窗口会被压缩。"
|
||||
|
||||
## Related
|
||||
- [[上下文压缩]] — 导致信息丢失的机制
|
||||
- [[内存刷新]] — 在压缩前将重要内容写入磁盘
|
||||
- [[模型切换]] — OpenClaw 切换模型时的上下文丢失问题
|
||||
34
wiki/concepts/内存刷新.md
Normal file
34
wiki/concepts/内存刷新.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: "内存刷新"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, persistence]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
在压缩触发前,提醒 Agent 将重要上下文写入磁盘的机制,确保重要内容在压缩擦除后仍能存活。
|
||||
|
||||
## Mechanism
|
||||
当会话接近上下文限制时,OpenClaw 触发一个静默回合,提醒 Agent 在压缩运行前将持久事实保存到 memory/YYYY-MM-DD.md。
|
||||
|
||||
## Configuration
|
||||
```json
|
||||
{
|
||||
"compaction": {
|
||||
"memoryFlush": {
|
||||
"enabled": true,
|
||||
"softThresholdTokens": 4000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> 注意:4000 这个数值要根据使用的模型来调整。使用 Gemini/Claude/GPT-4.1 等大模型(上下文窗口 32K/128K/200K tokens)时,4000 太保守,会导致频繁的 summary 和上下文"碎片化"。
|
||||
|
||||
## Key Insight
|
||||
如果只在上下文窗口中,它是临时的。如果在磁盘上,它就能存活。
|
||||
|
||||
## Related
|
||||
- [[上下文压缩]] — 导致信息丢失的机制
|
||||
- [[上下文窗口]] — 有限的对话历史容纳量
|
||||
- [[上下文记忆]] — AI Agent 保留对话历史的能力
|
||||
15
wiki/concepts/品味.md
Normal file
15
wiki/concepts/品味.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "品味"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## Definition
|
||||
能判断AI给出的多个方案中哪个是insanely great的能力。在AI工具民主化的时代,品味成为个人核心竞争力。
|
||||
|
||||
## Related Concepts
|
||||
- [[一人公司模式]]
|
||||
- [[天才地带]]
|
||||
|
||||
## Source
|
||||
- [[bu-tan-ji-shu-pu-tong-ren-gai-zen-me-zai-ai-shi-dai-zhuan-qian]]
|
||||
31
wiki/concepts/检索指令.md
Normal file
31
wiki/concepts/检索指令.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: "检索指令"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, retrieval]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
告诉 Agent 何时搜索的明确指令,是启动序列的重要组成部分。
|
||||
|
||||
## Problem
|
||||
搜索基础设施存在 ≠ Agent 使用搜索。"信息存在"和"Agent使用信息"之间有区别。
|
||||
|
||||
## Solution
|
||||
在启动序列中添加明确的检索指令,告诉 Agent 何时搜索:
|
||||
|
||||
> 开始任何任务前:
|
||||
> - 搜索每日日志(memory/YYYY-MM-DD.md)获取相关上下文
|
||||
> - 检查LEARNINGS.md获取此类任务的规则
|
||||
> - 如果提到客户,搜索其历史记录
|
||||
|
||||
## Testing
|
||||
建立检索测试:在每日日志中植入特定标记,然后开始新会话测试 Agent 是否能找到。
|
||||
|
||||
## Key Insight
|
||||
搜索基础设施处理"信息存在",启动指令和检索习惯处理"Agent使用信息"。分别测试两者。
|
||||
|
||||
## Related
|
||||
- [[上下文记忆]] — AI Agent 保留对话历史的能力
|
||||
- [[内存刷新]] — 在压缩前将重要内容写入磁盘
|
||||
- [[混合搜索]] — 结合关键词和语义的搜索策略
|
||||
15
wiki/concepts/死亡过滤器.md
Normal file
15
wiki/concepts/死亡过滤器.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "死亡过滤器"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## Definition
|
||||
每天早上问自己"如果今天是最后一天,我还会做今天要做的事吗?"。用于过滤非必要的承诺,聚焦真正热爱的事。
|
||||
|
||||
## Related Concepts
|
||||
- [[Ikigai]]
|
||||
- [[天才地带]]
|
||||
|
||||
## Source
|
||||
- [[bu-tan-ji-shu-pu-tong-ren-gai-zen-me-zai-ai-shi-dai-zhuan-qian]]
|
||||
32
wiki/concepts/混合搜索.md
Normal file
32
wiki/concepts/混合搜索.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "混合搜索"
|
||||
type: concept
|
||||
tags: [ai-agent, search, rag]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
结合 BM25(关键词匹配)、向量嵌入(语义相似性)和重排序器的搜索策略。
|
||||
|
||||
## Components
|
||||
1. **BM25**:关键词匹配,擅长精确短语和专有名词
|
||||
2. **向量嵌入**:语义相似性,擅长理解查询意图
|
||||
3. **重排序器**:按相关性排序结果
|
||||
|
||||
## Problem Solved
|
||||
纯语义搜索在专有名词、具体数字和确切短语上失败。关键词搜索抓住它们。两者都用效果更好。
|
||||
|
||||
## Comparison
|
||||
| 搜索方式 | 优点 | 缺点 |
|
||||
|---------|------|------|
|
||||
| 纯向量搜索 | 语义理解 | 精确匹配差 |
|
||||
| 纯 BM25 | 精确匹配 | 无法理解同义词 |
|
||||
| 混合搜索 | 结合两者优势 | 实现更复杂 |
|
||||
|
||||
## Implementation
|
||||
切换到 QMD 作为内存搜索后端,实现混合搜索策略。
|
||||
|
||||
## Related
|
||||
- [[语义搜索]] — 纯向量搜索
|
||||
- [[向量嵌入]] — 将文本转换为数值向量
|
||||
- [[上下文记忆]] — AI Agent 保留对话历史的能力
|
||||
15
wiki/concepts/端到端.md
Normal file
15
wiki/concepts/端到端.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
title: "端到端"
|
||||
type: concept
|
||||
tags: []
|
||||
---
|
||||
|
||||
## Definition
|
||||
从想法到产品的完整控制权。区别于在他人AI流水线中做零件,端到端意味着独立完成产品/服务的设计、开发、交付全过程。
|
||||
|
||||
## Related Concepts
|
||||
- [[一人公司模式]]
|
||||
- [[产品体系]]
|
||||
|
||||
## Source
|
||||
- [[bu-tan-ji-shu-pu-tong-ren-gai-zen-me-zai-ai-shi-dai-zhuan-qian]]
|
||||
Reference in New Issue
Block a user