Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

19.8 KB
Raw Blame
<svg xmlns="http://www.w3.org/2000/svg" width="1500" height="1060" viewBox="0 0 1500 1060" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif">
<rect x="0" y="0" width="1500" height="1060" rx="20" fill="#FFFFFF"/>
<text x="40" y="46" font-size="26" font-weight="700" fill="#1F2329" text-anchor="start">一轮对话里发生了什么</text>
<rect x="40" y="70" width="1420" height="110" rx="0" fill="#F5F9FF"/>
<text x="105" y="131" font-size="17" font-weight="700" fill="#3370FF" text-anchor="middle">客户端</text>
<rect x="40" y="180" width="1420" height="120" rx="0" fill="#F7F3FF"/>
<text x="105" y="235" font-size="17" font-weight="700" fill="#7F3BF5" text-anchor="middle">OpenViking</text>
<text x="105" y="257" font-size="17" font-weight="700" fill="#7F3BF5" text-anchor="middle">网关</text>
<rect x="40" y="300" width="1420" height="110" rx="0" fill="#F1EBFF"/>
<text x="105" y="361" font-size="17" font-weight="700" fill="#6425D0" text-anchor="middle">OpenViking</text>
<rect x="40" y="410" width="1420" height="110" rx="0" fill="#FFF8F0"/>
<text x="105" y="471" font-size="17" font-weight="700" fill="#FF8800" text-anchor="middle">上游模型</text>
<rect x="40" y="70" width="1420" height="450" rx="0" fill="none" stroke="#E5E6EB" stroke-width="1"/>
<line x1="40" y1="180" x2="1460" y2="180" stroke="#E5E6EB" stroke-width="1"/>
<line x1="40" y1="300" x2="1460" y2="300" stroke="#E5E6EB" stroke-width="1"/>
<line x1="40" y1="410" x2="1460" y2="410" stroke="#E5E6EB" stroke-width="1"/>
<line x1="170" y1="70" x2="170" y2="520" stroke="#E5E6EB" stroke-width="1"/>
<rect x="190" y="90" width="200" height="74" rx="10" fill="#FFFFFF" stroke="#3370FF" stroke-width="1.8"/>
<text x="290" y="123.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">用户发出新消息</text>
<text x="290" y="142.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">客户端带上完整历史</text>
<rect x="1124" y="95" width="186" height="65" rx="10" fill="#FFFFFF" stroke="#3370FF" stroke-width="1.8"/>
<text x="1217" y="133.42" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">用户看到回复</text>
<rect x="190" y="200" width="200" height="84" rx="10" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.8"/>
<text x="290" y="238.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">校验密钥,识别对话</text>
<text x="290" y="257.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">区分新消息和辅助请求</text>
<circle cx="192" cy="202" r="13" fill="#7F3BF5"/>
<text x="192" y="207.5" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">1</text>
<rect x="416" y="200" width="200" height="84" rx="10" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.8"/>
<text x="516" y="228.095" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">原样放回</text>
<text x="516" y="248.895" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">之前补充的记忆</text>
<text x="516" y="268.165" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">放回原位,逐字节一致</text>
<circle cx="418" cy="202" r="13" fill="#7F3BF5"/>
<text x="418" y="207.5" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">2</text>
<rect x="642" y="200" width="200" height="84" rx="10" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.8"/>
<text x="742" y="229.07" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">召回</text>
<text x="742" y="248.34" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">只为新的用户消息</text>
<text x="742" y="267.19" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">最多等 2 秒</text>
<circle cx="644" cy="202" r="13" fill="#7F3BF5"/>
<text x="644" y="207.5" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">3</text>
<rect x="868" y="200" width="200" height="84" rx="10" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.8"/>
<text x="968" y="238.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">转发</text>
<text x="968" y="257.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">同一种 API,不做转换</text>
<circle cx="870" cy="202" r="13" fill="#7F3BF5"/>
<text x="870" y="207.5" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">4</text>
<rect x="1250" y="200" width="196" height="84" rx="10" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.8"/>
<text x="1348" y="238.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">放进保存队列</text>
<text x="1348" y="257.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">晚一轮再保存</text>
<circle cx="1252" cy="202" r="13" fill="#7F3BF5"/>
<text x="1252" y="207.5" font-size="15" font-weight="700" fill="#FFFFFF" text-anchor="middle">5</text>
<rect x="642" y="318" width="200" height="74" rx="10" fill="#FFFFFF" stroke="#6425D0" stroke-width="1.8"/>
<text x="742" y="351.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">搜索 OpenViking</text>
<text x="742" y="370.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">用该用户自己的密钥</text>
<rect x="1250" y="318" width="196" height="74" rx="10" fill="#FFFFFF" stroke="#6425D0" stroke-width="1.8"/>
<text x="1348" y="351.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">下一条消息到达后保存</text>
<text x="1348" y="370.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">提交后提取记忆</text>
<rect x="868" y="430" width="200" height="70" rx="10" fill="#FFFFFF" stroke="#FF8800" stroke-width="1.8"/>
<text x="968" y="461.495" font-size="16" font-weight="700" fill="#1F2329" text-anchor="middle">模型生成回复</text>
<text x="968" y="480.765" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="middle">流式返回</text>
<polyline points="290,164 290,189" fill="none" stroke="#3370FF" stroke-width="2" stroke-linejoin="round"/>
<polygon points="290,198 284.5,188.0 295.5,188.0" fill="#3370FF"/>
<polyline points="390,242 406,242" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round"/>
<polygon points="415,242 405.0,247.5 405.0,236.5" fill="#7F3BF5"/>
<polyline points="616,242 632,242" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round"/>
<polygon points="641,242 631.0,247.5 631.0,236.5" fill="#7F3BF5"/>
<polyline points="842,242 858,242" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round"/>
<polygon points="867,242 857.0,247.5 857.0,236.5" fill="#7F3BF5"/>
<polyline points="692,284 692,308" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round"/>
<polygon points="692,317 686.5,307.0 697.5,307.0" fill="#7F3BF5"/>
<polyline points="792,318 792,294" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round"/>
<polygon points="792,285 797.5,295.0 786.5,295.0" fill="#7F3BF5"/>
<text x="850" y="340" font-size="14" font-weight="400" fill="#7F3BF5" text-anchor="start">每条最多 1,600 token</text>
<text x="850" y="359" font-size="14" font-weight="400" fill="#7F3BF5" text-anchor="start">附加在消息末尾</text>
<polyline points="1028,284 1028,420" fill="none" stroke="#8F959E" stroke-width="2" stroke-linejoin="round"/>
<polygon points="1028,429 1022.5,419.0 1033.5,419.0" fill="#8F959E"/>
<polyline points="1068,465 1098,465 1098,128 1114,128" fill="none" stroke="#8F959E" stroke-width="2" stroke-linejoin="round"/>
<polygon points="1123,128 1113.0,133.5 1113.0,122.5" fill="#8F959E"/>
<text x="1108" y="330" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">回复逐块</text>
<text x="1108" y="349" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">流回客户端</text>
<circle cx="1098" cy="242" r="3.5" fill="#8F959E"/>
<polyline points="1098,242 1240,242" fill="none" stroke="#8F959E" stroke-width="1.5" stroke-linejoin="round" stroke-dasharray="3 4"/>
<polygon points="1249,242 1239.0,247.5 1239.0,236.5" fill="#8F959E"/>
<polyline points="1350,284 1350,308" fill="none" stroke="#7F3BF5" stroke-width="2" stroke-linejoin="round" stroke-dasharray="6 4"/>
<polygon points="1350,317 1344.5,307.0 1355.5,307.0" fill="#7F3BF5"/>
<text x="40" y="546" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="start">OpenViking 超时或不可用时,这条消息不带记忆照常发出,之后也不补。工具步骤跳过 ③;子 Agent、生成标题等辅助请求跳过 ③ 和 ⑤。</text>
<text x="40" y="606" font-size="20" font-weight="700" fill="#1F2329" text-anchor="start">为什么要原样放回:服务商按前缀缓存提示词</text>
<text x="40" y="678" font-size="16" font-weight="700" fill="#2EA121" text-anchor="start">放回</text>
<rect x="192" y="650" width="116" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="250" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">系统提示词</text>
<rect x="312" y="650" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="355" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">消息 1</text>
<rect x="402" y="650" width="86" height="44" rx="4" fill="#EDE6FF" stroke="#2EA121" stroke-width="1.5"/>
<text x="445" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">记忆 A</text>
<rect x="492" y="650" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="535" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">回复 1</text>
<rect x="582" y="650" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="625" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">消息 2</text>
<rect x="672" y="650" width="86" height="44" rx="4" fill="#EDE6FF" stroke="#2EA121" stroke-width="1.5"/>
<text x="715" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">记忆 B</text>
<rect x="762" y="650" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="805" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">回复 2</text>
<rect x="852" y="650" width="106" height="44" rx="4" fill="#FFFFFF" stroke="#8F959E" stroke-width="1.5"/>
<text x="905" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">新消息 3</text>
<rect x="962" y="650" width="96" height="44" rx="4" fill="#FFFFFF" stroke="#8F959E" stroke-width="1.5"/>
<text x="1010" y="677" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">本轮召回</text>
<line x1="192" y1="640" x2="848" y2="640" stroke="#2EA121" stroke-width="1.5"/>
<line x1="192" y1="640" x2="192" y2="646" stroke="#2EA121" stroke-width="1.5"/>
<line x1="848" y1="640" x2="848" y2="646" stroke="#2EA121" stroke-width="1.5"/>
<text x="520" y="633" font-size="14" font-weight="700" fill="#2EA121" text-anchor="middle">命中缓存,按缓存价计费</text>
<line x1="852" y1="640" x2="1058" y2="640" stroke="#8F959E" stroke-width="1.5"/>
<line x1="852" y1="640" x2="852" y2="646" stroke="#8F959E" stroke-width="1.5"/>
<line x1="1058" y1="640" x2="1058" y2="646" stroke="#8F959E" stroke-width="1.5"/>
<text x="955" y="633" font-size="14" font-weight="700" fill="#8F959E" text-anchor="middle">新内容</text>
<text x="40" y="766" font-size="16" font-weight="700" fill="#F54A45" text-anchor="start">不放回</text>
<rect x="192" y="738" width="116" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="250" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">系统提示词</text>
<rect x="312" y="738" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="355" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">消息 1</text>
<rect x="402" y="738" width="86" height="44" rx="4" fill="#FFFFFF" stroke="#8F959E" stroke-width="1.5" stroke-dasharray="5 4"/>
<text x="445" y="765" font-size="14" font-weight="400" fill="#8F959E" text-anchor="middle">无</text>
<rect x="492" y="738" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="535" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">回复 1</text>
<rect x="582" y="738" width="86" height="44" rx="4" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="625" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">消息 2</text>
<rect x="672" y="738" width="86" height="44" rx="4" fill="#FFFFFF" stroke="#F54A45" stroke-width="1.5" stroke-dasharray="5 4"/>
<text x="715" y="765" font-size="14" font-weight="400" fill="#F54A45" text-anchor="middle">缺失</text>
<rect x="762" y="738" width="86" height="44" rx="4" fill="#FDECEC" stroke="#F54A45" stroke-width="1.5"/>
<text x="805" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">回复 2</text>
<rect x="852" y="738" width="106" height="44" rx="4" fill="#FDECEC" stroke="#F54A45" stroke-width="1.5"/>
<text x="905" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">新消息 3</text>
<rect x="962" y="738" width="96" height="44" rx="4" fill="#FDECEC" stroke="#F54A45" stroke-width="1.5"/>
<text x="1010" y="765" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">本轮召回</text>
<line x1="192" y1="728" x2="668" y2="728" stroke="#2EA121" stroke-width="1.5"/>
<line x1="192" y1="728" x2="192" y2="734" stroke="#2EA121" stroke-width="1.5"/>
<line x1="668" y1="728" x2="668" y2="734" stroke="#2EA121" stroke-width="1.5"/>
<text x="430" y="721" font-size="14" font-weight="700" fill="#2EA121" text-anchor="middle">和上一轮相同,命中</text>
<line x1="672" y1="728" x2="1058" y2="728" stroke="#F54A45" stroke-width="1.5"/>
<line x1="672" y1="728" x2="672" y2="734" stroke="#F54A45" stroke-width="1.5"/>
<line x1="1058" y1="728" x2="1058" y2="734" stroke="#F54A45" stroke-width="1.5"/>
<text x="865" y="721" font-size="14" font-weight="700" fill="#F54A45" text-anchor="middle">从上一轮补充记忆的位置起按原价重算</text>
<rect x="1100" y="652" width="26" height="18" rx="3" fill="#EDE6FF" stroke="#2EA121" stroke-width="1.5"/>
<text x="1136" y="667" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">网关补充的记忆</text>
<rect x="1100" y="682" width="26" height="18" rx="3" fill="#E3F5E1" stroke="#2EA121" stroke-width="1.5"/>
<text x="1136" y="697" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">命中缓存,按缓存价</text>
<rect x="1100" y="712" width="26" height="18" rx="3" fill="#FDECEC" stroke="#F54A45" stroke-width="1.5"/>
<text x="1136" y="727" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">未命中,按原价重算</text>
<rect x="1100" y="742" width="26" height="18" rx="3" fill="#FFFFFF" stroke="#8F959E" stroke-width="1.5"/>
<text x="1136" y="757" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">本轮新内容</text>
<text x="40" y="812" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="start">客户端的历史里没有网关补充的内容,网关自己记下,并在每个请求里放回原位。</text>
<text x="40" y="832" font-size="14.5" font-weight="400" fill="#646A73" text-anchor="start">不放回时,每轮都从上一轮补充记忆的位置起重算,具体还取决于服务商的缓存断点。</text>
<rect x="40" y="856" width="760" height="180" rx="12" fill="#F7F3FF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="62" y="888" font-size="17" font-weight="700" fill="#1F2329" text-anchor="start">跨轮:保存对话,提取记忆</text>
<rect x="62" y="904" width="159.5" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="141.75" y="944.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">下一条消息到达</text>
<polyline points="224.5,940 236.5,940" fill="none" stroke="#7F3BF5" stroke-width="1.8" stroke-linejoin="round"/>
<polygon points="245.5,940 235.5,945.5 235.5,934.5" fill="#7F3BF5"/>
<rect x="247.5" y="904" width="159.5" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="327.25" y="935" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">上一轮保存到</text>
<text x="327.25" y="954" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">OpenViking 会话</text>
<polyline points="410,940 422,940" fill="none" stroke="#7F3BF5" stroke-width="1.8" stroke-linejoin="round"/>
<polygon points="431,940 421.0,945.5 421.0,934.5" fill="#7F3BF5"/>
<rect x="433" y="904" width="159.5" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="512.75" y="925.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">待提交内容满</text>
<text x="512.75" y="944.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">20,000 token,</text>
<text x="512.75" y="963.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">或停顿 10 分钟</text>
<polyline points="595.5,940 607.5,940" fill="none" stroke="#7F3BF5" stroke-width="1.8" stroke-linejoin="round"/>
<polygon points="616.5,940 606.5,945.5 606.5,934.5" fill="#7F3BF5"/>
<rect x="618.5" y="904" width="159.5" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="698.25" y="925.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">提交会话,</text>
<text x="698.25" y="944.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">OpenViking</text>
<text x="698.25" y="963.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">提取记忆</text>
<text x="62" y="1000" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">重新生成或被放弃的回答不会保存;最后一轮在停顿 10 分钟后保存。</text>
<rect x="830" y="856" width="630" height="180" rx="12" fill="#F7F3FF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="852" y="888" font-size="17" font-weight="700" fill="#1F2329" text-anchor="start">跨轮:压缩长对话</text>
<rect x="852" y="904" width="178" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="941" y="935" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">用到上下文窗口的 90%</text>
<text x="941" y="954" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">(默认)</text>
<polyline points="1033,940 1045,940" fill="none" stroke="#7F3BF5" stroke-width="1.8" stroke-linejoin="round"/>
<polygon points="1054,940 1044.0,945.5 1044.0,934.5" fill="#7F3BF5"/>
<rect x="1056" y="904" width="178" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="1145" y="935" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">同一个模型写摘要</text>
<text x="1145" y="954" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">(最多 8,000 token)</text>
<polyline points="1237,940 1249,940" fill="none" stroke="#7F3BF5" stroke-width="1.8" stroke-linejoin="round"/>
<polygon points="1258,940 1248.0,945.5 1248.0,934.5" fill="#7F3BF5"/>
<rect x="1260" y="904" width="178" height="72" rx="8" fill="#FFFFFF" stroke="#7F3BF5" stroke-width="1.5"/>
<text x="1349" y="925.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">之后发送:</text>
<text x="1349" y="944.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">系统提示词、摘要</text>
<text x="1349" y="963.5" font-size="14" font-weight="400" fill="#1F2329" text-anchor="middle">和压缩位置之后的内容</text>
<text x="852" y="1000" font-size="14" font-weight="400" fill="#646A73" text-anchor="start">压缩位置之前的原文不再发送,客户端里的历史保持不变;压缩时多一次模型请求。</text>
</svg>