forked from new_org/Project-Caffeine
同意
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
title: "Project Caffeine README"
|
||||
description: "基于 Model Context Protocol (MCP) 协议的研报智能体系统项目介绍、架构蓝图、技术栈说明及开发路线图"
|
||||
type: "README"
|
||||
version: "v1.0.1 (Arabica)"
|
||||
version: "v1.0.2 (Arabica)"
|
||||
file: "README.md"
|
||||
author: "Gitconomy Research-郭晧"
|
||||
date: 2026-02-28
|
||||
last-update: 2026-03-01
|
||||
update-description: "增加Project Caffeine MVP Srpint1 系统设计说明"
|
||||
last-update: 2026-03-06
|
||||
update-description: "增加Project Caffeine Arabica Srpint2 系统设计和开发链接"
|
||||
tags:
|
||||
- Project Caffeine
|
||||
- MCP
|
||||
@@ -82,10 +82,10 @@ status: "Active"
|
||||
|
||||
当前开发进度:
|
||||
|
||||
| **版本** | **主题** | **开发目标** | **核心功能实现** | **设计文档** |
|
||||
| ------------ | ------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| [`v0.1.0`](./projects/arabica/sprint1/README.md) | 提示词策略 MCP Server 原型验证<br> | 部署基于 Node.js 和 Express.js 的轻量级服务,验证 MCP 协议组件间通讯、大语言模型推理等基本运行环境。<br> | 实现最简化的提示词策略 MCP Server。当用户发起查询请求时,系统调用 **5 Whys** 模板对查询进行分解,生成增强提示词,并发送至大语言模型进行深度推理分析,最终返回研究洞察。 | [Project Caffeine提示词策略MCP Server原型设计](./docs/design/project-caffeine-mvp-sprint1-architecture-design.md) |
|
||||
|
||||
| **版本** | **开发目标** | **设计文档** | 开发文档 |
|
||||
| ---------------------------------------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
||||
| [`v0.1.0`](./projects/arabica/src/sprint1/README.md) | 部署基于 Node.js 和 Express.js 的轻量级服务,验证 MCP 协议组件间通讯、大语言模型推理等基本运行环境。<br> | [Arabicat Sprint1系统设计文档](./projects/arabica/docs/design/arabica-sprint1-architecture-specification.md) | [Arabicat Sprint1系统开发文档](./projects/arabica/docs/design/arabica-sprint1-development-specification.md) |
|
||||
| [`v0.1.1`](./projects/arabica/src/sprint2/README.md) | 基于 Sprint 1 原型,扩展为支持 MCP Prompts 原语的多框架引擎,实现意图拆解工具与本地知识库集成,构建模块化、可扩展的提示词策略服务器。 | [Arabica Sprint2系统设计文档](./projects/arabica/docs/design/arabica-sprint2-architecture-specification.md) | [Arabica Sprint2系统开发文档](./projects/arabica/docs/design/arabica-sprint2-devekopment-specification.md) |
|
||||
|
||||
---
|
||||
|
||||
|
||||
+5
-5
@@ -4,12 +4,12 @@
|
||||
图表名称:提示词策略 MCP Server 原型架构图 (Prompt Strategy MVP Architecture)
|
||||
文件命名:prompt-strategy-mcp-server-prototype-architecture.svg
|
||||
用途:展示从 Client 请求到 5 Whys 策略引擎、资源层再到大模型推理的“上下层级”完整组件链及执行流。
|
||||
版本:v2.0.0 (Top-Down Layout with 50px Spacing Adjustment)
|
||||
版本:v2.1.0 (Top-Down Layout with 50px Spacing Adjustment)
|
||||
作者:Gitconomy Research-郭晧
|
||||
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
|
||||
创建日期:2026-03-01
|
||||
更新日期:2026-03-1
|
||||
更新描述:根据更新的架构设计文件,重新设计整个开发组件架构与工作流示意图
|
||||
更新日期:2026-03-5
|
||||
更新描述:更新架构图名称
|
||||
================================================================================
|
||||
-->
|
||||
|
||||
@@ -67,8 +67,8 @@ SPDX-License-Identifier: MIT & CC-BY-SA-4.0
|
||||
-->
|
||||
<g id="title-block" transform="translate(640, 40)">
|
||||
<text y="0" text-anchor="middle" class="font-mono" font-size="12" fill="var(--c-neutral-gray)" letter-spacing="1">FIG-01</text>
|
||||
<text y="30" text-anchor="middle" class="font-sans" font-weight="bold" font-size="24" fill="#000000">提示词策略 MCP Server 系统架构图</text>
|
||||
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 > Arabica Sprint1 > 系统开发组件架构与工作流</text>
|
||||
<text y="30" text-anchor="middle" class="font-sans" font-weight="bold" font-size="24" fill="#000000">>Arabica Sprint 1 系统开发组件架构图</text>
|
||||
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 > Arabica Sprint1 > 单思维框架与意图拆解工作流</text>
|
||||
<rect x="-30" y="70" width="60" height="3" fill="var(--c-local-green)" />
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -0,0 +1,420 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 1000" width="100%" height="100%">
|
||||
<!--
|
||||
================================================================================
|
||||
图表名称:Arabica Sprint 2 架构图 (Arabica Sprint 2 Architecture)
|
||||
文件命名:arabica-srpint2-architecture-design.svg
|
||||
用途:展示 Project Caffeine 提示词策略 MCP Server 在 Sprint 2 中的多维思维框架接入与意图拆解工作流。
|
||||
版本:v1.0.0
|
||||
作者:Gitconomy Research-郭晧
|
||||
SPDX-License-Identifier: MIT & CC-BY-SA-4.0
|
||||
创建日期:2026-03-05
|
||||
================================================================================
|
||||
-->
|
||||
|
||||
<!-- 头部注释:图表背景声明 -->
|
||||
<!-- 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: 15px; font-weight: bold; fill: #FFFFFF; }
|
||||
.card-text { font-size: 13px; 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(640, 40)">
|
||||
<text y="0" text-anchor="middle" class="font-mono" font-size="12" fill="var(--c-neutral-gray)" letter-spacing="1">FIG-01</text>
|
||||
<text y="30" text-anchor="middle" class="font-sans" font-weight="bold" font-size="24" fill="#000000">Arabica Sprint 2 系统开发组件架构图</text>
|
||||
<text y="55" text-anchor="middle" class="font-mono" font-size="14" fill="var(--c-neutral-gray)">架构图 > Arabica Sprint 2 > 多维思维框架与意图拆解工作流</text>
|
||||
<!-- Context Indicator: Y=70 -->
|
||||
<rect x="-30" y="70" width="60" height="3" fill="var(--c-cloud-blue)" />
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
架构图主体内容 (Diagram Content)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="diagram-content" transform="translate(0, 80)">
|
||||
|
||||
<!-- 物理边界与容器 -->
|
||||
<g id="boundaries" transform="translate(0, 240)">
|
||||
<!-- Node.js MCP Server Runtime Boundary -->
|
||||
<rect x="290" y="0" width="700" height="540" rx="12" fill="var(--c-local-green-light)" stroke="var(--c-local-green)" stroke-dasharray="4 4" stroke-width="2" />
|
||||
<rect x="290" y="0" width="700" height="36" fill="var(--c-local-green)" opacity="0.1" rx="12"/>
|
||||
<text x="310" y="23" class="font-mono" font-size="14" font-weight="bold" fill="var(--c-local-green)">📦 MCP Server Runtime(Sprint2) </text>
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
核心连线与数据流向 (Connections)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="connections" fill="none" stroke-width="2">
|
||||
<!-- User to Cherry Studio -->
|
||||
<path d="M 400 110 L 482 110" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 490 140 L 408 140" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
|
||||
<!-- Cherry Studio to Remote LLM -->
|
||||
<path d="M 760 100 L 892 100" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
|
||||
<path d="M 760 120 L 892 120" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
|
||||
<path d="M 900 140 L 768 140" stroke="var(--c-cloud-blue)" stroke-dasharray="4 2" marker-end="url(#arrow-blue)" />
|
||||
|
||||
<!-- stdio Transport -->
|
||||
<path d="M 600 170 L 600 292" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
|
||||
<path d="M 640 300 L 640 178" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
|
||||
|
||||
<!-- app.ts to Controllers -->
|
||||
<path d="M 600 370 L 600 395 L 410 395 L 410 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 640 370 L 640 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 680 370 L 680 395 L 870 395 L 870 422" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
|
||||
<!-- Controllers to Services -->
|
||||
<path d="M 410 490 L 410 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 640 490 L 640 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 870 490 L 870 532" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
|
||||
<!-- resourceService to Local Vault -->
|
||||
<path d="M 700 460 L 750 460 L 750 580 L 780 580" stroke="var(--c-neutral-gray)" marker-end="url(#arrow-gray)" />
|
||||
|
||||
<!-- Services to Schemas/Frameworks -->
|
||||
<path d="M 410 620 L 410 652" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
|
||||
<path d="M 640 620 L 640 652" stroke="var(--c-neutral-gray)" stroke-dasharray="2 2" marker-end="url(#arrow-gray)" />
|
||||
|
||||
<!-- toolsController to resourceService -->
|
||||
<path d="M 870 620 L 870 680" stroke="var(--c-local-green)" marker-end="url(#arrow-green)" />
|
||||
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
路径标签说明 (Path Labels)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="path-labels" class="font-sans label-text">
|
||||
<!-- Top Level -->
|
||||
<text x="445" y="95" text-anchor="middle">Query</text>
|
||||
<text x="445" y="160" text-anchor="middle">Report</text>
|
||||
<text x="830" y="85" text-anchor="middle" fill="var(--c-cloud-blue)">Reasoning</text>
|
||||
<text x="830" y="160" text-anchor="middle" fill="var(--c-cloud-blue)">LLM Result</text>
|
||||
|
||||
<!-- stdio Link -->
|
||||
<text x="585" y="200" text-anchor="end" fill="var(--c-local-green)">prompts/get</text>
|
||||
<text x="585" y="220" text-anchor="end" fill="var(--c-local-green)">tools/call</text>
|
||||
<text x="655" y="210" text-anchor="start" fill="var(--c-local-green)">Result Data</text>
|
||||
|
||||
<rect x="585" y="250" width="70" height="20" rx="4" fill="#FFFFFF" stroke="var(--c-local-green)" />
|
||||
<text x="620" y="264" text-anchor="middle" class="font-mono" font-size="11" fill="var(--c-local-green)">stdio</text>
|
||||
<text x="820" y="650" text-anchor="middle" class="font-mono" font-size="11" fill="var(--c-neutral-gray)">load/save</text>
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
架构节点卡片 (Node Cards)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="nodes">
|
||||
<!-- 1. User Node -->
|
||||
<g transform="translate(280, 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(490, 80)">
|
||||
<rect x="0" y="0" width="260" height="90" rx="8" fill="var(--c-gov-blue-light)" stroke="var(--c-gov-blue)" stroke-width="2" />
|
||||
<rect x="0" y="0" width="260" height="30" fill="var(--c-gov-blue)" rx="8" />
|
||||
<rect x="0" y="20" width="260" height="10" fill="var(--c-gov-blue)" />
|
||||
<text x="130" y="20" text-anchor="middle" class="font-sans card-title">Cherry Studio (MCP Client)</text>
|
||||
<text x="130" y="55" text-anchor="middle" class="font-sans card-text" font-weight="bold">大模型对话与调度宿主</text>
|
||||
<text x="130" 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(970, 120)">
|
||||
<polygon points="0,-45 40,-20 40,20 0,45 -40,20 -40,-20" fill="var(--c-cloud-blue-light)" stroke="var(--c-cloud-blue)" stroke-width="3" />
|
||||
<text x="0" y="-5" text-anchor="middle" class="font-mono card-test" fill="var(--c-cloud-blue)" font-size="14">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. app.ts -->
|
||||
<g transform="translate(560, 300)">
|
||||
<rect x="-10" y="0" width="180" height="70" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
|
||||
<rect x="-10" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
|
||||
<rect x="-10" y="20" width="180" 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">Prompts & Tools (stdio)</text>
|
||||
</g>
|
||||
|
||||
<!-- 5. promptsController.ts -->
|
||||
<g transform="translate(320, 430)">
|
||||
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-risk-amber)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-risk-amber)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">promptsController</text>
|
||||
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 prompts/get 和 list</text>
|
||||
</g>
|
||||
|
||||
<!-- 6. toolsController.ts -->
|
||||
<g transform="translate(550, 430)">
|
||||
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-risk-amber)" stroke-width="2" />
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-risk-amber)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-risk-amber)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">toolsController</text>
|
||||
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 tools 工具调度分发</text>
|
||||
</g>
|
||||
|
||||
<!-- 7. resourcesController.ts -->
|
||||
<g transform="translate(780, 430)">
|
||||
<rect x="0" y="0" width="180" height="60" rx="6" fill="#FFFFFF" stroke="var(--c-neutral-gray-light)" stroke-width="2" stroke-dasharray="2 2" opacity="0.8"/>
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-neutral-gray-light)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-neutral-gray-light)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">resourcesController</text>
|
||||
<text x="90" y="48" text-anchor="middle" class="font-sans card-text">处理 resources 请求分发</text>
|
||||
</g>
|
||||
|
||||
<!-- 8. promptService.ts -->
|
||||
<g transform="translate(320, 540)">
|
||||
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">promptService.ts</text>
|
||||
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12" fill="var(--c-local-green)">管理多维思维框架库</text>
|
||||
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">返回静态结构化模板</text>
|
||||
</g>
|
||||
|
||||
<!-- 9. intentService.ts -->
|
||||
<g transform="translate(550, 540)">
|
||||
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" />
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">intentService.ts</text>
|
||||
<rect x="25" y="35" width="130" height="20" rx="3" fill="var(--c-risk-amber-light)" />
|
||||
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12" fill="var(--c-risk-amber)">意图拆解核心算法</text>
|
||||
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">生成专业检索词(3~5个)</text>
|
||||
</g>
|
||||
|
||||
<!-- 10. resourceService.ts -->
|
||||
<g transform="translate(780, 540)">
|
||||
<rect x="0" y="0" width="180" height="80" rx="6" fill="#FFFFFF" stroke="var(--c-local-green)" stroke-width="2" stroke-dasharray="2 2" opacity="0.8"/>
|
||||
<rect x="0" y="0" width="180" height="26" fill="var(--c-local-green)" rx="6" />
|
||||
<rect x="0" y="20" width="180" height="6" fill="var(--c-local-green)" />
|
||||
<text x="90" y="18" text-anchor="middle" class="font-mono card-title">resourceService.ts</text>
|
||||
<text x="90" y="50" text-anchor="middle" class="font-sans text-code" font-size="12">文件系统 I/O 交互</text>
|
||||
<text x="90" y="70" text-anchor="middle" class="font-sans card-text" font-size="11">读取本地知识库</text>
|
||||
</g>
|
||||
|
||||
<!-- 11. models/frameworks -->
|
||||
<g transform="translate(320, 660)">
|
||||
<rect x="0" y="0" width="180" height="60" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" stroke-dasharray="4 2" />
|
||||
<path d="M 0 20 L 180 20" stroke="var(--c-neutral-gray)" stroke-width="1.5" stroke-dasharray="4 2" />
|
||||
<text x="90" y="14" text-anchor="middle" class="font-mono text-code" font-size="11">models/frameworks/</text>
|
||||
<text x="90" y="38" text-anchor="middle" class="font-mono card-text" font-size="11">5w3h.json, scqa.json</text>
|
||||
<text x="90" y="52" text-anchor="middle" class="font-mono card-text" font-size="11">swot.json, pestle.json</text>
|
||||
</g>
|
||||
|
||||
<!-- 12. schemas.ts -->
|
||||
<g transform="translate(595, 660)">
|
||||
<rect x="0" y="0" width="90" height="60" rx="6" fill="#F8FAFC" stroke="var(--c-neutral-gray)" stroke-width="1.5" />
|
||||
<text x="45" y="25" text-anchor="middle" class="font-mono text-code" font-size="12">schemas.ts</text>
|
||||
<text x="45" y="45" text-anchor="middle" class="font-sans card-text" font-size="11">Zod 强校验</text>
|
||||
</g>
|
||||
|
||||
<!-- 13. External Resources -->
|
||||
<g transform="translate(820, 680)">
|
||||
<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="55" text-anchor="middle" class="font-sans card-text" fill="var(--c-neutral-gray)" font-size="12">Local Vault</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
步骤侧边栏与流程图注 (Execution Steps)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="execution-steps">
|
||||
<g transform="translate(440, 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(830, 100)">
|
||||
<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(600, 210)">
|
||||
<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(410, 505)">
|
||||
<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(830, 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">5</text>
|
||||
</g>
|
||||
<g transform="translate(640, 505)">
|
||||
<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(440, 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">7</text>
|
||||
</g>
|
||||
<g transform="translate(640, 210)">
|
||||
<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(870, 645)">
|
||||
<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(20, 280)">
|
||||
<rect x="0" y="0" width="260" height="240" rx="8" fill="#FEF2F2" stroke="var(--c-step-red)" stroke-width="1.5" />
|
||||
<text x="130" y="25" text-anchor="middle" class="font-sans" font-size="14" font-weight="bold" fill="var(--c-step-red)">Sprint 2 执行步骤流</text>
|
||||
<line x1="15" y1="35" x2="245" 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">用户在 Cherry Studio 输入查询</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">大模型判断需要调用多维思维框架</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发起 prompts/get 获取模板</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">组合模板与查询,大模型初步推理</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">调用 tools/call 获取专业检索词</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">Server 执行意图拆解并返回结果</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">大模型结合检索词完成返回查询结果</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">结构化提示词传递给模型</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">查询结果保存到本地知识库</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
底部图例与注释块 (Legend & Key Block)
|
||||
===========================================================================
|
||||
-->
|
||||
<g id="legend" transform="translate(640, 920)">
|
||||
<!-- 统一的半透明背景容器 -->
|
||||
<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>
|
||||
|
||||
<!-- 图例项 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(490, 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)">核心执行引擎与资源层</text>
|
||||
</g>
|
||||
|
||||
<!-- 图例项 4 -->
|
||||
<g transform="translate(680, 0)">
|
||||
<rect x="-6" y="-4" width="12" height="12" rx="2" fill="var(--c-neutral-gray-light)" />
|
||||
<text x="12" y="8" class="font-sans" font-size="12" fill="var(--c-neutral-gray)">Sprint 3 预留扩展 (灰色)</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!--
|
||||
===========================================================================
|
||||
版权许可声明 (License)
|
||||
===========================================================================
|
||||
-->
|
||||
<text x="640" y="980" 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: 24 KiB |
@@ -0,0 +1,134 @@
|
||||
<!--
|
||||
---
|
||||
title: Arabica Release Sprint 功能开发规划
|
||||
description: 全面规划 Arabica (v1.0.0) 版本的 5 个渐进式 Sprint 迭代目标,遵循敏捷迭代原则,涵盖从底层 MCP 基础设施建设、思维框架组装,到递归深度研究算法攻坚与本地 PKM 融合的完整演进路径。
|
||||
type: Feature Design
|
||||
version: v1.0.0 (Arabica)
|
||||
file: arabica-release-sprint-design.md
|
||||
author: Gitconomy Research-郭晧
|
||||
date: 2026-03-05
|
||||
tags:
|
||||
- Project Caffeine
|
||||
- MVP
|
||||
- Sprint 规划
|
||||
- 开发路线图
|
||||
- Deep Research
|
||||
- MCP
|
||||
license: CC BY-SA 4.0
|
||||
status: Active
|
||||
---
|
||||
-->
|
||||
# Arabica Release Sprint 功能开发规划
|
||||
|
||||
## 🏁 Sprint 1:本地基础设施与单点能力验证 (已完成)
|
||||
|
||||
**概述**: 本次迭代的核心目标是搭建零网络开销的底层标准通信,跑通大模型对本地知识库的安全读取与基础策略生成的物理链路。系统在一套代码中集成了官方 MCP SDK(支持 Cherry Studio 的 `stdio` 标准通信),无缝接入本地 Obsidian 目录,并通过 VS Code 跑通了完美的源码级断点联调工作流。
|
||||
|
||||
|功能模块|详细说明|
|
||||
|---|---|
|
||||
|**底层架构 (stdio) 初始化**|初始化基于 Node.js 的主入口 `src/app.ts`,负责建立标准输入输出传输层,并向客户端注册工具字典。|
|
||||
|**本地资源安全挂载**|开发 `src/services/resourceService.ts`,实现 `list_local_notes` 和 `read_local_note` 工具,并带有严格路径防穿越(Path Traversal)安全校验。|
|
||||
|**提示词策略引擎建设**|开发 `src/services/promptService.ts`,提供纯本地业务逻辑,负责核心的 **5 Whys 框架生成**。|
|
||||
|**全链路源码级联调配置**|配置 `tsconfig.json` 生成 `sourceMap`,并在 `.vscode/launch.json` 中映射 `dist` 目录,实现在 Cherry Studio 挂载 `--inspect=9229` 参数的源码级断点拦截。|
|
||||
|
||||
---
|
||||
|
||||
## Sprint 2:提示词策略 Server (S2) 建设与多维思维引擎组装
|
||||
|
||||
**概述**: 本次迭代的核心目标是全面扩充系统的“大脑”——**S2 (提示词策略 Server)**。通过引入 MCP 的 `Prompts` 原语,系统将写入多种静态思维框架模板,让大模型在面对用户模糊的自然语言提问时,能够主动调用这些标准化的模板来规范交互结构和意图拆解逻辑,彻底打通基于思维框架的单次分析闭环。
|
||||
|
||||
|功能模块|详细说明|
|
||||
|:--|:--|
|
||||
|**MCP Prompts 原语接入**|启用 MCP 规范中的第三大核心系统原语 `Prompts`。开发 `prompts/list` 和 `prompts/get` 接口,将各种思维框架作为可复用的模板暴露给大模型,帮助其构造标准化的交互结构,降低每次对话所需的前置上下文长度。|
|
||||
|**多维静态思维框架扩展**|在 Sprint 1 的 5 Whys 基础上,向 S2 写入并注册更多经典的静态思维框架模板,如 **5W3H、SCQA、SWOT、PESTLE** 等。这些框架将指导大模型按照标准逻辑结构进行逐步推理。|
|
||||
|**意图拆解与广度解析工具**|配合上述思维框架,开发 `generate_search_queries` 工具。该工具将赋予大模型将用户的“大白话”拆解为 3-5 个专业检索词的能力,从而实现研究主题的 Breadth(广度)解析。|
|
||||
|**底层角色矩阵与输出规范设计**|建立多智能体角色矩阵 (Persona Matrix) 的雏形,设计精确的 System Prompts,并通过 Few-Shot(少样本)示例在提示词模板中定义大模型的输出结构约束(如强制输出 Markdown 格式)。|
|
||||
|
||||
---
|
||||
|
||||
## Sprint 3:文献查询 Server (S1) 与外围学术检索
|
||||
|
||||
**概述**: 本次迭代**聚焦于外部学术数据的抓取与标准化落盘**。让系统拥有向外探索的“触手”,接入学术 API,并将抓取到的离散 JSON 数据转化为符合后续系统流转的本地化 Markdown 数据。
|
||||
|
||||
|功能模块|详细说明|
|
||||
|---|---|
|
||||
|**基础学术检索能力**|集成至少 2 个核心学术 API(如 arXiv API、Semantic Scholar API),实现基础的 `search_academic_literature` 工具。|
|
||||
|**双轨制数据落盘模块**|开发 `save_to_local_vault` 工具,实现外部 API 的 JSON 数据到 Markdown + YAML Frontmatter 的自动转换。|
|
||||
|**标准化数据字典**|设计最终落盘的 Markdown 模板与 YAML Frontmatter 元数据字典,明确 `title`, `citation_density_check`, `research_depth_level` 等字段。|
|
||||
|
||||
---
|
||||
|
||||
## Sprint 4:长文本切块算法与单轮 CoT 推理合成 (S3)
|
||||
|
||||
**概述**:本次迭代**聚焦于大模型上下文窗口限制的突破与基础报告生成**。解决长篇 PDF 或文献导致的 Token 超载问题,并正式建立 S3(CoT 多步推理 Server),打通单次分析的工作流闭环。
|
||||
|
||||
|功能模块|详细说明|
|
||||
|---|---|
|
||||
|**Token 感知语义切块**|开发 `fetch_and_split_document` 工具,制定长文本“Token 感知语义切块(Semantic Chunking)”的具体策略与重叠率标准。|
|
||||
|**异步局部同步**|服务端在本地完成文本解析与向量切割,仅将统计学上高度相关的片段异步同步给客户端,避免 Token 极度消耗。|
|
||||
|**CoT 多步推理合成**|开发 `cot_literature_synthesis` 核心提示词模板,规范大模型的输出结构(摘要、引言、主体等)。|
|
||||
|
||||
---
|
||||
|
||||
## Sprint 5:深研状态机设计与防死循环管控
|
||||
|
||||
**概述**:本次迭代是系统的算法攻坚核心,**聚焦于递归检索的状态管理**。为了让系统从“单轮问答”升级为“AI 研究员”,本阶段专门开发探索账本与状态机,严防模型在多轮检索中陷入自我循环的死胡同。
|
||||
|
||||
|功能模块|详细说明|
|
||||
|---|---|
|
||||
|**深研状态机设计**|明确大模型在“检索 -> 切块 -> 提取 -> 评估盲区 -> 追问”循环中的状态流转图。|
|
||||
|**探索账本管理**|开发 `manage_exploration_state` 工具,记录已经检索过的 Query 和文献 ID。|
|
||||
|**哈希去重与循环拦截**|设计布隆过滤器或哈希去重逻辑,严防大模型陷入检索死循环。|
|
||||
|
||||
---
|
||||
|
||||
## Sprint 6:多智能体角色矩阵与知识盲区探测
|
||||
|
||||
**概述**:在状态机建好后,本次迭代**聚焦于智能体角色赋予与递归评估逻辑**。通过下发不同的专家指令,并强约束模型必须自我评估知识盲区,实现真正的多轮次深度研究(Deep Research)。
|
||||
|
||||
| 功能模块 | 详细说明 |
|
||||
| ------------- | --------------------------------------------------------------------------- |
|
||||
| **多智能体角色矩阵** | 建立 Persona Matrix,为“检索策略专家”、“洞察提取研究员”、“战略分析顾问”等角色撰写并动态下发精确的 System Prompts。 |
|
||||
| **深度评估与盲区探测** | 开发最关键的 `evaluate_research_depth`(深度评估)和 `evaluate_knowledge_gaps`(盲区探测)工具。 |
|
||||
| **递归工作流编排** | 在客户端提示词中写入递归循环逻辑:强约束大模型在提取洞察后,必须调用评估盲区工具;若未达标,必须发起新一轮检索。 |
|
||||
|
||||
---
|
||||
|
||||
## Sprint 7:学术级质量把控与深度网络爬虫强化
|
||||
|
||||
**概述**:本次迭代**聚焦于学术级内容质检与突破性信息获取**。要求模型输出的结果必须具备严谨的学术溯源特征,同时补齐系统对深层网页内容的抓取能力。
|
||||
|
||||
| 功能模块 | 详细说明 |
|
||||
| ------------ | --------------------------------------------------------------------------------------- |
|
||||
| **引用密度强制校验** | 强化 S3 质检逻辑,实现引用密度强制校验,确保正文中的核心事实必须带有 `[文献ID]` 尾注。 |
|
||||
| **时效性与局限声明** | 开发“利益冲突与时效性局限”自动声明模块,降低学术幻觉。 |
|
||||
| **深度网络爬虫强化** | 实现 `scrape_and_parse_deep_content` 工具,引入 Playwright 或 Firecrawl 突破纯 API 限制,抓取含金量高的网页正文。 |
|
||||
|
||||
---
|
||||
|
||||
## Sprint 8:PKM (个人知识管理) 深度对接与双向融合
|
||||
|
||||
**概述**:本次迭代**完全聚焦于最终知识产物的网状关联**。致力于让系统生成的报告不只是孤立的文件,而是能完美融入用户现有的 Obsidian 或 Logseq 知识图谱中。
|
||||
|
||||
| 功能模块 | 详细说明 |
|
||||
| ---------- | ------------------------------------------------------------------------------------------ |
|
||||
| **物理串联机制** | 梳理与 Obsidian/Logseq 等工具联动的双向链接(`[[...]]`)自动生成策略。 |
|
||||
| **本地图谱融合** | 深度优化 `save_to_local_vault`,在 Markdown 正文中自动生成 Obsidian 格式的双向链接 `[[文献名称]]`,将主报告与独立洞察卡片物理串联。 |
|
||||
|
||||
---
|
||||
|
||||
## Sprint 9:网络层扩展、并发优化与最终交付
|
||||
|
||||
**概述**:作为 Arabica (v1.0.0) 的收官迭代,本次 Sprint **聚焦于网络协议扩展与企业级工程质量**。为系统增加远程云端调用能力,完成并发压测与开源交付。
|
||||
|
||||
| 功能模块 | 详细说明 |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| **HTTP + SSE 协议扩展** | 引入 HTTP POST 请求与 Server-Sent Events (SSE) 流式下发响应,支持云端部署的远程 MCP 服务端跨网络调用。 |
|
||||
| **LRU 缓存与异步优化** | 引入全面的异步处理模型(如 Node.js 非阻塞事件流),并对高频读写的中间结果采用最近最少使用(LRU)缓存策略,结合哈希映射和双向链表管理生命周期。 |
|
||||
| **环境变量与测试交付** | 完善 `.env.example`(配置各路 API Keys 等),利用 k6 Load Testing 进行 P99 压测,最终发布 V0.1.0(对应 Arabica v1.0.0)正式版本。 |
|
||||
|
||||
---
|
||||
|
||||
## 许可声明
|
||||
|
||||
本文档采用 **知识共享署名--相同方式共享 4.0 国际许可协议 (CC BY--SA 4.0)** 进行许可,© 2025-2026 Gitconomy Research.
|
||||
+45
-33
@@ -4,11 +4,11 @@ title: 提示词策略 MCP Server 原型设计文档
|
||||
description: Project Caffeine 提示词策略 MCP Server 的最小可行性功能(MVP)原型设计,涵盖 5 Whys 模板调用、增强提示词合成及 Node.js 环境工作流验证
|
||||
type: Architecture Design
|
||||
file: project-caffeine-mvp-sprint1-architecture-design.md
|
||||
version: v1.0.1 (Arabica)
|
||||
version: v1.0.2 (Arabica)
|
||||
author: Gitconomy Research-郭晧
|
||||
date: 2026-03-1
|
||||
last-update: 2026-03-01
|
||||
update-description: 增加Cherry Stuio作为 MCP Client,上一版的设计还是基于传统的“AI Web 应用后端”,而不是严格意义上的 MCP 系统框架 。
|
||||
last-update: 2026-03-05
|
||||
update-description: 更新Sprint1 数据流示意图和架构图的说明描述。
|
||||
tags:
|
||||
- Project Caffeine
|
||||
- MCP Server
|
||||
@@ -21,7 +21,7 @@ license: CC BY-SA 4.0
|
||||
status: Active
|
||||
---
|
||||
-->
|
||||
# Project Caffeine最小可行功能原型设计 —— 提示词策略MCP Server
|
||||
# PArabica Sprint1 系统架构设计说明
|
||||
|
||||
## 1. 原型设计概述
|
||||
|
||||
@@ -38,19 +38,34 @@ status: Active
|
||||
|
||||
### 2. 功能实现步骤说明
|
||||
|
||||
#### 2.1 客户端请求与工具分发
|
||||
|
||||
- 用户在 **Cherry Studio** 中输入查询意图(如:“分析LLM在医疗中的应用瓶颈”)。
|
||||
- Cherry Studio 内部的大模型判断需要更深度的思考框架,主动向本 **MCP Server** 发起 `generate_5_whys` 的工具调用。
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant User as 用户
|
||||
participant Client as Cherry Studio (MCP Client)
|
||||
participant LLM as 大语言模型
|
||||
participant Server as MCP Server (Project Caffeine)
|
||||
|
||||
#### 2.2 生成 5 Whys 增强提示词
|
||||
User->>Client: 1. 输入查询(如“分析LLM在医疗中的应用瓶颈”)
|
||||
Client->>LLM: 传递查询
|
||||
LLM-->>Client: 2. 决策需要深度思考框架,决定调用工具
|
||||
Client->>Server: 3. tools/call (generate_5_whys, query=...)
|
||||
Server->>Server: 4. promptService.js 本地生成 5 Whys 追问列表
|
||||
Server-->>Client: 5. 返回 5 Whys 数组
|
||||
Client->>LLM: 6. 将 5 Whys 作为上下文,发起最终推理请求
|
||||
LLM-->>Client: 返回深度分析结果
|
||||
Client-->>User: 7. 渲染并展示深度研究报告
|
||||
```
|
||||
|
||||
- **MCP Server** 接收到参数后,执行本地 `promptService.js`,根据查询主题自动生成 5 个逐层递进的问题(5 Whys)。
|
||||
基于 Cherry Studio 和 MCP (Model Context Protocol) 架构的工作流分为七个关键步骤:
|
||||
|
||||
#### 2.3 结果返回与最终推理
|
||||
|
||||
- **MCP Server** 将生成的 5 Whys 数组作为工具执行结果,通过标准协议返回给 Cherry Studio。
|
||||
- Cherry Studio 携带这些增强提示词再次请求大模型,生成最终的深度研究洞察,并展示给用户。
|
||||
1. **用户发起提问**:用户首先在前端(Cherry Studio)输入自己的问题或查询需求。
|
||||
2. **大模型决策调用工具**:Cherry Studio 作为 MCP 客户端,接收到用户提问后,其连接的大模型会对问题进行分析,并判断出需要调用系统注册的外部工具(如 5 Whys 分析法)来获取更好的提示词策略,而不是直接回答。
|
||||
3. **发起工具调用请求 tools/call**:Cherry Studio 通过标准输入输出流(`stdio`)协议,向后端的 Project Caffeine MCP Server(基于 Node.js 构建)发送一个名为 `generate_5_whys` 的工具调用指令。
|
||||
4. **本地生成 5 Whys 文本**:Project Caffeine MCP Server 接收到指令后,触发其内部的业务逻辑模块 `promptService.js`。该模块完全在本地运行,不依赖外部大模型,根据用户的初始问题自动生成 5 个逐层深入的追问(即 5 Whys 文本)。
|
||||
5. **返回工具执行结果**:MCP Server 将生成的 5 Whys 文本打包成标准的结果格式,通过协议传回给 Cherry Studio。
|
||||
6. **结合工具结果发起最终推理**:Cherry Studio 拿到这 5 个问题后,将其作为增强的上下文提示词,再次向大语言模型发起最终的深度推理请求,要求模型基于这些追问给出详尽的分析。
|
||||
7. **渲染并呈现结果**:大模型完成最终推理后,Cherry Studio 将这部分内容进行界面渲染,最终向用户呈现一份高质量的“深度洞察报告”。
|
||||
|
||||
---
|
||||
|
||||
@@ -86,33 +101,30 @@ project-caffeine/
|
||||
|
||||
*表1-1:**Project Caffeine** 项目 MVP 系统文件和文件夹功能详细说明表格*
|
||||
|
||||
| **目录** | **文件名** | **功能说明** |
|
||||
| --- | --- | --- |
|
||||
| **`src/`** | **`app.js`** | 实例化官方 `McpServer`,配置 `stdio` 传输层,向 Client 注册 Tools 和 Resources。 |
|
||||
| **`src/controllers/`** | **`promptsController.js`** | 接收 `tools/call` 请求,调用 `promptService` 并格式化输出返回给 Client。 |
|
||||
| **`src/controllers/`** | **`resourcesController.js`** | 处理 `resources/list` 和 `resources/read` 请求,返回资源数据。 |
|
||||
| **`src/services/`** | **`promptService.js`** | 纯本地业务逻辑:根据入参字符串生成 **5 Whys** 数组结构。 |
|
||||
| **`src/services/`** | **`resourceService.js`** | 本地文件系统交互:读取本地知识库(如 Obsidian)或指定目录文档。 |
|
||||
| **`.vscode/`** | **`launch.json`** | 极其关键:配置 Node.js 的 `--inspect` 端口,实现基于 Cherry Studio 唤起时的断点联调。 |
|
||||
| **目录** | **文件名** | **功能说明** |
|
||||
| ---------------------- | ---------------------------- | --------------------------------------------------------------- |
|
||||
| **`src/`** | **`app.js`** | 实例化官方 `McpServer`,配置 `stdio` 传输层,向 Client 注册 Tools 和 Resources。 |
|
||||
| **`src/controllers/`** | **`promptsController.js`** | 接收 `tools/call` 请求,调用 `promptService` 并格式化输出返回给 Client。 |
|
||||
| **`src/controllers/`** | **`resourcesController.js`** | 处理 `resources/list` 和 `resources/read` 请求,返回资源数据。 |
|
||||
| **`src/services/`** | **`promptService.js`** | 纯本地业务逻辑:根据入参字符串生成 **5 Whys** 数组结构。 |
|
||||
| **`src/services/`** | **`resourceService.js`** | 本地文件系统交互:读取本地知识库(如 Obsidian)或指定目录文档。 |
|
||||
| **`.vscode/`** | **`launch.json`** | 极其关键:配置 Node.js 的 `--inspect` 端口,实现基于 Cherry Studio 唤起时的断点联调。 |
|
||||
|
||||
### 3.2 系统模块架构说明
|
||||
|
||||
*图1-1:提示词策略 MCP Server 系统组件工作流架构图*
|
||||
*图 1-2:Sprint 1 组件架构与数据流*
|
||||
|
||||

|
||||

|
||||
|
||||
Sprint 1 系统组件架构基于 MCP 协议构建了一个轻量级的提示词策略服务器。
|
||||
|
||||
基于 Cherry Studio 和 MCP (Model Context Protocol) 架构的工作流分为七个关键步骤:
|
||||
核心组件包括:
|
||||
- `app.js` 作为主入口,负责初始化 `McpServer` 实例并配置 `stdio` 传输层,向客户端(Cherry Studio)注册 `generate_5_whys` 工具;
|
||||
- `controllers/promptsController.js` 接收并路由工具调用请求;
|
||||
- `services/promptService.js` 实现本地业务逻辑,根据用户查询自动生成 5 Whys 逐层追问列表;
|
||||
- `models/schemas.js` 基于 Zod 进行参数校验。
|
||||
|
||||
1. **用户发起提问**:用户首先在前端(Cherry Studio)输入自己的问题或查询需求。
|
||||
2. **大模型决策调用工具**:Cherry Studio 作为 MCP 客户端,接收到用户提问后,其连接的大模型会对问题进行分析,并判断出需要调用系统注册的外部工具(如 5 Whys 分析法)来获取更好的提示词策略,而不是直接回答。
|
||||
3. **发起工具调用请求 tools/call**:Cherry Studio 通过标准输入输出流(`stdio`)协议,向后端的 Project Caffeine MCP Server(基于 Node.js 构建)发送一个名为 `generate_5_whys` 的工具调用指令。
|
||||
4. **本地生成 5 Whys 文本**:Project Caffeine MCP Server 接收到指令后,触发其内部的业务逻辑模块 `promptService.js`。该模块完全在本地运行,不依赖外部大模型,根据用户的初始问题自动生成 5 个逐层深入的追问(即 5 Whys 文本)。
|
||||
5. **返回工具执行结果**:MCP Server 将生成的 5 Whys 文本打包成标准的结果格式,通过协议传回给 Cherry Studio。
|
||||
6. **结合工具结果发起最终推理**:Cherry Studio 拿到这 5 个问题后,将其作为增强的上下文提示词,再次向大语言模型发起最终的深度推理请求,要求模型基于这些追问给出详尽的分析。
|
||||
7. **渲染并呈现结果**:大模型完成最终推理后,Cherry Studio 将这部分内容进行界面渲染,最终向用户呈现一份高质量的“深度洞察报告”。
|
||||
|
||||
简单来说,这是一个“用户提问 -> 客户端大模型决定求助 -> 本地服务端生成分析框架 -> 客户端大模型根据框架给出深度回答”的完整闭环。
|
||||
整个服务不依赖外部大模型,完全在本地运行,通过标准输入输出与客户端通信,形成“用户提问 → 客户端大模型决策 → 服务端生成框架 → 客户端大模型深度推理”的闭环工作流。该架构为后续扩展更多思维框架和资源访问奠定了坚实基础。
|
||||
|
||||
---
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ license: "CC BY-SA 4.0"
|
||||
status: "Active"
|
||||
---
|
||||
-->
|
||||
# Project Caffeine Sprint1版本开发指南
|
||||
# Arabica Sprint1 版本开发指南说明
|
||||
|
||||
## 1. 环境前置要求
|
||||
|
||||
@@ -0,0 +1,285 @@
|
||||
<!--
|
||||
---
|
||||
title: Arabica Sprint12系统架构设计说明
|
||||
description: Project Caffeine 提示词策略 MCP Server Sprint 2 架构设计,聚焦于 MCP Prompts 原语接入、多维思维框架组装及底层角色矩阵设计。
|
||||
version: v1.0.0 (Arabica) - Sprint 2
|
||||
author: Gitconomy Research-郭晧
|
||||
date: 2026-03-05
|
||||
type: Architecture Design
|
||||
file: project-caffeine-mvp-sprint2-architecture-design.md
|
||||
tags:
|
||||
- Project Caffeine
|
||||
- MCP Server
|
||||
- Sprint 2
|
||||
- Prompt Strategy
|
||||
- Prompts
|
||||
- Node.js
|
||||
license: CC BY-SA 4.0
|
||||
status: Active
|
||||
---
|
||||
-->
|
||||
# Arabica Sprint2 系统架构设计说明
|
||||
|
||||
## 1. Sprint2 设计概述
|
||||
|
||||
**Sprint 1** 实现了基于 **5 Whys** 的单一思维框架工具调用,验证了 MCP 协议下本地策略服务与大模型协同的可行性。
|
||||
|
||||
**Sprint 2** 的核心目标是将提示词策略 Server(S2)从“单点工具”升级为“多维思维框架引擎”,通过引入 MCP 的 **Prompts 原语**,将多种经典思维框架(5W3H、SCQA、SWOT、PESTLE 等)作为可复用的模板暴露给大模型,并开发意图拆解工具,使系统能够自动将用户模糊的自然语言查询拆解为专业检索词,从而大幅提升研究的广度与深度。
|
||||
|
||||
**关键功能**:
|
||||
|
||||
- **Prompts 原语接入**:实现 `prompts/list` 和 `prompts/get` 接口,向客户端(Cherry Studio)注册多个静态思维框架模板。
|
||||
- **多维思维框架库**:内置 5W3H、SCQA、SWOT、PESTLE 等框架,每个框架包含结构化提示词模板。
|
||||
- **意图拆解工具**:开发 `generate_search_queries` 工具,将用户原始查询拆解为 3~5 个专业检索词,用于后续文献检索(Sprint 3)。
|
||||
- **角色矩阵与输出规范**:设计多智能体角色矩阵雏形,并在提示词中通过 Few-Shot 示例约束输出格式(如强制 Markdown 结构)。
|
||||
|
||||
---
|
||||
|
||||
## 2. 功能实现步骤说明
|
||||
|
||||
典型用户查询流程(参见图 2-1):
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant User as 用户
|
||||
participant Client as Cherry Studio (MCP Client)
|
||||
participant LLM as 大模型
|
||||
participant S2 as 提示词策略 Server (S2)
|
||||
|
||||
User->>Client: 输入查询Q
|
||||
Client->>LLM: 传递查询Q
|
||||
LLM->>Client: 决策需要思维框架
|
||||
Client->>S2: prompts/get (框架=SCQA)
|
||||
S2-->>Client: 返回SCQA模板
|
||||
Client->>LLM: 组合模板+Q,请求推理
|
||||
LLM->>Client: 需要检索词,调用工具
|
||||
Client->>S2: tools/call (generate_search_queries, query=Q)
|
||||
S2->>S2: 意图拆解逻辑
|
||||
S2-->>Client: 返回检索词列表
|
||||
Client->>LLM: 提供检索词,继续推理
|
||||
LLM-->>Client: 生成深度报告
|
||||
Client-->>User: 展示结果
|
||||
```
|
||||
|
||||
1. **用户输入自然语言查询**(如“分析新能源汽车行业竞争格局”)。
|
||||
2. **Cherry Studio 内大模型决策**:判断需要调用多维思维框架辅助分析。
|
||||
3. **客户端发起 `prompts/get` 请求**:选择合适的思维框架(例如 SCQA),获取模板内容。
|
||||
4. **客户端组合提示词**:将模板与用户查询结合,形成增强提示词。
|
||||
5. **大模型初步推理**:可能识别出需要更专业的检索词,于是调用 `generate_search_queries` 工具。
|
||||
6. **服务端执行意图拆解**:`intentService` 根据查询生成检索词列表。
|
||||
7. **工具结果返回**:客户端获得检索词,可结合文献查询 Server(Sprint 3)进行下一步检索。
|
||||
8. **最终推理与输出**:大模型利用框架模板和检索结果生成结构化深度报告。
|
||||
|
||||
---
|
||||
|
||||
## 3. 系统组件架构设计
|
||||
|
||||
### 3.1 项目结构更新(基于 Sprint 1)
|
||||
|
||||
```markdown
|
||||
project-caffeine/
|
||||
│
|
||||
├── src/
|
||||
│ ├── controllers/
|
||||
│ │ ├── promptsController.js # 处理 prompts/list 和 prompts/get
|
||||
│ │ ├── toolsController.js # 处理工具调用(含原有5Whys+新增意图拆解)
|
||||
│ │ └── resourcesController.js # (保留,Sprint3扩展)
|
||||
│ ├── services/
|
||||
│ │ ├── promptService.js # 升级:管理多框架模板库,根据框架名返回结构化提示词
|
||||
│ │ ├── intentService.js # 新增:意图拆解逻辑,生成检索词
|
||||
│ │ └── resourceService.js # (保留)
|
||||
│ ├── models/
|
||||
│ │ ├── schemas.js # Zod校验(新增prompts参数校验)
|
||||
│ │ └── frameworks/ # 思维框架定义目录
|
||||
│ │ ├── 5w3h.json
|
||||
│ │ ├── scqa.json
|
||||
│ │ ├── swot.json
|
||||
│ │ └── pestle.json
|
||||
│ └── app.js # 主入口:注册 Prompts 和 Tools
|
||||
│
|
||||
├── .vscode/launch.json # 调试配置(不变)
|
||||
├── config/config.js # 配置(可扩展框架路径)
|
||||
└── package.json # 依赖(不变)
|
||||
```
|
||||
|
||||
|
||||
*表 2-1:Sprint 2 新增/修改文件说明*
|
||||
|
||||
|文件/目录|类型|功能说明|
|
||||
|---|---|---|
|
||||
|`src/controllers/promptsController.js`|新增|处理 `prompts/list` 和 `prompts/get` 请求,调用 `promptService` 获取模板|
|
||||
|`src/services/intentService.js`|新增|实现 `generate_search_queries` 工具的核心逻辑:基于规则或小模型将自然语言拆解为检索词|
|
||||
|`src/models/frameworks/`|新增|存放各思维框架的 JSON 定义,包含名称、描述、模板内容、参数占位符等|
|
||||
|`src/services/promptService.js`|修改|从静态文件加载框架库,提供 `listFrameworks()` 和 `getFramework(name, params)` 方法|
|
||||
|`src/controllers/toolsController.js`|修改|增加对 `generate_search_queries` 的路由分发|
|
||||
|`src/models/schemas.js`|修改|增加 `generate_search_queries` 的输入参数校验(如 `query` 字符串)|
|
||||
|
||||
### 3.2 系统模块架构图
|
||||
|
||||
*图 2-2:Sprint 2 组件架构与数据流*
|
||||
|
||||

|
||||
|
||||
Sprint 2 系统组件架构在 Sprint 1 的基础上,将提示词策略 Server(S2)从单一工具升级为多维思维框架引擎。核心组件包括:
|
||||
|
||||
- 控制器层:新增 promptsController.js 专门处理 MCP Prompts 原语(prompts/list 和 prompts/get),toolsController.js 扩展支持 generate_search_queries 工具调用。
|
||||
|
||||
- 服务层:promptService.js 升级为多框架管理器,从 models/frameworks/ 目录加载 JSON 定义的思维模板(5W3H、SCQA、SWOT、PESTLE 等);新增 intentService.js 实现意图拆解逻辑,将自然语言查询转化为专业检索词。
|
||||
|
||||
- 模型层:schemas.js 增加 Prompts 参数和意图拆解工具的 Zod 校验;frameworks/ 目录以 JSON 形式存放各框架的元数据、模板内容和角色定义。
|
||||
|
||||
- 主入口:app.js 同时注册 Prompts 和 Tools 能力,通过 stdio 与客户端通信。
|
||||
|
||||
该架构的核心数据链路分为四步:客户端通过 prompts/get 获取匹配的思维框架模板;服务端返回结构化提示词;大模型在推理中可调用 generate_search_queries 获取检索词;最终通过模板内嵌的系统消息(含角色矩阵和 Few-Shot 示例)约束输出格式,生成符合规范的深度报告。这一设计为后续文献检索(Sprint 3)和递归深度研究奠定了坚实的“大脑”基础。
|
||||
|
||||
---
|
||||
|
||||
## 4. MCP 标准通信接口设计
|
||||
|
||||
### 4.1 Prompts 原语
|
||||
|
||||
**`prompts/list` 响应示例**
|
||||
向客户端声明可用的思维框架列表:
|
||||
|
||||
```json
|
||||
{
|
||||
"prompts": [
|
||||
{
|
||||
"name": "5w3h",
|
||||
"description": "5W3H 分析法:从 What、Why、Who、When、Where、How、How much、How feel 八个维度拆解问题",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "topic",
|
||||
"description": "需要分析的主题",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "scqa",
|
||||
"description": "SCQA 架构:Situation、Complication、Question、Answer,适用于问题分析与方案构建",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "situation",
|
||||
"description": "背景描述",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "swot",
|
||||
"description": "SWOT 分析:Strengths、Weaknesses、Opportunities、Threats",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "entity",
|
||||
"description": "分析对象(企业、项目等)",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "pestle",
|
||||
"description": "PESTLE 宏观环境分析:Political、Economic、Social、Technological、Legal、Environmental",
|
||||
"arguments": [
|
||||
{
|
||||
"name": "domain",
|
||||
"description": "行业或领域",
|
||||
"required": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
**`prompts/get` 请求与响应示例**
|
||||
客户端请求 `scqa` 框架,并提供参数:
|
||||
|
||||
```json
|
||||
// 请求
|
||||
{
|
||||
"name": "scqa",
|
||||
"arguments": {
|
||||
"situation": "新能源汽车行业竞争日益激烈"
|
||||
}
|
||||
}
|
||||
// 响应
|
||||
{
|
||||
"description": "SCQA 分析框架",
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": {
|
||||
"type": "text",
|
||||
"text": "请使用 SCQA 架构分析以下情境:\n情境 (Situation):新能源汽车行业竞争日益激烈。\n\n请依次构建:\n1. 复杂化 (Complication):指出情境中存在的矛盾或挑战。\n2. 问题 (Question):基于复杂化提炼出核心问题。\n3. 答案 (Answer):提出解决问题的初步方案或分析路径。\n\n输出格式要求:使用 Markdown 标题分节,每个部分至少 200 字。"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 4.2 新增 Tool:`generate_search_queries`
|
||||
|
||||
**工具声明 (`tools/list` 追加)**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "generate_search_queries",
|
||||
"description": "将用户的自然语言查询拆解为 3-5 个专业的学术检索词,用于后续文献检索",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"query": {
|
||||
"type": "string",
|
||||
"description": "用户的原始查询语句,例如:新能源汽车电池回收技术难点"
|
||||
}
|
||||
},
|
||||
"required": ["query"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**工具调用响应 (`tools/call`)**
|
||||
|
||||
```json
|
||||
// 请求参数
|
||||
{
|
||||
"query": "新能源汽车电池回收技术难点"
|
||||
}
|
||||
// 响应
|
||||
{
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "[\"动力电池梯次利用技术\", \"废旧锂离子电池回收工艺\", \"电池拆解自动化\", \"有价金属提取效率\", \"环保法规与回收成本\"]"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 4.3 角色矩阵与输出规范(内置于 Prompt 模板)
|
||||
|
||||
在每个思维框架的模板中,通过系统消息(System Prompt)注入角色定义和输出格式要求。例如在 SWOT 模板中:
|
||||
|
||||
```json
|
||||
{
|
||||
"role": "system",
|
||||
"content": {
|
||||
"type": "text",
|
||||
"text": "你是一位资深的战略分析顾问,擅长使用 SWOT 框架进行竞争态势分析。请严格按照以下结构输出 Markdown 报告:\n# SWOT 分析报告:{entity}\n## 1. 优势 (Strengths)\n- 内部积极因素...\n## 2. 劣势 (Weaknesses)\n- 内部消极因素...\n## 3. 机会 (Opportunities)\n- 外部积极因素...\n## 4. 威胁 (Threats)\n- 外部消极因素...\n\n每个要点必须附上简要论证,报告总字数不低于 800 字。"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. 总结
|
||||
|
||||
Sprint 2 通过接入 MCP `Prompts` 原语,扩展了系统的多维思维框架,为大模型提供了结构化的推理模板。通过拆解用户意图,系统能够更高效地生成标准化的响应内容,推动开源协作流程的自动化与优化。随着 Sprint 2 的完成,系统将在后续迭代中逐步完善与扩展,推动开源项目管理和协作效率的提升。
|
||||
|
||||
---
|
||||
|
||||
## 许可声明
|
||||
|
||||
本文档采用 **知识共享署名--相同方式共享 4.0 国际许可协议 (CC BY--SA 4.0)** 进行许可,© 2025-2026 Gitconomy Research.
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
@@ -0,0 +1,117 @@
|
||||
<!--
|
||||
---
|
||||
title: "Project Caffeine - Arabica Sprint1 QuickStart"
|
||||
description: "Project Caffeine Arabica Sprint1 的快速启动指南,涵盖基于 MCP stdio 架构的零网络开销部署、Obsidian 本地知识库接入、5 Whys 策略引擎配置及 Cherry Studio 客户端联调全流程。"
|
||||
version: "1.0.0"
|
||||
author: "Gitconomy Research郭晧"
|
||||
date: "2026-03-01"
|
||||
type: "README / QuickStart"
|
||||
tags:
|
||||
- Project Caffeine
|
||||
- MCP
|
||||
- stdio
|
||||
- Obsidian
|
||||
- QuickStart
|
||||
- Cherry Studio
|
||||
license: "CC BY-SA 4.0"
|
||||
---
|
||||
-->
|
||||
# Project Caffeine - Arabica Sprint1 QuickStart
|
||||
|
||||
## 1. Sprint1 `0.1.0` 版本核心特性
|
||||
|
||||
- **零网络开销通信**:作为本地集成版本,本系统采用 `stdio` 传输协议,利用同一台机器上本地进程间的 stdin 和 stdout 管道进行直接通信,实现零网络传输开销。
|
||||
|
||||
- **本地知识图谱接入**:无缝对接 Obsidia个人知识管理软件,让大模型能够直接读取你的本地知识库。
|
||||
|
||||
- **内置 5 Whys 策略引擎**:引入经典的“5 Whys”思维框架挂载,强制约束大模型的思考路径,辅助其将模糊想法拆解为高精度的追问。
|
||||
|
||||
- **沙箱隔离级安全防御**:默认将 AI 生成的指令视为不可信负载,通过底层机制阻断越权访问和路径遍历漏洞,确保本地文件系统的绝对安全。
|
||||
|
||||
---
|
||||
## 2. 克隆仓库与获取分支代码
|
||||
|
||||
**📌 重要说明**:Sprint 的迭代代码不会直接合并到`master` 分支。为了获取 Sprint1 的完整代码,你需要在克隆时指定对应的特性分支 (`feature/arabica-sprint-1`):
|
||||
|
||||
```bash
|
||||
# 直接克隆指定的 feature 分支
|
||||
git clone -b feature-arabica-sprint-1 https://gitlink.org.cn/Gitconomy/Project-Caffeine.git
|
||||
|
||||
# 进入 Sprint1 的独立工作目录
|
||||
cd Project-Caffeine/projects/arabica/sprint1
|
||||
|
||||
# 安装 Node.js 项目依赖
|
||||
npm install
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 3. 环境与路径配置
|
||||
|
||||
为了让系统准确挂载你的知识库,请打开 `src/services/resourceService.ts`,将 `OBSIDIAN_VAULT_PATH` 变量修改为你本机实际的 Markdown 文件夹绝对路径。
|
||||
|
||||
## 4. 编译与工作流说明
|
||||
|
||||
项目采用 TypeScript 开发,底层依靠 Node.js 运行,因此必须先将 `.ts` 源码编译为 `.js` 文件。Sprint1的项目目录已经包含编译过的 `.js` 文件(/dist目录),可以直接快速测试运行。
|
||||
|
||||
**⚠️ 极其重要的运行说明 (必读):**
|
||||
|
||||
基于 MCP 的 `stdio` 架构特性,本程序**不需要**你手动启动独立的后台服务。请根据你的使用场景选择工作流:
|
||||
|
||||
- **🟢 日常使用 (生产模式)**
|
||||
|
||||
你**不需要**在终端里输入 `npm run start`。只要确保 `dist/app.js` 文件存在,当你在 Cherry Studio 或 Claude Desktop 等客户端中配置好绝对路径并打开开关时,客户端会在系统后台自动唤起并接管这个 Node 进程。
|
||||
|
||||
- **🛠️ 开发与调试 (实时监听模式)**
|
||||
|
||||
如果你正在修改源码,并希望配合 VS Code 进行断点联调,请在终端中保持运行以下命令:
|
||||
|
||||
_(此命令会在后台实时监控代码改动。当你按 `Ctrl+S` 保存代码后,只需在 Cherry Studio 中将 Server 开关关闭再打开,即可瞬间应用最新的代码逻辑!)_
|
||||
|
||||
---
|
||||
|
||||
## 5. Sprint1 暴露的工具 (Tools)
|
||||
|
||||
本服务端向支持 MCP 的 LLM 暴露了以下 3 个核心工具,赋予其检索本地数据与优化提示词的主动权:
|
||||
|
||||
- **`list_local_notes`**: 扫描本地知识库目录,返回所有 `.md` 格式的文献与笔记列表,帮助大模型确立探索边界。
|
||||
- **`read_local_note`**: 深度读取指定 Markdown 文件的原文,将本地知识库的物理边界转化为大模型内存中的上下文。
|
||||
- **`generate_5_whys`**: 针对用户宽泛的研究主题,强制模型连续追问五次“为什么”,层层递进剥离问题的表象,寻找最底层的学术痛点。
|
||||
|
||||
|
||||
## 6. Sprint1 暴露的资源 (Resources)
|
||||
|
||||
资源(Resources)作为被动的静态上下文信息数据源,供客户端 UI 直接发现与提取:
|
||||
|
||||
- **`obsidian-index`** (`obsidian://vault/index`): 向客户端暴露本地知识库的完整目录索引数据。
|
||||
|
||||
---
|
||||
|
||||
## 7. 客户端接入联调 (以 Cherry Studio 为例)
|
||||
|
||||
Sprint1 采用纯本地 `stdio` 架构,推荐使用 VS Code 配合客户端进行源码级联调:
|
||||
|
||||
1. 打开 Cherry Studio,进入 **设置 -> MCP**。
|
||||
|
||||
2. 添加一个新的 Server 配置:
|
||||
|
||||
- **名称**: `ProjectCaffeine-Sprint1`
|
||||
- **Command**: `node`
|
||||
- **Args**: `["--inspect=9229", "/你的实际克隆路径/Project-Caffeine/projects/arabica/sprint1/dist/app.js"]` _(⚠️ 必须为编译后的 js 文件绝对路径,且 `--inspect` 需放在首位以开启调试)_
|
||||
|
||||
3. 保存后确认状态灯变为绿色。
|
||||
|
||||
4. 返回 VS Code,在侧边栏“运行和调试”中执行附加 (Attach),即可对大模型发起的每一次工具调用进行完美断点拦截。
|
||||
|
||||
---
|
||||
|
||||
## 8. Sprint1 文档
|
||||
|
||||
- Sprint1 [设计文档](./docs/arabica-sprint1-architecture-specification.md)
|
||||
- Sprint1 [开发文档](./docs/arabica-sprint1-development-specification.md)
|
||||
|
||||
---
|
||||
|
||||
## 许可声明
|
||||
|
||||
本文档采用 **知识共享署名--相同方式共享 4.0 国际许可协议 (CC BY--SA 4.0)** 进行许可,© 2025-2026 Gitconomy Research.
|
||||
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Generated
Vendored
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user