docs(update):更新Porject Caffeine系统整体架构示意图,根据MCP三大原语体系修改

Signed-off-by: gzkoala <guohao@gitconomy.org>
This commit is contained in:
gzkoala
2026-03-08 16:28:03 +08:00
parent 99e7a2f772
commit 98413b372c
2 changed files with 525 additions and 53 deletions

View File

@@ -0,0 +1,480 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1320 1200" width="100%" height="100%">
<!--
================================================================================
图表名称Arabica Sprint 3 架构图 (Arabica Sprint 3 Architecture)
文件命名arabica-sprint3-architecture-design.svg
用途:聚焦外围学术检索与双轨制数据落盘模块的实现。
版本v1.0.0 (Arabica) - Sprint 3
作者Gitconomy Research-郭晧
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
创建日期2026-03-08
================================================================================
-->
<!-- 头部注释:图表背景声明 -->
<!-- Background: Solid White -->
<rect width="100%" height="100%" fill="#FFFFFF" />
<defs>
<style>
:root {
/* 语义色定义 */
--c-cloud-blue: #0099FF;
--c-cloud-blue-light: rgba(0, 153, 255, 0.08);
--c-local-green: #009900;
--c-local-green-light: rgba(0, 153, 0, 0.08);
--c-risk-amber: #F97316;
--c-risk-amber-light: rgba(249, 115, 22, 0.08);
--c-gov-blue: #3B82F6;
--c-gov-blue-light: rgba(59, 130, 246, 0.08);
--c-neutral-gray: #475569;
--c-neutral-gray-light: #B2B2B2;
/* 步骤高亮色 */
--c-step-red: #EF4444;
}
/* 字体降级机制 */
.font-sans { font-family: 'Noto Sans', 'Helvetica Neue', Arial, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; }
/* 文本层级 */
.card-title { font-size: 14px; font-weight: bold; fill: #FFFFFF; }
.card-text { font-size: 12px; fill: var(--c-neutral-gray); }
.text-code { font-size: 13px; font-weight: bold; fill: #0F172A; }
.label-text { font-size: 12px; font-weight: bold; fill: var(--c-neutral-gray); }
.step-text { font-size: 13px; font-weight: bold; fill: #FFFFFF; }
</style>
<!-- 箭头标记 -->
<marker id="arrow-gray" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-neutral-gray)" />
</marker>
<marker id="arrow-green" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-local-green)" />
</marker>
<marker id="arrow-blue" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto">
<path d="M 0 0 L 8 4 L 0 8 Z" fill="var(--c-cloud-blue)" />
</marker>
</defs>
<!--
===========================================================================
顶层标题块 (Title Block)
===========================================================================
-->
<g id="title-block" transform="translate(660, 40)">
<text y="0" text-anchor="middle" class="font-mono" font-size="12" fill="var(--c-neutral-gray)" letter-spacing="1">FIG-02</text>
<text y="30" text-anchor="middle" class="font-sans" font-weight="bold" font-size="24" fill="#000000">Arabica Sprint 3 系统开发组件架构图</text>
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 &gt; Arabica Sprint 3 &gt; 文献检索与标准化落盘工作流</text>
<!-- Context Indicator: Y=70 -->
<rect x="-30" y="70" width="60" height="3" fill="var(--c-cloud-blue)" />
</g>
<!--
===========================================================================
架构图主体内容 (Diagram Content)
整体下移80单位保证距离标题拥有 50 单位以上的空间
===========================================================================
-->
<g id="diagram-content" transform="translate(0, 80)">
<!--
===========================================================================
物理边界与容器 (Boundaries)
===========================================================================
-->
<g id="boundaries" transform="translate(0, 240)">
<!-- Node.js MCP Server Runtime Boundary -->
<rect x="270" y="0" width="690" height="620" rx="12" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-dasharray="4 4" stroke-width="2" />
<rect x="270" y="0" width="690" height="36" fill="var(--c-local-green)" opacity="0.1" rx="12"/>
<text x="290" y="23" class="font-mono" font-size="14" font-weight="bold" fill="var(--c-local-green)">📦 MCP Server RuntimeSprint 3)</text>
</g>
<!-- Public Internet Boundary (Cloud) - 距MCP服务器恰好保持30单位间距 -->
<g id="cloud-boundary" transform="translate(990, 80)">
<rect x="0" y="0" width="320" height="280" rx="12" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" stroke-dasharray="4 4" stroke-width="2" />
<rect x="0" y="0" width="320" height="36" fill="var(--c-cloud-blue)" opacity="0.1" rx="12"/>
<text x="20" y="23" class="font-mono" font-size="14" font-weight="bold" fill="var(--c-cloud-blue)">☁️ Cloud</text>
</g>
<!--
===========================================================================
核心连线与数据流向 (Connections)
===========================================================================
-->
<g id="connections" fill="none" stroke-width="2">
<!-- User <-> Cherry Studio -->
<path d="M 380 110 L 462 110" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 470 140 L 388 140" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- Cherry Studio <-> Remote LLM -->
<path d="M 740 130 L 1112 130" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<path d="M 1120 150 L 748 150" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<!-- Cherry Studio <-> app.ts (stdio) -->
<path d="M 600 170 L 600 272" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<path d="M 620 280 L 620 178" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<!-- app.ts -> Controllers -->
<path d="M 580 350 L 580 370 L 365 370 L 365 395" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 610 350 L 610 395" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<path d="M 640 350 L 640 370 L 820 370 L 820 395" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- toolsController -> Services -->
<!-- to literatureService -->
<path d="M 550 470 L 550 505" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<!-- to storageService -->
<path d="M 660 470 L 660 615" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
<!-- resourcesController -> resourceService -->
<path d="M 820 470 L 820 505" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- literatureService <-> Academic APIs (Cloud) -->
<path d="M 720 550 L 1150 550 L 1150 335" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<path d="M 1130 330 L 1130 570 L 728 570" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
<!-- storageService -> yamlHelper -->
<path d="M 700 650 L 745 650" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- storageService -> Local Vault (垂直向下落盘至正下方) -->
<path d="M 580 690 L 580 850 L 600 850 L 600 885" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- resourceService -> Local Vault (绕开卡片落盘) -->
<path d="M 820 580 L 820 600 L 940 600 L 940 850 L 630 850 L 630 885" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
<!-- API Clients & Schemas dotted dependencies -->
<path d="M 550 580 L 550 725" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
<path d="M 660 690 L 660 725" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
</g>
<!--
===========================================================================
路径标签说明 (Path Labels)
===========================================================================
-->
<g id="path-labels" class="font-sans label-text">
<text x="425" y="95" text-anchor="middle">Query</text>
<text x="425" y="160" text-anchor="middle">Report</text>
<text x="920" y="120" text-anchor="middle" fill="var(--c-cloud-blue)">Reasoning / Tool Calls</text>
<text x="920" y="165" text-anchor="middle" fill="var(--c-cloud-blue)">LLM Result</text>
<!-- stdio Link -->
<text x="590" y="220" text-anchor="end" fill="var(--c-local-green)">tools/call</text>
<text x="630" y="220" text-anchor="start" fill="var(--c-local-green)">Result JSON</text>
<rect x="580" y="230" width="60" height="20" rx="4" fill="#FFFFFF" stroke="var(--c-local-green)" />
<text x="610" y="245" text-anchor="middle" class="font-mono" font-size="11" fill="var(--c-local-green)">stdio</text>
<!-- Network / Vault Labels -->
<text x="1050" y="540" text-anchor="middle" fill="var(--c-cloud-blue)">HTTP GET (Search)</text>
<text x="1050" y="585" text-anchor="middle" fill="var(--c-cloud-blue)">Metadata JSON</text>
<text x="590" y="810" text-anchor="start" class="font-mono" font-size="11" fill="var(--c-neutral-gray)">fs.writeFileSync()</text>
</g>
<!--
===========================================================================
架构节点卡片 (Node Cards)
===========================================================================
-->
<g id="nodes">
<!-- 1. User Node -->
<g transform="translate(260, 95)">
<rect x="0" y="0" width="110" height="60" rx="8" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="2" />
<circle cx="55" cy="22" r="10" fill="var(--c-neutral-gray)" />
<path d="M 35 50 C 35 35, 75 35, 75 50" fill="none" stroke="var(--c-neutral-gray)" stroke-width="3" stroke-linecap="round"/>
<text x="55" y="75" text-anchor="middle" class="font-sans label-text">User / 用户</text>
</g>
<!-- 2. Cherry Studio -->
<g transform="translate(480, 80)">
<rect x="0" y="0" width="250" height="90" rx="8" fill="var(--c-gov-blue-light)" stroke="var(--c-gov-blue)" stroke-width="2" />
<rect x="0" y="0" width="250" height="30" fill="var(--c-gov-blue)" rx="8" />
<rect x="0" y="20" width="250" height="10" fill="var(--c-gov-blue)" />
<text x="125" y="20" text-anchor="middle" class="font-sans card-title">Cherry Studio (MCP Client)</text>
<text x="125" y="55" text-anchor="middle" class="font-sans card-text" font-weight="bold">大模型对话与调度宿主</text>
<text x="125" y="75" text-anchor="middle" class="font-mono card-text" font-size="11">Initiates stdio subprocess</text>
</g>
<!-- 3. Remote LLM Brain -->
<g transform="translate(1140, 145)">
<polygon points="0,-40 40,-20 40,20 0,40 -40,20 -40,-20" fill="#FFFFFF" stroke="var(--c-cloud-blue)" stroke-width="3" />
<text x="0" y="-5" text-anchor="middle" class="font-mono card-text" fill="var(--c-cloud-blue)" font-size="14" font-weight="bold">LLM</text>
<text x="0" y="15" text-anchor="middle" class="font-mono card-text" font-size="10" fill="var(--c-cloud-blue)">(Remote)</text>
</g>
<!-- 4. Academic APIs -->
<g transform="translate(1020, 260)">
<rect x="0" y="0" width="240" height="65" rx="8" fill="#FFFFFF" stroke="var(--c-cloud-blue)" stroke-width="3" />
<rect x="0" y="0" width="240" height="26" fill="var(--c-cloud-blue)" rx="8" />
<rect x="0" y="20" width="240" height="6" fill="var(--c-cloud-blue)" />
<text x="120" y="18" text-anchor="middle" class="font-sans card-title">Academic APIs</text>
<text x="120" y="42" text-anchor="middle" class="font-mono text-code" fill="var(--c-cloud-blue)" font-size="12">arXiv API</text>
<text x="120" y="56" text-anchor="middle" class="font-mono text-code" fill="var(--c-cloud-blue)" font-size="12">Semantic Scholar API</text>
</g>
<!-- 5. app.ts -->
<g transform="translate(530, 280)">
<rect x="0" y="0" width="160" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="160" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="160" height="6" fill="var(--c-local-green)" />
<text x="80" y="18" text-anchor="middle" class="font-mono card-title">app.ts</text>
<text x="80" y="45" text-anchor="middle" class="font-sans text-code" font-size="12">McpServer 注册原语</text>
<text x="80" y="62" text-anchor="middle" class="font-mono card-text" font-size="10">Stdio Transport</text>
</g>
<!-- 6. Controllers -->
<!-- promptsController -->
<g transform="translate(290, 400)">
<rect x="0" y="0" width="150" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2"/>
<rect x="0" y="0" width="150" height="26" fill="var(--c-risk-amber)" rx="6"/>
<rect x="0" y="20" width="150" height="6" fill="var(--c-risk-amber)" />
<text x="75" y="18" text-anchor="middle" class="font-mono card-title">promptsController</text>
<text x="75" y="45" text-anchor="middle" class="font-sans card-text">处理 prompts/get</text>
</g>
<!-- toolsController (Sprint 3 Focus) -->
<g transform="translate(460, 400)">
<rect x="0" y="0" width="240" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
<rect x="0" y="0" width="240" height="26" fill="var(--c-risk-amber)" rx="6" />
<rect x="0" y="20" width="240" height="6" fill="var(--c-risk-amber)" />
<text x="120" y="18" text-anchor="middle" class="font-mono card-title">toolsController</text>
<text x="120" y="44" text-anchor="middle" class="font-sans card-text" font-size="11">search_academic_literature</text>
<text x="120" y="60" text-anchor="middle" class="font-sans card-text" font-size="11">save_literature_to_vault</text>
</g>
<!-- resourcesController -->
<g transform="translate(720, 400)">
<rect x="0" y="0" width="200" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
<rect x="0" y="0" width="200" height="26" fill="var(--c-risk-amber)" rx="6" />
<rect x="0" y="20" width="200" height="6" fill="var(--c-risk-amber)" />
<text x="100" y="18" text-anchor="middle" class="font-mono card-title">resourcesController</text>
<text x="100" y="44" text-anchor="middle" class="font-sans card-text">处理 resources/read 分发</text>
<text x="100" y="60" text-anchor="middle" class="font-sans card-text">含 literature:// 协议支持</text>
</g>
<!-- 7. Services Row 1 -->
<!-- promptService & intentService (S2 Stacked) -->
<g transform="translate(290, 510)">
<rect x="0" y="0" width="150" height="160" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" opacity="0.6"/>
<rect x="0" y="0" width="150" height="26" fill="var(--c-local-green)" rx="6" opacity="0.6"/>
<text x="75" y="18" text-anchor="middle" class="font-mono card-title">S2 Strategy Services</text>
<rect x="10" y="40" width="130" height="45" rx="4" fill="var(--c-local-green-light)" />
<text x="75" y="58" text-anchor="middle" class="font-mono text-code" font-size="11">promptService</text>
<text x="75" y="75" text-anchor="middle" class="font-sans card-text" font-size="10">多维思维框架管理</text>
<rect x="10" y="95" width="130" height="45" rx="4" fill="var(--c-local-green-light)" />
<text x="75" y="113" text-anchor="middle" class="font-mono text-code" font-size="11">intentService</text>
<text x="75" y="130" text-anchor="middle" class="font-sans card-text" font-size="10">意图拆解生成检索词</text>
</g>
<!-- literatureService -->
<g transform="translate(460, 510)">
<rect x="0" y="0" width="240" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="240" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="240" height="6" fill="var(--c-local-green)" />
<text x="120" y="18" text-anchor="middle" class="font-mono card-title">literatureService.ts (New)</text>
<text x="120" y="45" text-anchor="middle" class="font-sans text处理 prompts/ge-code" font-size="12" fill="var(--c-local-green)">并发调用学术API及去重</text>
<text x="120" y="62" text-anchor="middle" class="font-sans card-text" font-size="11">向大模型返回标准化 JSON 数组</text>
</g>
<!-- resourceService -->
<g transform="translate(720, 510)">
<rect x="0" y="0" width="200" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="200" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="200" height="6" fill="var(--c-local-green)" />
<text x="100" y="18" text-anchor="middle" class="font-mono card-title">resourceService.ts</text>
<text x="100" y="45" text-anchor="middle" class="font-sans text-code" font-size="12">文件系统读取交互</text>
<text x="100" y="62" text-anchor="middle" class="font-sans card-text" font-size="11">读取 Vault 中的文献卡片</text>
</g>
<!-- 8. Services Row 2 -->
<!-- storageService -->
<g transform="translate(460, 620)">
<rect x="0" y="0" width="240" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
<rect x="0" y="0" width="240" height="26" fill="var(--c-local-green)" rx="6" />
<rect x="0" y="20" width="240" height="6" fill="var(--c-local-green)" />
<text x="120" y="18" text-anchor="middle" class="font-mono card-title">storageService.ts (New)</text>
<text x="120" y="45" text-anchor="middle" class="font-sans text-code" font-size="12" fill="var(--c-local-green)">JSON 转 Markdown+YAML</text>
<text x="120" y="62" text-anchor="middle" class="font-sans card-text" font-size="11">路径安全校验与双轨数据落盘</text>
</g>
<!-- yamlHelper.js -->
<g transform="translate(750, 625)">
<rect x="0" y="0" width="170" height="50" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" />
<text x="85" y="20" text-anchor="middle" class="font-mono text-code" font-size="12">utils/yamlHelper.js</text>
<text x="85" y="40" text-anchor="middle" class="font-sans card-text" font-size="11">生成 Frontmatter 文本</text>
</g>
<!-- 9. Utils & Models -->
<g transform="translate(460, 730)">
<rect x="0" y="0" width="115" height="55" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" />
<text x="57" y="22" text-anchor="middle" class="font-mono text-code" font-size="11">apiClients.js</text>
<text x="57" y="42" text-anchor="middle" class="font-sans card-text" font-size="11">Axios / 重试</text>
</g>
<g transform="translate(585, 730)">
<rect x="0" y="0" width="115" height="55" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" />
<text x="57" y="18" text-anchor="middle" class="font-mono text-code" font-size="11">schemas.js</text>
<text x="57" y="34" text-anchor="middle" class="font-mono card-text" font-size="10">literatureSchema</text>
<text x="57" y="48" text-anchor="middle" class="font-sans card-text" font-size="10">Zod强校验标准</text>
</g>
<!-- 10. External Resources (Local Vault 位于MCP中心正下方) -->
<g transform="translate(565, 890)">
<path d="M 0 15 A 50 15 0 1 0 100 15 V 60 A 50 15 0 1 1 0 60 Z" fill="var(--c-local-green-light)" stroke="var(--c-neutral-gray)" stroke-width="2" stroke-dasharray="2 2" />
<ellipse cx="50" cy="15" rx="50" ry="15" fill="var(--c-local-green-light)" stroke="var(--c-neutral-gray)" stroke-width="2" stroke-dasharray="2 2" />
<text x="50" y="48" text-anchor="middle" class="font-sans card-text" fill="var(--c-neutral-gray)" font-size="13" font-weight="bold">Local Vault</text>
<text x="50" y="65" text-anchor="middle" class="font-mono card-text" fill="var(--c-neutral-gray)" font-size="10">.md 卡片落盘</text>
</g>
</g>
<!--
===========================================================================
步骤侧边栏与流程图注 (Execution Steps)
===========================================================================
-->
<g id="execution-steps">
<!-- 图内红圈标记 -->
<g transform="translate(420, 110)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">1</text>
</g>
<g transform="translate(820, 130)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">2</text>
</g>
<g transform="translate(610, 365)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">3</text>
</g>
<g transform="translate(970, 550)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">4</text>
</g>
<g transform="translate(1150, 420)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">5</text>
</g>
<g transform="translate(660, 490)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">6</text>
</g>
<g transform="translate(715, 650)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">7</text>
</g>
<g transform="translate(580, 820)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">8</text>
</g>
<g transform="translate(420, 140)">
<circle cx="0" cy="0" r="10" fill="var(--c-step-red)" />
<text x="0" y="4.5" text-anchor="middle" class="font-sans step-text">9</text>
</g>
<!-- 步骤流程侧边栏 -->
<g transform="translate(10, 320)">
<rect x="0" y="0" width="250" height="250" rx="8" fill="#FEF2F2" stroke="var(--c-step-red)" stroke-width="1.5" />
<text x="125" y="25" text-anchor="middle" class="font-sans" font-size="14" font-weight="bold" fill="var(--c-step-red)">Sprint 3 文献检索落盘工作流</text>
<line x1="15" y1="35" x2="235" y2="35" stroke="var(--c-step-red)" stroke-dasharray="2 2" />
<g transform="translate(15, 55)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">1</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">User: 输入研究主题进行查询</text>
</g>
<g transform="translate(15, 75)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">2</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">LLM: 判断并决定检索相关学术文献</text>
</g>
<g transform="translate(15, 95)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">3</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">Client: 调用 search_academic 工具</text>
</g>
<g transform="translate(15, 115)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">4</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">S1: 并发请求 arXiv / Sem. Scholar</text>
</g>
<g transform="translate(15, 135)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">5</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">API: 返回聚合的 JSON 文献元数据</text>
</g>
<g transform="translate(15, 155)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">6</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">LLM: 分析后调用 save_literature</text>
</g>
<g transform="translate(15, 175)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">7</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">S1: 将 JSON 转为 MD + YAML 前缀</text>
</g>
<g transform="translate(15, 195)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">8</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">S1: 安全写入指定的本地 Vault 目录</text>
</g>
<g transform="translate(15, 215)">
<circle cx="6" cy="-4" r="7" fill="var(--c-step-red)" />
<text x="6" y="0" text-anchor="middle" class="font-sans step-text" font-size="10">9</text>
<text x="20" y="0" class="font-sans card-text" fill="#000000">LLM: 生成带本地文献引用的最终报告</text>
</g>
</g>
</g>
</g>
<!--
===========================================================================
底部图例与注释块 (Legend & Key Block)
===========================================================================
-->
<g id="legend" transform="translate(660, 1090)">
<!-- 统一的半透明背景容器 -->
<rect x="-480" y="-16" width="960" height="40" rx="4" fill="rgba(255, 255, 255, 0.9)" stroke="var(--c-neutral-gray)" stroke-width="0.5"/>
<g transform="translate(-460, 0)">
<!-- 图例引导文本 -->
<text x="0" y="8" class="font-sans" font-size="13" font-weight="bold" fill="var(--c-neutral-gray)">组件与语义对照:</text>
<!-- 图例项 1 -->
<g transform="translate(130, 0)">
<rect x="-6" y="-4" width="12" height="12" rx="2" fill="var(--c-gov-blue)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">宿主客户端架构</text>
</g>
<!-- 图例项 2 -->
<g transform="translate(280, 0)">
<rect x="-6" y="-4" width="12" height="12" rx="2" fill="var(--c-risk-amber)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">路由分发控制器 (Controllers)</text>
</g>
<!-- 图例项 3 -->
<g transform="translate(520, 0)">
<rect x="-6" y="-4" width="12" height="12" rx="2" fill="var(--c-local-green)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">核心引擎与本地执行层 (Sprint 3核心)</text>
</g>
<!-- 图例项 4 -->
<g transform="translate(790, 0)">
<rect x="-6" y="-4" width="12" height="12" rx="2" fill="var(--c-cloud-blue)" />
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">远程云端 API 依赖</text>
</g>
</g>
</g>
<!--
===========================================================================
版权许可声明 (License)
===========================================================================
-->
<text x="660" y="1150" text-anchor="middle" class="font-sans" font-size="11" fill="var(--c-neutral-gray)">
本作品采用 CC-BY-SA 4.0 进行许可,© 2025-2026 Gitconomy Research社区
</text>
</svg>

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,15 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 850" width="100%" height="100%">
<!--
================================================================================
图表名称:基于 MCP 的学术研究系统拓扑图 (Research MCP Server Topology)
图表名称:基于 MCP 的学术研究系统拓扑图 (Research MCP System Topology)
文件命名figure01-mcp-system-topology.svg
用途:展示研报智能体 MCP 系统的核心组件交互拓扑包括用户层客户端、MCP 传输协议层、MCP Server 集群逻辑分工,以及与外部学术基础设施的数据流向。
版本v1.0.0
用途:展示研报智能体 MCP 系统的核心组件交互拓扑包括用户层客户端、MCP 传输协议层、单体 MCP Server 的 3 大原语分工,以及与外部学术基础设施的数据流向。
版本v2.0.0
作者Gitconomy Research-郭晧
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
创建日期2026-02-28
创建日期2026-03-01
更新日期2026-03-08
更新说明按照MCP的三大原语组件更新 Project Caffeine的系统架构图设计。
================================================================================
-->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 850" width="100%" height="100%">
<!-- Background: Solid White (强制兼容深色模式的白底) -->
<rect width="100%" height="100%" fill="#FFFFFF" />
@@ -77,7 +79,7 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<!-- 主标题 -->
<text y="0" text-anchor="middle" class="text-title" font-size="24" fill="#000000">Project Caffeine 研报智能体 MCP 系统拓扑图</text>
<!-- 面包屑导航 -->
<text y="25" text-anchor="middle" class="text-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 &gt; 智能体 MCP &gt; 系统拓扑</text>
<text y="25" text-anchor="middle" class="text-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 &gt; 智能体 MCP &gt; 核心原语拓扑</text>
<!-- 上下文指示线 (使用主色调代表架构主体) -->
<rect x="-30" y="40" width="60" height="3" fill="var(--c-local-green)" />
</g>
@@ -92,15 +94,15 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<!-- MCP Server 集群区域 (Center: Local/Container) -->
<rect x="420" y="0" width="340" height="520" rx="8" class="box-local" />
<text x="435" y="25" class="text-title" font-size="14" fill="var(--c-local-green)">MCP 服务端集群 (核心执行区)</text>
<text x="435" y="25" class="text-title" font-size="14" fill="var(--c-local-green)">单体 MCP Server (三大核心原语)</text>
<!-- 外部基础设施区域 (Right: Cloud) -->
<rect x="850" y="0" width="400" height="330" rx="8" class="box-cloud" />
<rect x="850" y="0" width="400" height="200" rx="8" class="box-cloud" />
<text x="865" y="25" class="text-title" font-size="14" fill="var(--c-cloud-blue)">外部学术基础设施 (公有云)</text>
<!-- 本地知识库区域 (Right Bottom: Local Storage) -->
<rect x="850" y="360" width="400" height="160" rx="8" class="box-local" />
<text x="865" y="385" class="text-title" font-size="14" fill="var(--c-local-green)">本地知识库</text>
<rect x="850" y="240" width="400" height="280" rx="8" class="box-local" />
<text x="865" y="265" class="text-title" font-size="14" fill="var(--c-local-green)">本地持久化存储</text>
</g>
<!-- ========================================================================= -->
@@ -121,7 +123,7 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<text x="365" y="325" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-neutral-gray)">JSON-RPC 2.0</text>
<!-- 协议层标签 -->
<text x="365" y="380" text-anchor="middle" class="text-title" font-size="12" fill="var(--c-neutral-gray)">MCP 标准传输协议层</text>
<text x="365" y="380" text-anchor="middle" class="text-title" font-size="12" fill="var(--c-neutral-gray)">MCP 传输协议层</text>
</g>
<!-- ========================================================================= -->
@@ -145,7 +147,7 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<text x="110" y="30" text-anchor="middle" class="text-title" font-size="16" fill="var(--c-local-green)">MCP 客户端</text>
<text x="110" y="50" text-anchor="middle" class="text-mono" font-size="12" fill="#000000">Claude Desktop / Cursor</text>
<rect x="20" y="70" width="180" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="1" />
<text x="110" y="89" text-anchor="middle" class="text-sans" font-size="12" fill="#000000">大模型上下文与工具调度</text>
<text x="110" y="89" text-anchor="middle" class="text-sans" font-size="12" fill="#000000">大模型上下文与协议调度</text>
</g>
<!-- 远程 LLM (Remote Brain) - 从 Client 发起调用 -->
@@ -161,33 +163,33 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<text x="180" y="380" class="text-sans" font-size="10" fill="var(--c-risk-amber)">提示词请求 / 结果流式响应</text>
<!-- [4.2] MCP Server 集群 -->
<!-- [4.2] 单体 MCP Server 的 3 大核心原语 -->
<!-- MCP Server 1: 文献查询 -->
<!-- MCP 原语 1: Tools -->
<g transform="translate(450, 70)">
<rect width="280" height="100" rx="6" class="node-local" />
<rect x="0" y="0" width="280" height="35" rx="6" fill="var(--c-local-green)" />
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">文献查询 MCP Server</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">工具: search_papers(), fetch_pdf()</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">负责多源学术数据库 API 聚合与清洗</text>
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">Tools 原语 (动作执行)</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">search_academic_literature(), save_to_vault()</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">调用外部API检索文献并执行标准化数据双轨落盘</text>
</g>
<!-- MCP Server 2: 提示词策略 -->
<!-- MCP 原语 2: Prompts -->
<g transform="translate(450, 210)">
<rect width="280" height="100" rx="6" class="node-local" />
<rect x="0" y="0" width="280" height="35" rx="6" fill="var(--c-local-green)" />
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">提示词策略 MCP Server</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">提示词: synthesis_template</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">负责基于主题动态组装超级提示词</text>
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">Prompts 原语 (上下文策略)</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">prompts/get: 5w3h, scqa, pestle 等</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">提供多维思维框架,动态指导大模型分析与拆解</text>
</g>
<!-- MCP Server 3: CoT 推理 -->
<!-- MCP 原语 3: Resources -->
<g transform="translate(450, 350)">
<rect width="280" height="100" rx="6" class="node-amber" />
<rect x="0" y="0" width="280" height="35" rx="6" fill="var(--c-risk-amber)" />
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">CoT 推理 MCP Server</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">工具: run_cot_chain(), verify_logic()</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">协调多步思考推理,抽取实体与洞察生成</text>
<rect width="280" height="100" rx="6" class="node-local" />
<rect x="0" y="0" width="280" height="35" rx="6" fill="var(--c-local-green)" />
<text x="140" y="22" text-anchor="middle" class="text-title" font-size="14" fill="#FFFFFF">Resources 原语 (数据暴露)</text>
<text x="140" y="55" text-anchor="middle" class="text-mono" font-size="11" fill="#000000">literature://local/, note://local/</text>
<text x="140" y="75" text-anchor="middle" class="text-sans" font-size="11" fill="var(--c-neutral-gray)">暴露本地知识库的文献卡片与笔记供大模型访问</text>
</g>
@@ -198,49 +200,39 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
<!-- Cylinder -->
<path d="M 0,20 A 40,15 0 0,0 80,20 A 40,15 0 0,0 0,20 L 0,80 A 40,15 0 0,0 80,80 L 80,20" class="node-cloud" />
<text x="40" y="50" text-anchor="middle" class="text-title" font-size="12" fill="#000000">学术数据库</text>
<text x="40" y="68" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-cloud-blue)">PubMed, arXiv</text>
<text x="40" y="82" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-cloud-blue)">IEEE, WOS</text>
<text x="40" y="68" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-cloud-blue)">arXiv API</text>
<text x="40" y="82" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-cloud-blue)">Semantic Scholar</text>
</g>
<!-- 互联网资源 -->
<g transform="translate(1080, 200)">
<!-- Hexagon-like Cloud Service -->
<polygon points="20,0 80,0 100,40 80,80 20,80 0,40" class="node-cloud" />
<text x="50" y="35" text-anchor="middle" class="text-title" font-size="12" fill="#000000">互联网资源</text>
<text x="50" y="55" text-anchor="middle" class="text-mono" font-size="10" fill="var(--c-cloud-blue)">PDF / HTML</text>
</g>
<!-- [4.4] 本地知识库 (Local Knowledge Base) -->
<g transform="translate(980, 410)">
<g transform="translate(930, 360)">
<!-- Cylinder -->
<path d="M 0,20 A 50,15 0 0,0 100,20 A 50,15 0 0,0 0,20 L 0,80 A 50,15 0 0,0 100,80 L 100,20" class="node-local" />
<text x="50" y="50" text-anchor="middle" class="text-title" font-size="12" fill="#000000">本地知识库</text>
<text x="50" y="70" text-anchor="middle" class="text-mono" font-size="11" fill="var(--c-local-green)">Obsidian / Logseq</text>
<text x="50" y="70" text-anchor="middle" class="text-mono" font-size="11" fill="var(--c-local-green)">Obsidian / PKM</text>
<text x="50" y="85" text-anchor="middle" class="text-mono" font-size="9" fill="var(--c-neutral-gray)">(YAML / Markdown)</text>
</g>
<!-- [4.5] 服务器到外部/本地基础设施的连线 -->
<!-- 文献查询 MCP -> 学术数据库 (Async) -->
<!-- Tools 原语 -> 学术数据库 (Async) -->
<path d="M 730,100 L 930,100" class="line-async" marker-end="url(#arrow-async)" />
<text x="830" y="90" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-risk-amber)">API 请求调用 (REST/GraphQL)</text>
<text x="810" y="90" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-risk-amber)">API 请求调用 (REST)</text>
<!-- CoT 推理 MCP -> 互联网资源 (Async) -->
<path d="M 730,400 L 1130,400 L 1130,285" class="line-async" marker-end="url(#arrow-async)" />
<text x="1000" y="390" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-risk-amber)">拉取文献全文 / 网页爬取</text>
<!-- Tools 原语 -> Local KB (Sync) 写入落盘 -->
<!-- 采用肘型连接线绕行 -->
<path d="M 730,140 L 880,140 L 880,380 L 930,380" class="line-sync" marker-end="url(#arrow-sync)" />
<text x="800" y="160" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-local-green)">JSON 转 Markdown+YAML</text>
<!-- 提示词策略 MCP -> Local KB (Sync) (如果是读取本地上下文) -->
<!-- 文献查询/CoT推理 MCP -> Local KB (Sync) (双轨制写入落盘) -->
<!-- 采用肘型连接线 -->
<path d="M 730,420 L 790,420 L 790,460 L 980,460" class="line-sync" marker-end="url(#arrow-sync)" />
<text x="885" y="452" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-local-green)">本地读写 Markdown / YAML</text>
<!-- Resources 原语 -> Local KB (Sync) 读取数据 -->
<path d="M 730,400 L 930,400" class="line-sync" marker-end="url(#arrow-sync)" />
<text x="830" y="390" text-anchor="middle" class="text-sans" font-size="10" fill="var(--c-local-green)">读取文献卡片与笔记</text>
<!-- MCP 内部的协同工作流虚线表示 (可选的逻辑联系) -->
<path d="M 590,170 L 590,210" class="line-neutral" marker-end="url(#arrow-async)" />
<path d="M 590,310 L 590,350" class="line-neutral" marker-end="url(#arrow-async)" />
<text x="600" y="195" class="text-sans" font-size="9" fill="var(--c-neutral-gray)">本地上下文共享</text>
<path d="M 590,170 L 590,210" class="line-neutral" />
<path d="M 590,310 L 590,350" class="line-neutral" />
<text x="600" y="195" class="text-sans" font-size="9" fill="var(--c-neutral-gray)">核心引擎共享调度</text>
</g>

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB