321 lines
20 KiB
XML
321 lines
20 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 1200" width="100%" height="100%">
|
||
<!--
|
||
================================================================================
|
||
图表名称:个人级研究助手智能体 - 开发框架与技术栈架构图
|
||
文件命名:project-caffeine-tech-stack-framework.svg
|
||
用途:展示从宿主端到三个核心 MCP Server 的底层技术栈、核心算法、Monorepo工程化及安全交互框架。
|
||
版本:v1.1.1 (Added Legend)
|
||
作者:Gitconomy Research-郭晧
|
||
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
|
||
创建日期:2026-02-27
|
||
================================================================================
|
||
-->
|
||
|
||
<!-- Background: Solid White for Git compatibility -->
|
||
<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: #FF991F;
|
||
--c-risk-amber-light: rgba(255, 153, 31, 0.08);
|
||
--c-gov-blue: #0052CC;
|
||
--c-gov-blue-light: rgba(0, 82, 204, 0.04);
|
||
--c-neutral-gray: #475569;
|
||
--c-neutral-gray-light: #E2E8F0;
|
||
}
|
||
|
||
/* 字体降级机制 */
|
||
.font-sans { font-family: 'Noto Sans', 'Helvetica Neue', Arial, sans-serif; }
|
||
.font-mono { font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace; }
|
||
|
||
/* 文本层级 */
|
||
.title-main { font-size: 16px; font-weight: bold; fill: var(--c-neutral-gray); }
|
||
.title-sub { font-size: 14px; font-weight: bold; fill: #0F172A; }
|
||
.tech-badge { font-size: 12px; font-weight: bold; }
|
||
.desc-text { font-size: 12px; fill: #64748B; }
|
||
</style>
|
||
|
||
<!-- 箭头标记 -->
|
||
<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>
|
||
<marker id="arrow-amber" 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-risk-amber)" />
|
||
</marker>
|
||
</defs>
|
||
|
||
<!--
|
||
===========================================================================
|
||
顶层标题块 (Title Block)
|
||
===========================================================================
|
||
-->
|
||
<g id="title-block" transform="translate(600, 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">Project Caffeine开发框架与技术栈架构图</text>
|
||
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 > MCP > 系统技术堆栈 </text>
|
||
<rect x="-30" y="70" width="60" height="3" fill="var(--c-gov-blue)" />
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
Layer 1: 宿主环境与模型层 (Host & LLM Layer)
|
||
===========================================================================
|
||
-->
|
||
<g id="layer-host" transform="translate(100, 140)">
|
||
<text x="0" y="0" class="font-sans title-main">Layer 1: 宿主应用与大脑层 (Host & Brain)</text>
|
||
<rect x="0" y="15" width="1000" height="90" rx="8" fill="var(--c-neutral-gray-light)" opacity="0.2" stroke="var(--c-neutral-gray)" stroke-dasharray="4 4" stroke-width="1.5" />
|
||
|
||
<!-- 客户端 -->
|
||
<rect x="30" y="30" width="220" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
|
||
<text x="140" y="55" text-anchor="middle" class="font-sans title-sub">MCP Client 宿主联调环境</text>
|
||
<text x="140" y="75" text-anchor="middle" class="font-mono desc-text">VS Code (MCP 插件) / Claude</text>
|
||
|
||
<!-- 双向箭头 -->
|
||
<line x1="260" y1="60" x2="330" y2="60" stroke="var(--c-neutral-gray)" stroke-width="2" stroke-dasharray="3 3"/>
|
||
|
||
<!-- 远程模型 (Brain) -->
|
||
<g transform="translate(400, 60)">
|
||
<!-- 六边形 Token -->
|
||
<polygon points="0,-30 26,-15 26,15 0,30 -26,15 -26,-15" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" stroke-width="2" />
|
||
<text x="40" y="-5" class="font-sans title-sub" fill="var(--c-cloud-blue)">Remote LLM Brain</text>
|
||
<text x="40" y="15" class="font-mono desc-text">Claude 3.5 / DeepSeek (Context Engine)</text>
|
||
</g>
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
Layer 2: 协议总线 (Protocol Bus)
|
||
===========================================================================
|
||
-->
|
||
<g id="layer-protocol" transform="translate(100, 270)">
|
||
<text x="0" y="0" class="font-sans title-main">Layer 2: 通信协议层 (JSON-RPC 2.0 Bus)</text>
|
||
<rect x="0" y="15" width="1000" height="40" rx="20" fill="var(--c-gov-blue-light)" stroke="var(--c-gov-blue)" stroke-width="2" />
|
||
<text x="500" y="40" text-anchor="middle" class="font-mono" font-size="14" font-weight="bold" fill="var(--c-gov-blue)">mcp-protocol: STDIO 协议 (MVP阶段:本地 stdin/stdout 零网络开销)</text>
|
||
|
||
<!-- 连接上下层的管线 -->
|
||
<line x1="210" y1="-35" x2="210" y2="15" stroke="var(--c-local-green)" stroke-width="3" marker-end="url(#arrow-green)" />
|
||
<line x1="210" y1="55" x2="210" y2="90" stroke="var(--c-local-green)" stroke-width="3" marker-end="url(#arrow-green)" />
|
||
|
||
<line x1="500" y1="55" x2="500" y2="90" stroke="var(--c-local-green)" stroke-width="3" marker-end="url(#arrow-green)" />
|
||
|
||
<line x1="850" y1="55" x2="850" y2="90" stroke="var(--c-local-green)" stroke-width="3" marker-end="url(#arrow-green)" />
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
Layer 3: 核心 MCP Server 集群框架 (Microservices Stack)
|
||
===========================================================================
|
||
-->
|
||
<g id="layer-servers" transform="translate(100, 370)">
|
||
<text x="0" y="0" class="font-sans title-main">Layer 3: 核心智能体引擎 / MCP Server 集群开发框架</text>
|
||
|
||
<!-- 工程化管控边界 (Monorepo) -->
|
||
<rect x="0" y="15" width="1000" height="360" rx="8" fill="transparent" stroke="var(--c-neutral-gray)" stroke-dasharray="4 4" stroke-width="2" />
|
||
<rect x="0" y="15" width="1000" height="30" fill="var(--c-neutral-gray-light)" opacity="0.4" rx="8"/>
|
||
<text x="20" y="35" class="font-mono desc-text" font-weight="bold" fill="var(--c-neutral-gray)">📦 npm Workspaces (Monorepo) - 统一包管理 / 依赖隔离 / 共享 JSON-RPC Schema</text>
|
||
|
||
<!-- ================= S1: 文献查询 Server ================= -->
|
||
<g transform="translate(20, 45)">
|
||
<rect x="0" y="0" width="300" height="320" rx="8" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-width="2" />
|
||
<rect x="0" y="0" width="300" height="40" fill="var(--c-local-green)" rx="8" />
|
||
<rect x="0" y="20" width="300" height="20" fill="var(--c-local-green)" />
|
||
<text x="150" y="25" text-anchor="middle" class="font-sans title-sub" fill="#FFFFFF">S1: 文献查询 Server (执行者)</text>
|
||
|
||
<!-- Tech Stack Badges (Unified TS/Node) -->
|
||
<text x="20" y="65" class="font-sans desc-text" font-weight="bold">开发环境与框架</text>
|
||
<rect x="20" y="75" width="115" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="77.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">Node.js (v20+)</text>
|
||
<rect x="145" y="75" width="95" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="192.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">@mcp/sdk-ts</text>
|
||
|
||
<!-- Core Algorithms -->
|
||
<text x="20" y="130" class="font-sans desc-text" font-weight="bold">核心组件与算法集成</text>
|
||
<rect x="20" y="140" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-dasharray="2 2" />
|
||
<text x="150" y="165" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-risk-amber)">Semantic Chunking 文本切块算法</text>
|
||
|
||
<rect x="20" y="190" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-dasharray="2 2" />
|
||
<text x="150" y="215" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-risk-amber)">Playwright / Firecrawl 网页深抓取</text>
|
||
|
||
<!-- APIs -->
|
||
<text x="20" y="260" class="font-sans desc-text" font-weight="bold">集成外部接口</text>
|
||
<rect x="20" y="270" width="125" height="24" rx="4" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" />
|
||
<text x="82.5" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-cloud-blue)">arXiv API</text>
|
||
<rect x="155" y="270" width="125" height="24" rx="4" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" />
|
||
<text x="217.5" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-cloud-blue)">S.Scholar API</text>
|
||
</g>
|
||
|
||
<!-- ================= S2: 提示词策略 Server ================= -->
|
||
<g transform="translate(350, 45)">
|
||
<rect x="0" y="0" width="300" height="320" rx="8" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-width="2" />
|
||
<rect x="0" y="0" width="300" height="40" fill="var(--c-local-green)" rx="8" />
|
||
<rect x="0" y="20" width="300" height="20" fill="var(--c-local-green)" />
|
||
<text x="150" y="25" text-anchor="middle" class="font-sans title-sub" fill="#FFFFFF">S2: 提示词策略 Server (军师)</text>
|
||
|
||
<!-- Tech Stack Badges (Unified TS/Node) -->
|
||
<text x="20" y="65" class="font-sans desc-text" font-weight="bold">开发环境与框架</text>
|
||
<rect x="20" y="75" width="115" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="77.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">Node.js (v20+)</text>
|
||
<rect x="145" y="75" width="95" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="192.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">@mcp/sdk-ts</text>
|
||
|
||
<!-- Core Algorithms -->
|
||
<text x="20" y="130" class="font-sans desc-text" font-weight="bold">核心智能体架构与引擎</text>
|
||
<rect x="20" y="140" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="150" y="165" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">Persona Matrix 角色化矩阵</text>
|
||
|
||
<rect x="20" y="190" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="150" y="215" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">Exploration State (防死循环账本)</text>
|
||
|
||
<!-- Prompts -->
|
||
<text x="20" y="260" class="font-sans desc-text" font-weight="bold">注入的静态思维框架 (Prompts)</text>
|
||
<rect x="20" y="270" width="80" height="24" rx="4" fill="#F1F5F9" stroke="var(--c-neutral-gray)" />
|
||
<text x="60" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-neutral-gray)">5W3H</text>
|
||
<rect x="110" y="270" width="80" height="24" rx="4" fill="#F1F5F9" stroke="var(--c-neutral-gray)" />
|
||
<text x="150" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-neutral-gray)">SCQA</text>
|
||
<rect x="200" y="270" width="80" height="24" rx="4" fill="#F1F5F9" stroke="var(--c-neutral-gray)" />
|
||
<text x="240" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-neutral-gray)">SWOT</text>
|
||
</g>
|
||
|
||
<!-- ================= S3: CoT 多步推理 Server ================= -->
|
||
<g transform="translate(680, 45)">
|
||
<rect x="0" y="0" width="300" height="320" rx="8" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-width="2" />
|
||
<rect x="0" y="0" width="300" height="40" fill="var(--c-local-green)" rx="8" />
|
||
<rect x="0" y="20" width="300" height="20" fill="var(--c-local-green)" />
|
||
<text x="150" y="25" text-anchor="middle" class="font-sans title-sub" fill="#FFFFFF">S3: CoT 推理 Server (分析师)</text>
|
||
|
||
<!-- Tech Stack Badges (Unified TS/Node) -->
|
||
<text x="20" y="65" class="font-sans desc-text" font-weight="bold">开发环境与框架</text>
|
||
<rect x="20" y="75" width="115" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="77.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">Node.js (v20+)</text>
|
||
<rect x="145" y="75" width="95" height="24" rx="12" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||
<text x="192.5" y="91" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-local-green)">@mcp/sdk-ts</text>
|
||
|
||
<!-- Core Algorithms -->
|
||
<text x="20" y="130" class="font-sans desc-text" font-weight="bold">质量把控与数据组装逻辑</text>
|
||
<rect x="20" y="140" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="150" y="165" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">引文密度强制校验 (Citation Check)</text>
|
||
|
||
<rect x="20" y="190" width="260" height="40" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="150" y="215" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">双轨制落盘编译器 (JSON-to-MD)</text>
|
||
|
||
<!-- Output Formats -->
|
||
<text x="20" y="260" class="font-sans desc-text" font-weight="bold">标准数据协议输出</text>
|
||
<rect x="20" y="270" width="120" height="24" rx="4" fill="#F1F5F9" stroke="var(--c-neutral-gray)" />
|
||
<text x="80" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-neutral-gray)">Markdown 解析</text>
|
||
<rect x="150" y="270" width="130" height="24" rx="4" fill="#F1F5F9" stroke="var(--c-neutral-gray)" />
|
||
<text x="215" y="286" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-neutral-gray)">YAML Frontmatter</text>
|
||
</g>
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
Layer 4: 物理存储与图谱层 (PKM Storage Layer)
|
||
===========================================================================
|
||
-->
|
||
<g id="layer-pkm" transform="translate(100, 790)">
|
||
<text x="0" y="0" class="font-sans title-main">Layer 4: 数据存储与个人图谱化 (PKM Data Persistence)</text>
|
||
|
||
<line x1="500" y1="-30" x2="500" y2="15" stroke="var(--c-local-green)" stroke-width="3" stroke-dasharray="4 4" marker-end="url(#arrow-green)" />
|
||
|
||
<rect x="0" y="30" width="1000" height="80" rx="8" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-width="2" />
|
||
|
||
<!-- Storage Cylinder Icon -->
|
||
<path d="M 40 55 A 25 10 0 1 0 90 55 V 85 A 25 10 0 1 1 40 85 Z" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2"/>
|
||
<ellipse cx="65" cy="55" rx="25" ry="10" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2"/>
|
||
|
||
<text x="120" y="65" class="font-sans title-sub">本地个人知识库 (Local Vault)</text>
|
||
<text x="120" y="85" class="font-mono desc-text">Obsidian / Logseq Graph System</text>
|
||
|
||
<!-- Data Spec Badges -->
|
||
<rect x="420" y="55" width="180" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="510" y="75" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">双向链接 [[文献名称]] 编排</text>
|
||
|
||
<rect x="620" y="55" width="160" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="700" y="75" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">自动化文献目录索引池</text>
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
Layer 5: 工程化与运维安全 (Engineering & Security)
|
||
===========================================================================
|
||
-->
|
||
<g id="layer-engineering" transform="translate(100, 930)">
|
||
<text x="0" y="0" class="font-sans title-main">Layer 5: 架构运维管控与安全基线 (Engineering & Security)</text>
|
||
<rect x="0" y="15" width="1000" height="60" rx="8" fill="var(--c-gov-blue-light)" stroke="var(--c-gov-blue)" stroke-width="2" />
|
||
|
||
<!-- Security Badge 1 -->
|
||
<rect x="30" y="30" width="280" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="170" y="50" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">零信任架构 (不可信负载防范)</text>
|
||
|
||
<!-- Security Badge 2 -->
|
||
<rect x="340" y="30" width="280" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="480" y="50" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">.env.example 隔离敏感凭证</text>
|
||
|
||
<!-- Performance Badge -->
|
||
<rect x="650" y="30" width="320" height="30" rx="4" fill="#FFFFFF" stroke="var(--c-gov-blue)" />
|
||
<text x="810" y="50" text-anchor="middle" class="font-mono tech-badge" fill="var(--c-gov-blue)">异步非阻塞事件流 (高并发处理能力)</text>
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
底部图例与注释块 (Legend & Key Block)
|
||
===========================================================================
|
||
-->
|
||
<g id="legend" transform="translate(600, 1050)">
|
||
<rect x="-440" y="-16" width="880" height="40" rx="4" fill="rgba(255, 255, 255, 0.9)" stroke="var(--c-neutral-gray)" stroke-width="0.5"/>
|
||
|
||
<g transform="translate(-420, 0)">
|
||
<text x="0" y="8" class="font-sans" font-size="13" font-weight="bold" fill="var(--c-neutral-gray)">语义图例说明:</text>
|
||
|
||
<!-- 云端/外部 -->
|
||
<g transform="translate(110, 0)">
|
||
<rect x="-6" y="-6" 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)">云端服务 / 外部资源</text>
|
||
</g>
|
||
|
||
<!-- 本地/核心 -->
|
||
<g transform="translate(265, 0)">
|
||
<rect x="-6" y="-6" 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)">本地服务 / 核心引擎</text>
|
||
</g>
|
||
|
||
<!-- 风险/高负载 -->
|
||
<g transform="translate(420, 0)">
|
||
<rect x="-6" y="-6" 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)">高频计算 / 网络爬取</text>
|
||
</g>
|
||
|
||
<!-- 治理/安全 -->
|
||
<g transform="translate(575, 0)">
|
||
<rect x="-6" y="-6" 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>
|
||
|
||
<!-- 逻辑边界 -->
|
||
<g transform="translate(730, 0)">
|
||
<rect x="-8" y="-8" width="16" height="16" rx="2" fill="transparent" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" stroke-width="1.5" />
|
||
<text x="14" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">逻辑边界 / 虚拟容器</text>
|
||
</g>
|
||
</g>
|
||
</g>
|
||
|
||
<!--
|
||
===========================================================================
|
||
底部许可声明
|
||
===========================================================================
|
||
-->
|
||
<text x="600" y="1140" 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>
|