diff --git a/notes/pics/agent-memory.png b/notes/pics/agent-memory.png index 820f5fd6..e339c453 100644 Binary files a/notes/pics/agent-memory.png and b/notes/pics/agent-memory.png differ diff --git a/notes/pics/agent-messages.png b/notes/pics/agent-messages.png index 37394800..3c27bd6d 100644 Binary files a/notes/pics/agent-messages.png and b/notes/pics/agent-messages.png differ diff --git a/notes/pics/agent-overview.png b/notes/pics/agent-overview.png index 8ac0f23f..c14ba5ab 100644 Binary files a/notes/pics/agent-overview.png and b/notes/pics/agent-overview.png differ diff --git a/notes/pics/attention-example.png b/notes/pics/attention-example.png index 764cb531..b5eb9663 100644 Binary files a/notes/pics/attention-example.png and b/notes/pics/attention-example.png differ diff --git a/notes/pics/constrained-decoding.png b/notes/pics/constrained-decoding.png index f29646c1..d5800f35 100644 Binary files a/notes/pics/constrained-decoding.png and b/notes/pics/constrained-decoding.png differ diff --git a/notes/pics/context-compression.png b/notes/pics/context-compression.png index f9a83a63..8f91c1d6 100644 Binary files a/notes/pics/context-compression.png and b/notes/pics/context-compression.png differ diff --git a/notes/pics/context-window.png b/notes/pics/context-window.png index 9e086fbb..4c5fb948 100644 Binary files a/notes/pics/context-window.png and b/notes/pics/context-window.png differ diff --git a/notes/pics/embedding-vs-rerank.png b/notes/pics/embedding-vs-rerank.png index 95189341..6705e0fd 100644 Binary files a/notes/pics/embedding-vs-rerank.png and b/notes/pics/embedding-vs-rerank.png differ diff --git a/notes/pics/gqa.png b/notes/pics/gqa.png index 4f0bcf7d..2e7c2b96 100644 Binary files a/notes/pics/gqa.png and b/notes/pics/gqa.png differ diff --git a/notes/pics/hnsw.png b/notes/pics/hnsw.png index 1983350f..d7996301 100644 Binary files a/notes/pics/hnsw.png and b/notes/pics/hnsw.png differ diff --git a/notes/pics/kv-cache.png b/notes/pics/kv-cache.png index c8d2b14c..bad2456f 100644 Binary files a/notes/pics/kv-cache.png and b/notes/pics/kv-cache.png differ diff --git a/notes/pics/llm-autoregressive.png b/notes/pics/llm-autoregressive.png index df6b8f9d..6c6917de 100644 Binary files a/notes/pics/llm-autoregressive.png and b/notes/pics/llm-autoregressive.png differ diff --git a/notes/pics/llm-sampling.png b/notes/pics/llm-sampling.png index a6eba06b..5fb3446d 100644 Binary files a/notes/pics/llm-sampling.png and b/notes/pics/llm-sampling.png differ diff --git a/notes/pics/llm-training.png b/notes/pics/llm-training.png index 5c82d00e..696e63ea 100644 Binary files a/notes/pics/llm-training.png and b/notes/pics/llm-training.png differ diff --git a/notes/pics/lora.png b/notes/pics/lora.png index 60fe393b..b67d3385 100644 Binary files a/notes/pics/lora.png and b/notes/pics/lora.png differ diff --git a/notes/pics/mcp-integration.png b/notes/pics/mcp-integration.png index 1cf72c64..68e47c37 100644 Binary files a/notes/pics/mcp-integration.png and b/notes/pics/mcp-integration.png differ diff --git a/notes/pics/mcp.png b/notes/pics/mcp.png index 5ae8436f..65489e26 100644 Binary files a/notes/pics/mcp.png and b/notes/pics/mcp.png differ diff --git a/notes/pics/multi-agent.png b/notes/pics/multi-agent.png index dc0c2f4b..38908212 100644 Binary files a/notes/pics/multi-agent.png and b/notes/pics/multi-agent.png differ diff --git a/notes/pics/plan-execute.png b/notes/pics/plan-execute.png index 5190f169..c05f5440 100644 Binary files a/notes/pics/plan-execute.png and b/notes/pics/plan-execute.png differ diff --git a/notes/pics/prompt-injection.png b/notes/pics/prompt-injection.png index 61a5ee44..f871bb8b 100644 Binary files a/notes/pics/prompt-injection.png and b/notes/pics/prompt-injection.png differ diff --git a/notes/pics/rag-chunking.png b/notes/pics/rag-chunking.png index a890a7a2..183c262d 100644 Binary files a/notes/pics/rag-chunking.png and b/notes/pics/rag-chunking.png differ diff --git a/notes/pics/rag-pipeline.png b/notes/pics/rag-pipeline.png index 2479f9c6..402e289e 100644 Binary files a/notes/pics/rag-pipeline.png and b/notes/pics/rag-pipeline.png differ diff --git a/notes/pics/react-loop.png b/notes/pics/react-loop.png index 935dcb3b..93aac98b 100644 Binary files a/notes/pics/react-loop.png and b/notes/pics/react-loop.png differ diff --git a/notes/pics/skills.png b/notes/pics/skills.png index c42259f6..9cecb3c9 100644 Binary files a/notes/pics/skills.png and b/notes/pics/skills.png differ diff --git a/notes/pics/tool-call-inside.png b/notes/pics/tool-call-inside.png index fd1f7712..b79a8ce6 100644 Binary files a/notes/pics/tool-call-inside.png and b/notes/pics/tool-call-inside.png differ diff --git a/notes/pics/transformer-block.png b/notes/pics/transformer-block.png index 77ceb3d8..35b4409f 100644 Binary files a/notes/pics/transformer-block.png and b/notes/pics/transformer-block.png differ diff --git a/notes/pics/workflow-vs-agent.png b/notes/pics/workflow-vs-agent.png index a125253f..4d11800a 100644 Binary files a/notes/pics/workflow-vs-agent.png and b/notes/pics/workflow-vs-agent.png differ diff --git a/tools/diagram/src/agent-memory.svg b/tools/diagram/src/agent-memory.svg index b63cdf47..3592d584 100644 --- a/tools/diagram/src/agent-memory.svg +++ b/tools/diagram/src/agent-memory.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,30 +33,30 @@ Agent 的长期记忆 10 月 1 日的会话 - + 用户:我对花生过敏,推荐个早餐 助手:推荐燕麦粥和鸡蛋…… 会话结束后,用模型提取值得保存的信息 - - - + + + 长期记忆 数据库 / 向量库 - - + + 用户 1024 的记忆 - + 对花生过敏(10-01) - + 住在杭州(09-12) - + 喜欢简短的回答(08-30) 写入 10 月 8 日的新会话 - + 用户:推荐一款零食 上下文 @@ -65,17 +65,17 @@ 按当前问题检索相关的记忆 - - - - - - - - + + + + + + + + 大模型 - + 推荐海苔,不含花生 diff --git a/tools/diagram/src/agent-messages.svg b/tools/diagram/src/agent-messages.svg index b0d29236..8ae64e43 100644 --- a/tools/diagram/src/agent-messages.svg +++ b/tools/diagram/src/agent-messages.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,8 +39,7 @@ user 订单 1024 到哪了? - - + 模型返回 调用 query_order(1024) 第 2 次调用 @@ -50,15 +49,14 @@ user 订单 1024 到哪了? - + assistant 调用 query_order(1024) - + tool 快递单号 SF123,已发货 - - + 模型返回 调用 track("SF123") 第 3 次调用 @@ -74,18 +72,17 @@ tool 快递单号 SF123,已发货 - + assistant 调用 track("SF123") - + tool 已到达杭州转运中心 - - + 模型返回 订单已发货,目前在杭州转运中心 - + 上一步新增的消息:模型的调用请求和应用执行工具的结果 模型不保存状态,每次都发送完整的历史;第 3 次模型不再请求调用工具,循环结束。 diff --git a/tools/diagram/src/agent-overview.svg b/tools/diagram/src/agent-overview.svg index d2fdd950..5161377f 100644 --- a/tools/diagram/src/agent-overview.svg +++ b/tools/diagram/src/agent-overview.svg @@ -1,38 +1,38 @@ - + - + - + Agent:模型决策,应用执行 - - + + 用户 @@ -45,14 +45,14 @@ } 应用代码 控制循环、校验参数和权限 - - - - - - - - + + + + + + + + 大模型 只输出文本 @@ -63,31 +63,31 @@ 消息历史 + 工具列表 要调用的工具和参数,或最终回答 - - - - - - - - - + + + + + + + + + 订单服务 query_order - - - - - - - - - + + + + + + + + + 物流服务 track - - - + + + 记忆存储 用户偏好 diff --git a/tools/diagram/src/attention-example.svg b/tools/diagram/src/attention-example.svg index 1e92ac6e..eeb17d23 100644 --- a/tools/diagram/src/attention-example.svg +++ b/tools/diagram/src/attention-example.svg @@ -1,43 +1,43 @@ - + - + - + 注意力的计算:以“饿”为例 - + Token - + Q - + K - + V 小猫 @@ -55,9 +55,9 @@ (0, 1) (0, 1) - + 饿 - + (2, 0.5) (1, 1) @@ -69,13 +69,13 @@ 很 2×0 + 0.5×1 = 0.5 → 0.35 饿 2×1 + 0.5×1 = 2.5 → 1.77 ① 分数(行:查询,列:键) - + 小猫 - + 很 - + 饿 - + 小猫 1.41 @@ -83,7 +83,7 @@ -∞ -∞ - + 很 0.00 @@ -91,22 +91,22 @@ 0.71 -∞ - + 饿 - + 2.83 - + 0.35 - + 1.77 ② 每行做 softmax 得到权重 - + 小猫 - + 很 - + 饿 - + 小猫 1.00 @@ -114,7 +114,7 @@ 0 0 - + 很 0.33 @@ -122,13 +122,13 @@ 0.67 0 - + 饿 - + 0.70 - + 0.06 - + 0.24 ③ 按权重对 V 求和 0.70 × (1, 0) diff --git a/tools/diagram/src/constrained-decoding.svg b/tools/diagram/src/constrained-decoding.svg index 0c9756c5..47630d45 100644 --- a/tools/diagram/src/constrained-decoding.svg +++ b/tools/diagram/src/constrained-decoding.svg @@ -1,31 +1,31 @@ - + - + - + @@ -39,7 +39,7 @@ 0.35 26 - + 0.30 二十六 @@ -48,14 +48,14 @@ 0.15 - - + 0.05 屏蔽后重新归一化 晴 屏蔽 26 - + 0.86 二十六 @@ -64,7 +64,7 @@ 屏蔽 - - + 0.14 diff --git a/tools/diagram/src/context-compression.svg b/tools/diagram/src/context-compression.svg index b9e13ba4..fd0c8423 100644 --- a/tools/diagram/src/context-compression.svg +++ b/tools/diagram/src/context-compression.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,42 +33,42 @@ 上下文压缩 压缩前 合计 147.5K,超过 128K 的窗口 - + 系统 2K - + 工具定义 3K - + 第 1~25 轮对话 60K - + 工具返回的原始数据 70K - + 第 26~30 轮 12K - + 问题 0.5K 压缩后 合计 20K - + 系统 2K - + 工具定义 3K - + 前 25 轮的摘要 2K - + 说明 + 存储路径 0.5K - + 第 26~30 轮 12K - + 问题 0.5K diff --git a/tools/diagram/src/context-window.svg b/tools/diagram/src/context-window.svg index fa5b2bd3..7d7a38ef 100644 --- a/tools/diagram/src/context-window.svg +++ b/tools/diagram/src/context-window.svg @@ -1,45 +1,45 @@ - + - + - + 上下文窗口里放什么 - + 系统规则 - + 工具定义 - + 检索资料 - + 对话历史 - + 当前问题 留给输出 @@ -48,7 +48,7 @@ 上下文窗口:输入和输出共享同一个 Token 上限 - + 开头 中间 结尾 diff --git a/tools/diagram/src/embedding-vs-rerank.svg b/tools/diagram/src/embedding-vs-rerank.svg index 49c20f1b..b581abea 100644 --- a/tools/diagram/src/embedding-vs-rerank.svg +++ b/tools/diagram/src/embedding-vs-rerank.svg @@ -1,57 +1,57 @@ - + - + - + 召回与重排 - + 知识库 100 万个切片 - + 召回 向量 + 关键词,约 50 条 - + 重排 约 5 条 - + 提示词 Embedding 模型:问题和文档分别编码 问题 - + 向量 比较 - + 文档向量(提前算好) 快 @@ -59,7 +59,7 @@ 问题 + 候选 i - + 分数 准 每条候选都要算一遍,只适合少量候选 diff --git a/tools/diagram/src/gqa.svg b/tools/diagram/src/gqa.svg index 713652aa..b336ce19 100644 --- a/tools/diagram/src/gqa.svg +++ b/tools/diagram/src/gqa.svg @@ -1,53 +1,53 @@ - + - + - + MHA、GQA 与 MQA MHA - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -58,16 +58,16 @@ KV Cache:8 份 GQA - - - - - - - - - - + + + + + + + + + + @@ -78,15 +78,15 @@ KV Cache:2 份,为 MHA 的 1/4 MQA - - - - - - - - - + + + + + + + + + @@ -96,9 +96,9 @@ KV Cache:1 份,为 MHA 的 1/8 - + 查询头 Q - + 一组 K、V,需要缓存 Qwen2.5-7B 使用 GQA:28 个查询头共享 4 组 K、V,每个 Token 的 KV Cache 为 56 KB,MHA 需要 392 KB diff --git a/tools/diagram/src/hnsw.svg b/tools/diagram/src/hnsw.svg index c680c1cd..677a0c53 100644 --- a/tools/diagram/src/hnsw.svg +++ b/tools/diagram/src/hnsw.svg @@ -1,31 +1,31 @@ - + - + - + @@ -76,33 +76,33 @@ - - - - + + + + - + - - - - - - - - - - - - + + + + + + + + + + + + - + - + 入口 最近邻 - + 查询向量 每层贪心地走向离查询更近的节点,走不动了就下降一层 diff --git a/tools/diagram/src/kv-cache.svg b/tools/diagram/src/kv-cache.svg index 341b3303..5f4222fa 100644 --- a/tools/diagram/src/kv-cache.svg +++ b/tools/diagram/src/kv-cache.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,46 +33,46 @@ KV Cache:算过的 K、V 不再重算 预填充 Prefill - + 今天 - + 天气 - + 很 一次处理整个输入,决定首 Token 延迟 解码 第 1 步 - + 今天 - + 天气 - + 很 - + 好 解码 第 2 步 - + 今天 - + 天气 - + 很 - + 好 - + 结束 每步只算 1 个新 Token, 决定后续的输出速度 - + 本步计算 Q、K、V,并把 K、V 写入缓存 - + 直接读取缓存中的 K、V 上下文越长,缓存占用的显存越多 diff --git a/tools/diagram/src/llm-autoregressive.svg b/tools/diagram/src/llm-autoregressive.svg index b8d7328c..02cb218f 100644 --- a/tools/diagram/src/llm-autoregressive.svg +++ b/tools/diagram/src/llm-autoregressive.svg @@ -1,48 +1,47 @@ - + - + - + 自回归生成 第 1 步 - + 今天 - + 天气 - - + 模型 很 - + 0.46 不 @@ -51,19 +50,18 @@ 0.15 第 2 步 - + 今天 - + 天气 - + 很 - - + 模型 好 - + 0.62 热 @@ -72,21 +70,20 @@ 0.12 第 3 步 - + 今天 - + 天气 - + 很 - + 好 - - + 模型 结束 - + 0.71 , @@ -98,5 +95,5 @@ 选出一个,追加到末尾 选出一个,追加到末尾 - 蓝色为输入,黄色为模型生成的 Token;生成结束标记时停止 + 蓝色为输入,淡紫色为模型生成的 Token;生成结束标记时停止 diff --git a/tools/diagram/src/llm-sampling.svg b/tools/diagram/src/llm-sampling.svg index 05d7bc6f..abc66bfc 100644 --- a/tools/diagram/src/llm-sampling.svg +++ b/tools/diagram/src/llm-sampling.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,7 +33,7 @@ 温度与 Top-p 温度 0.5 好 - + 0.75 热 @@ -49,7 +49,7 @@ 0.01 温度 1(原始分布) 好 - + 0.50 热 @@ -65,7 +65,7 @@ 0.05 温度 1.5 好 - + 0.40 热 @@ -81,7 +81,7 @@ 0.09 Top-p = 0.8 好 - + 0.57 热 diff --git a/tools/diagram/src/llm-training.svg b/tools/diagram/src/llm-training.svg index 92c9ad88..45dfb9a0 100644 --- a/tools/diagram/src/llm-training.svg +++ b/tools/diagram/src/llm-training.svg @@ -1,76 +1,70 @@ - + - + - + 大模型的训练过程 - - + 预训练 数万亿 Token 的网页、书籍、代码 ……杭州是浙江省的省会, 位于钱塘江下游…… - - + 基座模型:只会续写 输入:中国的首都是 输出:哪个城市?A. 上海 B. 北京 - - + 监督微调 SFT 上万条人工编写的指令和回答 指令:把“你好”翻译成英文 回答:Hello - - + 对话模型:能遵循指令 输入:中国的首都是? 输出:北京。 - - + 偏好对齐 RLHF / DPO 同一问题的两个回答,标注哪个更好 回答 A:……(较好) 回答 B:……(较差) - - + 更有帮助、更安全 输入:帮我写一条诈骗短信 diff --git a/tools/diagram/src/lora.svg b/tools/diagram/src/lora.svg index 9a9ed400..75043e89 100644 --- a/tools/diagram/src/lora.svg +++ b/tools/diagram/src/lora.svg @@ -1,46 +1,46 @@ - + - + - + LoRA:只训练两个小矩阵 - + W 4096 × 4096 冻结,不更新 + - + B 4096 × 8 × - + A:8 × 4096 只训练 B 和 A 参数量(r = 8) diff --git a/tools/diagram/src/mcp-integration.svg b/tools/diagram/src/mcp-integration.svg index 2570c30c..2dd5eaed 100644 --- a/tools/diagram/src/mcp-integration.svg +++ b/tools/diagram/src/mcp-integration.svg @@ -1,31 +1,31 @@ - + - + - + @@ -38,12 +38,12 @@ IDE - - - - - - + + + + + + GitHub @@ -51,9 +51,9 @@ 聊天应用 - - - + + + 数据库 @@ -86,12 +86,12 @@ IDE - - - - - - + + + + + + GitHub @@ -101,9 +101,9 @@ 聊天应用 - - - + + + 数据库 @@ -120,7 +120,7 @@ 文件系统 - + MCP 应用实现客户端,工具实现服务端:3 + 3 = 6 份 diff --git a/tools/diagram/src/mcp.svg b/tools/diagram/src/mcp.svg index 771fae39..7a2b3ce9 100644 --- a/tools/diagram/src/mcp.svg +++ b/tools/diagram/src/mcp.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,32 +33,32 @@ MCP 的组成 主机 Host(AI 应用) - - - - - - - - + + + + + + + + 大模型 - + 客户端 Client A - + 客户端 Client B 选择工具 调用结果 - - - - - - - - - + + + + + + + + + 服务端:文件系统 本地进程 @@ -68,15 +68,15 @@ list_dir Tools、Resources、Prompts - - - - - - - - - + + + + + + + + + 服务端:GitHub 远程服务 diff --git a/tools/diagram/src/multi-agent.svg b/tools/diagram/src/multi-agent.svg index 0a8c16d0..31ad8afc 100644 --- a/tools/diagram/src/multi-agent.svg +++ b/tools/diagram/src/multi-agent.svg @@ -1,87 +1,87 @@ - + - + - + 多 Agent:主从模式 - - - - - - - - + + + + + + + + 主 Agent 拆分任务、汇总结果,上下文中只有任务和结论 - - - - - - - - + + + + + + + + 子 Agent:调研厂商 A - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token - - - - - - - - + + + + + + + + 子 Agent:调研厂商 B - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token - - - - - - - - + + + + + + + + 子 Agent:调研厂商 C - + 读取 30 个网页、反复搜索, 自己的上下文用了 8 万 Token diff --git a/tools/diagram/src/plan-execute.svg b/tools/diagram/src/plan-execute.svg index 0368e1f6..d61774be 100644 --- a/tools/diagram/src/plan-execute.svg +++ b/tools/diagram/src/plan-execute.svg @@ -1,95 +1,93 @@ - + - + - + ReAct 与先规划后执行 - + 任务:对比 A、B 两款手机的价格和续航 ReAct:边想边做 - + 思考 - + 查 A 的价格 - + 思考 - + 查 B 的价格 - + 思考 - + 查 A 的续航 - + 思考 - + 查 B 的续航 - + 思考 - + 回答 5 次模型调用, 串行执行 先规划后执行 - - + 规划 1 次调用 - + 查 A 的价格 - + 查 B 的价格 - + 查 A 的续航 - + 查 B 的续航 - - + 汇总 1 次调用 4 个步骤可以并行 diff --git a/tools/diagram/src/prompt-injection.svg b/tools/diagram/src/prompt-injection.svg index 9c75e6fe..a7ddb6ee 100644 --- a/tools/diagram/src/prompt-injection.svg +++ b/tools/diagram/src/prompt-injection.svg @@ -1,49 +1,49 @@ - + - + - + 间接提示词注入 - - + + 用户 - + 帮我总结这个网页 - - - - - - - - + + + + + + + + 大模型 diff --git a/tools/diagram/src/rag-chunking.svg b/tools/diagram/src/rag-chunking.svg index c92896ff..fb032aeb 100644 --- a/tools/diagram/src/rag-chunking.svg +++ b/tools/diagram/src/rag-chunking.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,7 +33,7 @@ 切片的两种常用做法 相邻切片保留重叠 - + …… 年假按自然年计算, 工作满 1 年不满 10 年的, @@ -48,11 +48,11 @@ 重叠部分同时出现在两个切片中 父子切片 - + 父切片:完整的一节 子切片 1 - + 子切片 2 子切片 3 diff --git a/tools/diagram/src/rag-pipeline.svg b/tools/diagram/src/rag-pipeline.svg index 15de7ad0..c4ec0876 100644 --- a/tools/diagram/src/rag-pipeline.svg +++ b/tools/diagram/src/rag-pipeline.svg @@ -1,31 +1,31 @@ - + - + - + @@ -54,17 +54,17 @@ [0.80, 0.07, …] [-0.31, 0.44, …] - - - + + + 向量数据库 并建关键词索引 在线:检索并生成 - - + + 用户 - + 工作两年有几天年假? @@ -73,7 +73,6 @@ 查询 - 提示词 根据以下资料回答,并标注来源: @@ -81,17 +80,17 @@      不满 10 年的,每年 5 天 问题:工作两年有几天年假? - - - - - - - - + + + + + + + + 大模型 - + 5 天 [1] 资料来自检索,回答附上来源,便于核对 diff --git a/tools/diagram/src/react-loop.svg b/tools/diagram/src/react-loop.svg index 6f3070f2..579e8363 100644 --- a/tools/diagram/src/react-loop.svg +++ b/tools/diagram/src/react-loop.svg @@ -1,70 +1,62 @@ - + - + - + ReAct:根据上一步的结果决定下一步 - + 问题:订单 1024 到哪了? 思考 行动 观察 - - + 需要先查订单,拿到快递单号 - query_order(1024) - - + 快递单号 SF123,已发货 - - + 用快递单号查物流 - track("SF123") - - + 已到达杭州转运中心 - - + 信息足够,可以回答 - - + 最终回答:订单 1024 已发货,目前在杭州转运中心 结果放回上下文 diff --git a/tools/diagram/src/skills.svg b/tools/diagram/src/skills.svg index cb74e2e9..a002cda4 100644 --- a/tools/diagram/src/skills.svg +++ b/tools/diagram/src/skills.svg @@ -1,31 +1,31 @@ - + - + - + @@ -35,7 +35,7 @@ ① 启动时:每个 Skill 只加载名称和描述,约 100 Token pdf-processing:提取 PDF 中的文字和表格…… - + weekly-report:按团队模板生成周报,用户要求写周报时使用 sql-review:检查 SQL 的性能和规范…… @@ -44,8 +44,7 @@ ③ 按需读取模板、运行脚本: 脚本的代码不进入上下文,只有运行结果进入 - - + weekly-report/ SKILL.md 名称、描述和操作步骤 diff --git a/tools/diagram/src/tool-call-inside.svg b/tools/diagram/src/tool-call-inside.svg index 366eea1e..cf18c615 100644 --- a/tools/diagram/src/tool-call-inside.svg +++ b/tools/diagram/src/tool-call-inside.svg @@ -1,65 +1,61 @@ - + - + - + 工具调用的内部过程 - ① 应用发出的请求 messages: [   {"role": "user",    "content": "杭州今天天气怎么样?"}] - + tools: [get_weather(city)] - ② 推理服务按模板拼成提示词 <|im_start|>system - + <tools>{get_weather 的定义}</tools> - + 需要调用时输出 <tool_call>…</tool_call> <|im_start|>user 杭州今天天气怎么样? - ③ 模型生成的文本 - + <tool_call> - + {"name": "get_weather", - +  "arguments": {"city": "杭州"}} - + </tool_call> - ④ 推理服务解析后返回给应用 tool_calls: [{ diff --git a/tools/diagram/src/transformer-block.svg b/tools/diagram/src/transformer-block.svg index f68329c3..8ae36597 100644 --- a/tools/diagram/src/transformer-block.svg +++ b/tools/diagram/src/transformer-block.svg @@ -1,56 +1,53 @@ - + - + - + Decoder-only Transformer - + 小猫 - + 很 - + 饿 - - + 词嵌入 每个 Token 转为一个向量 Qwen2.5-7B 中为 3584 维 × 28 层 - - + 注意力 - - + 前馈网络 FFN Token 之间交换信息 @@ -62,8 +59,7 @@ 残差 每个子层后都有归一化 - - + 线性层 + softmax 用最后一个位置的向量 给词表中每个 Token 打分 diff --git a/tools/diagram/src/workflow-vs-agent.svg b/tools/diagram/src/workflow-vs-agent.svg index 81a913aa..e9d0e60a 100644 --- a/tools/diagram/src/workflow-vs-agent.svg +++ b/tools/diagram/src/workflow-vs-agent.svg @@ -1,31 +1,31 @@ - + - + - + @@ -33,59 +33,52 @@ 工作流与 Agent 工作流:代码决定步骤 - + 用户消息 - - - - - - - - + + + + + + + + 大模型分类 - - + 退款流程 退款 - - + 物流查询 物流 - - + 转人工 其它 可预测、成本可控 Agent:大模型决定下一步 - - - - - - - - + + + + + + + + 循环决策 - - + 查订单 - - + 查物流 - - + 退款 - - + 转人工 灵活,但成本更高、错误会累积