Files
AIclinicalresearch/docs/03-业务模块/AIA-AI智能问答/04-开发计划/01-AIA-V2.1开发计划.md
HaHafeng 1b53ab9d52 feat(aia): Complete AIA V2.0 with universal streaming capabilities
Major Changes:
- Add StreamingService with OpenAI Compatible format
- Upgrade Chat component V2 with Ant Design X integration
- Implement AIA module with 12 intelligent agents
- Update API routes to unified /api/v1 prefix
- Update system documentation

Backend (~1300 lines):
- common/streaming: OpenAI Compatible adapter
- modules/aia: 12 agents, conversation service, streaming integration
- Update route versions (RVW, PKB to v1)

Frontend (~3500 lines):
- modules/aia: AgentHub + ChatWorkspace (100% prototype restoration)
- shared/Chat: AIStreamChat, ThinkingBlock, useAIStream Hook
- Update API endpoints to v1

Documentation:
- AIA module status guide
- Universal capabilities catalog
- System overview updates
- All module documentation sync

Tested: Stream response verified, authentication working
Status: AIA V2.0 core completed (85%)
2026-01-14 19:15:01 +08:00

544 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AIA 妯″潡 V2.1 寮€鍙戣<E98D99>鍒?
> **鐗堟湰**锛歏2.1
> **鍒涘缓鏃ユ湡**锛?026-01-11
> **璁″垝鍛ㄦ湡**锛氱害 8-11 澶?
> **绛栫暐**锛氶噸鍐欏悗绔?+ 澶嶇敤鏁版嵁搴?+ 鏂板紑鍙戝墠绔?
> **鍏宠仈PRD**锛歚01-闇€姹傚垎鏋?AIA妯″潡PRD.md`
> **鍏宠仈鍘熷瀷**锛歚01-闇€姹傚垎鏋?AI鏅鸿兘闂<E58598>瓟V2.html`
---
## 馃搵 寮€鍙戠瓥鐣ユ<E990A3>杩?
### 鏍稿績鍐崇瓥
| 缁勪欢 | 绛栫暐 | 鐞嗙敱 |
|------|------|------|
| **鍚庣<E98D9A>** | 馃敶 **閲嶅啓** | 鏃х増涓嶇<E6B693>鍚堜簯鍘熺敓瑙勮寖锛坈onsole.log銆佹湭浣跨敤骞冲彴鑳藉姏锛?|
| **鏁版嵁搴?* | 鉁?**澶嶇敤** | aia_schema 宸插畬鍠勶紝瀛楁<E7809B>婊¤冻闇€姹?|
| **鍓嶇<E98D93>** | 馃敶 **鏂板紑鍙?* | 澶嶇敤 shared/components/Chat 閫氱敤缁勪欢锛屽叏鏂癠I |
### 鎶€鏈<E282AC><E98F88>鑼?
| 瑙勮寖 | 瑕佹眰 |
|------|------|
| **鏃ュ織** | 浣跨敤 `logger` from `@/common/logging`锛堢<EFBFBD>姝?console.log锛?|
| **瀛樺偍** | 浣跨敤 `storage` from `@/common/storage` |
| **缂撳瓨** | 浣跨敤 `cache` from `@/common/cache` |
| **闃熷垪** | 浣跨敤 `jobQueue` from `@/common/jobs` |
| **Prompt** | 浣跨敤 `promptService.get()` from `@/common/prompts` |
| **浠g爜浣嶇疆** | `backend/src/modules/aia/` |
| **API璺<49>** | `/api/v1/aia/*` |
---
## 馃搳 鏁版嵁搴撶姸鎬侊紙鉁?宸插畬鎴愶級
### 琛ㄧ粨鏋勶紙3涓<33>〃锛?
```
aia_schema.projects 鉁?淇濈暀
aia_schema.conversations 鉁?淇濈暀
aia_schema.messages 鉁?淇濈暀 + 鏂板<E98F82>瀛楁<E7809B>
```
### 鏂板<E98F82>瀛楁<E7809B>锛?026-01-11 宸茶縼绉伙級
| 琛?| 瀛楁<E7809B> | 绫诲瀷 | 璇存槑 |
|----|------|------|------|
| messages | `thinking_content` | TEXT | 娣卞害鎬濊€冨唴瀹?`<think>...</think>` |
| messages | `attachments` | JSONB | 闄勪欢鏁扮粍锛堜笂闄?涓<>紝鍗曚釜鈮?0MB锛屾枃鏈<E69E83>墹30K tokens锛?|
### 宸插垹闄よ〃
| 琛?| 鍘熷洜 |
|----|------|
| `general_conversations` | 鍔熻兘閲嶅彔锛屼娇鐢?conversations.project_id = NULL |
| `general_messages` | 鍔熻兘閲嶅彔 |
---
## 馃棑锔?寮€鍙戦樁娈?
### Phase 1: 鍚庣<E98D9A>閲嶅啓锛?-4澶╋級
#### Day 1: 妯″潡楠ㄦ灦 + 鏍稿績鏈嶅姟
**鐩<>爣**锛氭惌寤烘ā鍧楃粨鏋勶紝杩佺Щ鏍稿績瀵硅瘽鏈嶅姟
**浠诲姟娓呭崟**锛?
- [ ] **1.1 鍒涘缓妯″潡鐩<E6BDA1>綍缁撴瀯**
```
backend/src/modules/aia/
鈹溾攢鈹€ controllers/
鈹? 鈹溾攢鈹€ conversationController.ts
鈹? 鈹溾攢鈹€ agentController.ts
鈹? 鈹斺攢鈹€ projectController.ts
鈹溾攢鈹€ services/
鈹? 鈹溾攢鈹€ conversationService.ts
鈹? 鈹溾攢鈹€ agentService.ts
鈹? 鈹斺攢鈹€ projectService.ts
鈹溾攢鈹€ routes/
鈹? 鈹斺攢鈹€ index.ts
鈹溾攢鈹€ types/
鈹? 鈹斺攢鈹€ index.ts
鈹斺攢鈹€ index.ts
```
- [ ] **1.2 閲嶅啓 conversationService**
- 浠?legacy 澶嶅埗鏍稿績閫昏緫
- 鏇挎崲 `console.log` 鈫?`logger`
- 浣跨敤 `prisma.message`锛堝凡鍦?aia_schema锛?
- 娣诲姞 `thinkingContent` 澶勭悊閫昏緫
- 淇濇寔娴佸紡杈撳嚭鑳藉姏
- [ ] **1.3 閲嶅啓 agentService**
- 鏀圭敤 `promptService.get()` 鑾峰彇 Prompt
- 缂撳瓨鏅鸿兘浣撻厤缃<E58EA4>紙浣跨敤 `cache`锛?
- [ ] **1.4 娉ㄥ唽 v2 璺<>敱**
- 娉ㄥ唽鍒?`/api/v1/aia/*`
- 淇濇寔 legacy 璺<>敱鍏煎<E98D8F>锛堥€愭<E282AC>杩佺Щ锛?
**楠屾敹鏍囧噯**锛?
- [ ] 鍩虹<E98DA9>瀵硅瘽鍔熻兘鍙<E58598>
- [ ] 娴佸紡杈撳嚭姝e父
- [ ] 鏃ュ織杈撳嚭鍒?logger
---
#### Day 2: 娣卞害鎬濊€?+ 闄勪欢涓婁紶
**鐩<>爣**锛氬疄鐜?V2.1 鏂板<E98F82>鍔熻兘
**浠诲姟娓呭崟**锛?
- [ ] **2.1 娣卞害鎬濊€冩ā寮?*
- 妫€娴?LLM 杈撳嚭涓<E59AAD>殑 `<think>...</think>` 鏍囩<E98F8D>
- 鎻愬彇骞跺瓨鍌ㄥ埌 `messages.thinking_content`
- 浠?`content` 涓<>Щ闄?think 鏍囩<E98F8D>
- 娴佸紡杈撳嚭鏃跺垎绂?thinking 鍜?content
- [ ] **2.2 闄勪欢涓婁紶鏈嶅姟**
- 浣跨敤 `storage.upload()` 涓婁紶鍒?OSS
- 璋冪敤 Python 寰<>湇鍔℃彁鍙栨枃鏈?
- Token 璁℃暟锛堜娇鐢?tiktoken锛?
- 鎴<>柇澶勭悊锛堣秴杩?30K tokens锛?
- 瀛樺偍闄勪欢淇℃伅鍒?`messages.attachments`
- [ ] **2.3 闄勪欢娉ㄥ叆 LLM 涓婁笅鏂?*
- 缁勮<E7BC81>闄勪欢鏂囨湰鍒?User Prompt
- 鎺у埗鎬?Token 闀垮害
**鎶€鏈<E282AC><E98F88>鏍?*锛?
```typescript
// 闄勪欢澶勭悊閰嶇疆
const ATTACHMENT_CONFIG = {
maxCount: 5, // 姣忔潯娑堟伅鏈€澶?涓<>檮浠?
maxSizePerFile: 20 * 1024 * 1024, // 鍗曚釜鏂囦欢20MB
maxTokens: 30000, // 鎻愬彇鏂囨湰鏈€澶?0K tokens
supportedTypes: ['pdf', 'docx', 'txt', 'xlsx'],
};
```
**楠屾敹鏍囧噯**锛?
- [ ] 娣卞害鎬濊€冨唴瀹规<E780B9><EFBFBD>垎绂诲瓨鍌?
- [ ] 闄勪欢涓婁紶鎴愬姛
- [ ] 闄勪欢鏂囨湰姝g‘娉ㄥ叆 LLM
---
#### Day 3: 鎰忓浘璺<E6B598>敱 + 鐭ヨ瘑搴撻泦鎴?
**鐩<>爣**锛氬疄鐜板叏灞€鎰忓浘璺<E6B598>敱锛屽畬鍠勭煡璇嗗簱寮曠敤
**浠诲姟娓呭崟**锛?
- [ ] **3.1 鎰忓浘璺<E6B598>敱鏈嶅姟**
- 鏂板缓 `intentRouterService.ts`
- 璋冪敤 Router Agent 璇嗗埆鎰忓浘
- 杩斿洖鐩<E6B496>爣 Agent ID + 棰勫~ Prompt
- 娣诲姞 500ms 闃叉姈锛堝墠绔<E5A2A0>疄鐜帮級
- [ ] **3.2 瀹屽杽鐭ヨ瘑搴撻泦鎴?*
- 澶嶇敤 PKB 妯″潡鐨?RAG 妫€绱?
- 鏅鸿兘寮曠敤绯荤粺锛圼鏉ユ簮N]锛?
- 寮曠敤娓呭崟鏍煎紡鍖?
- [ ] **3.3 API 绔<>偣瀹屽杽**
```
POST /api/v1/aia/intent/route # 鎰忓浘璺<E6B598>
POST /api/v1/aia/conversations # 鍒涘缓瀵硅瘽
GET /api/v1/aia/conversations # 瀵硅瘽鍒楄〃
GET /api/v1/aia/conversations/:id # 瀵硅瘽璇︽儏
POST /api/v1/aia/conversations/:id/messages/stream # 鍙戦€佹秷鎭<E7A7B7>紙娴佸紡锛?
POST /api/v1/aia/conversations/:id/attachments # 涓婁紶闄勪欢
GET /api/v1/aia/agents # 鏅鸿兘浣撳垪琛?
GET /api/v1/aia/agents/:id # 鏅鸿兘浣撹<E6B5A3>鎯?
```
**楠屾敹鏍囧噯**锛?
- [ ] 鎰忓浘璺<E6B598>敱姝璇嗗埆骞惰烦杞?
- [ ] 鐭ヨ瘑搴撳紩鐢ㄦ<E990A2><EFBFBD>樉绀?
- [ ] 鎵€鏈?API 绔<>偣鍙<E581A3>
---
#### Day 4: 娴嬭瘯 + 鏂囨。
**鐩<>爣**锛氬畬鎴愬悗绔<E68297>祴璇曞拰鏂囨。
**浠诲姟娓呭崟**锛?
- [ ] **4.1 鍗曞厓娴嬭瘯**
- conversationService 娴嬭瘯
- 娣卞害鎬濊€冭В鏋愭祴璇?
- 闄勪欢澶勭悊娴嬭瘯
- [ ] **4.2 闆嗘垚娴嬭瘯**
- 瀹屾暣瀵硅瘽娴佺▼
- 闄勪欢涓婁紶娴佺▼
- 鐭ヨ瘑搴撴<E690B4>绱㈡祦绋?
- [ ] **4.3 API 鏂囨。**
- 鏇存柊 REST Client 娴嬭瘯鏂囦欢
- 缂栧啓 API 浣跨敤绀轰緥
**楠屾敹鏍囧噯**锛?
- [ ] 娴嬭瘯瑕嗙洊鏍稿績鍔熻兘
- [ ] API 鏂囨。瀹屾暣
---
### Phase 2: 鍓嶇<E98D93>寮€鍙戯紙5-7澶╋級
#### Day 5-6: 鏅鸿兘浣撳ぇ鍘咃紙Dashboard锛?
**鐩<>爣**锛氬疄鐜伴<E9909C>椤垫櫤鑳戒綋澶у
**浠诲姟娓呭崟**锛?
- [ ] **5.1 鍒涘缓妯″潡鐩<E6BDA1>綍缁撴瀯**
```
frontend-v2/src/modules/aia/
鈹溾攢鈹€ pages/
鈹? 鈹溾攢鈹€ Dashboard.tsx # 鏅鸿兘浣撳ぇ鍘?
鈹? 鈹斺攢鈹€ Workspace.tsx # 瀵硅瘽宸ヤ綔鍙?
鈹溾攢鈹€ components/
鈹? 鈹溾攢鈹€ AgentPipeline.tsx # 5闃舵<E99783>娴佹按绾?
鈹? 鈹溾攢鈹€ AgentCard.tsx # 鏅鸿兘浣撳崱鐗?
鈹? 鈹溾攢鈹€ IntentSearch.tsx # 鎰忓浘鎼滅储妗?
鈹? 鈹溾攢鈹€ ConversationList.tsx # 鍘嗗彶浼氳瘽鍒楄〃
鈹? 鈹溾攢鈹€ ThinkingBlock.tsx # 娣卞害鎬濊€冩姌鍙犲潡
鈹? 鈹溾攢鈹€ AttachmentUpload.tsx # 闄勪欢涓婁紶
鈹? 鈹溾攢鈹€ AttachmentCard.tsx # 闄勪欢鍗$墖
鈹? 鈹斺攢鈹€ SlashCommands.tsx # 蹇<>嵎鎸囦护
鈹溾攢鈹€ hooks/
鈹? 鈹溾攢鈹€ useConversation.ts
鈹? 鈹溾攢鈹€ useAgents.ts
鈹? 鈹斺攢鈹€ useIntentRouter.ts
鈹溾攢鈹€ api/
鈹? 鈹斺攢鈹€ index.ts
鈹溾攢鈹€ types/
鈹? 鈹斺攢鈹€ index.ts
鈹斺攢鈹€ index.tsx
```
- [ ] **5.2 鏅鸿兘浣撴祦姘寸嚎锛圓gentPipeline锛?*
- 5闃舵<E99783>甯冨眬锛堜弗鏍艰繕鍘?V11 鍘熷瀷锛?
- 3鑹茶<E991B9>瑙変綋绯?
- 鍗$墖鐐瑰嚮璺宠浆 Workspace
- 宸ュ叿鍗墖璺宠浆澶栭儴妯″潡锛圖C/ST锛?
- [ ] **5.3 鎰忓浘鎼滅储妗嗭紙IntentSearch锛?*
- 椤堕儴澶ф悳绱㈡<E7BBB1>
- 500ms 闃叉姈
- 璋冪敤鎰忓浘璺<E6B598>敱 API
- 鑷<>姩璺宠浆鐩<E6B586>爣 Agent
**楠屾敹鏍囧噯**锛?
- [ ] 5闃舵<E99783>娴佹按绾挎<E7BBBE><EFBFBD>睍绀?
- [ ] 鎰忓浘鎼滅储鍔熻兘鍙<E58598>
- [ ] 涓庡師鍨嬪浘涓€鑷?
---
#### Day 7-8: 瀵硅瘽宸ヤ綔鍙帮紙Workspace锛?
**鐩<>爣**锛氬疄鐜版矇娴稿紡瀵硅瘽鐣岄潰
**浠诲姟娓呭崟**锛?
- [ ] **7.1 宸ヤ綔鍙板竷灞€**
- Gemini 椋庢牸锛堝ぇ鐣欑櫧銆佸皯鍒嗗壊绾匡級
- 宸︿晶渚ц竟鏍忥紙鍘嗗彶浼氳瘽锛屽彲鎶樺彔锛?
- 涓诲<E6B693>璇濆尯锛圚eader + 娑堟伅鍒楄〃 + 杈撳叆妗嗭級
- [ ] **7.2 澶嶇敤 Chat 閫氱敤缁勪欢**
```tsx
import { ChatContainer } from '@/shared/components/Chat';
<ChatContainer
providerConfig={{
apiEndpoint: '/api/v1/aia/conversations/:id/messages/stream',
requestFn: sendMessageWithStream,
}}
customMessageRenderer={renderAIAMessage}
/>
```
- [ ] **7.3 娣卞害鎬濊€冩姌鍙犲潡锛圱hinkingBlock锛?*
- 鍙<>姌鍙犵伆鑹插紩鐢ㄥ潡
- 鐢熸垚涓<E59E9A>睍寮€锛屽畬鎴愬悗鑷<E68297>姩鏀惰捣
- 鏄剧ず"宸叉繁搴︽€濊€?(鑰楁椂 Xs)"
- [ ] **7.4 闄勪欢涓婁紶缁勪欢**
- 鏀<>寔鎷栨嫿涓婁紶
- 鏂囦欢绫诲瀷/澶у皬鏍¢獙
- 涓婁紶杩涘害鏄剧ず
- 娑堟伅姘旀场涓嬫柟闄勪欢鍗$墖
- [ ] **7.5 鍘嗗彶浼氳瘽鍒楄〃**
- 鎸夋椂闂村垎缁勶紙浠婂ぉ銆佹槰澶┿€?澶╁墠锛?
- 妗岄潰绔<E6BDB0>浐瀹氭樉绀?
- 绉诲姩绔<E5A7A9>娊灞夋粦鍑?
**楠屾敹鏍囧噯**锛?
- [ ] Gemini 椋庢牸 UI
- [ ] 娣卞害鎬濊€冩<E282AC><EFBFBD>睍绀?
- [ ] 闄勪欢涓婁紶瀹屾暣娴佺▼
- [ ] 鍘嗗彶浼氳瘽鍒囨崲
---
#### Day 9: Markdown 澧炲己 + 蹇<>嵎鎸囦护
**鐩<>爣**锛氬<E9949B>寮哄<E5AFAE>璇濅綋楠?
**浠诲姟娓呭崟**锛?
- [ ] **9.1 Markdown 娓叉煋澧炲己**
- KaTeX 鍏<>紡娓叉煋锛堝尰瀛﹀叕寮忥級
- 琛ㄦ牸妯<E789B8>悜婊氬姩
- 浠爜鍧楄<E98DA7>娉曢珮浜?+ 涓€閿<E282AC><E996BF>鍒?
- [ ] **9.2 蹇<>嵎鎸囦护锛圫lashCommands锛?*
- 杈撳叆 `/` 寮瑰嚭鑿滃崟
- 鏀<>寔锛?娑﹁壊, /鎵╁啓, /缈昏瘧, /瀵煎嚭Word
- 閿<>洏瀵艰埅
- [ ] **9.3 缁撴灉鎿嶄綔鏍?*
- Hover 鏄剧ず宸ュ叿鏍?
- 澶嶅埗锛圡arkdown 婧愮爜锛?
- 閲嶆柊鐢熸垚
- 瀵煎嚭 Word锛堣皟鐢?RVW 瀵煎嚭鏈嶅姟锛?
**楠屾敹鏍囧噯**锛?
- [ ] 鍏<>紡姝娓叉煋
- [ ] 蹇<>嵎鎸囦护鍙<E68AA4>
- [ ] 鎿嶄綔鏍忓姛鑳藉畬鏁?
---
#### Day 10: 绉诲姩绔<E5A7A9>€傞厤
**鐩<>爣**锛氬搷搴斿紡甯冨眬閫傞厤
**浠诲姟娓呭崟**锛?
- [ ] **10.1 Dashboard 绉诲姩绔?*
- 闅愯棌澶嶆潅瀵艰埅
- 鍗$墖鍗曞垪娴佸紡甯冨眬
- 鏃堕棿杞存牱寮忚皟鏁?
- [ ] **10.2 Workspace 绉诲姩绔?*
- 渚ц竟鏍忔敼涓烘娊灞?
- 杈撳叆妗嗛敭鐩橀€傞厤锛坰crollIntoView锛?
- 鍙戦€佹寜閽<E5AF9C><E996BD>缁堝彲瑙?
- [ ] **10.3 瑙︽帶浼樺寲**
- 鎸夐挳 active 鎬?
- 瑙︽帶鍖哄煙浼樺寲
**楠屾敹鏍囧噯**锛?
- [ ] md (768px) 鏂<>偣鍝嶅簲姝
- [ ] 绉诲姩绔<E5A7A9>氦浜掓祦鐣?
---
#### Day 11: 闆嗘垚娴嬭瘯 + 浼樺寲
**鐩<>爣**锛氬畬鎴愭暣浣撴祴璇曞拰浼樺寲
**浠诲姟娓呭崟**锛?
- [ ] **11.1 绔<>埌绔<E59F8C>祴璇?*
- 瀹屾暣瀵硅瘽娴佺▼
- 闄勪欢涓婁紶娴佺▼
- 娣卞害鎬濊€冩祦绋?
- 鐭ヨ瘑搴撳紩鐢ㄦ祦绋?
- [ ] **11.2 鎬ц兘浼樺寲**
- TTFB < 1.5s
- 绉诲姩绔?LCP < 1s
- 鎰忓浘鎼滅储闃叉姈
- [ ] **11.3 Bug 淇<><E6B787>**
- [ ] **11.4 鏂囨。鏇存柊**
- 鏇存柊妯″潡鐘舵€佹枃妗?
- 鏇存柊绯荤粺褰撳墠鐘舵€?
**楠屾敹鏍囧噯**锛?
- [ ] 鎵€鏈夊姛鑳芥<E991B3>甯?
- [ ] 鎬ц兘杈炬爣
- [ ] 鏂囨。瀹屾暣
---
## 馃搧 鏂囦欢娓呭崟
### 鍚庣<E98D9A>鏂板<E98F82>鏂囦欢
```
backend/src/modules/aia/
鈹溾攢鈹€ controllers/
鈹? 鈹溾攢鈹€ conversationController.ts # ~300琛?
鈹? 鈹溾攢鈹€ agentController.ts # ~150琛?
鈹? 鈹斺攢鈹€ projectController.ts # ~200琛?
鈹溾攢鈹€ services/
鈹? 鈹溾攢鈹€ conversationService.ts # ~500琛岋紙鏍稿績锛?
鈹? 鈹溾攢鈹€ agentService.ts # ~200琛?
鈹? 鈹溾攢鈹€ projectService.ts # ~150琛?
鈹? 鈹溾攢鈹€ intentRouterService.ts # ~100琛岋紙鏂帮級
鈹? 鈹斺攢鈹€ attachmentService.ts # ~200琛岋紙鏂帮級
鈹溾攢鈹€ routes/
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
鈹溾攢鈹€ types/
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
鈹斺攢鈹€ index.ts # ~20琛?
棰勮<EFBFBD>鎬昏<EFBFBD>锛殈2000琛?
```
### 鍓嶇<E98D93>鏂板<E98F82>鏂囦欢
```
frontend-v2/src/modules/aia/
鈹溾攢鈹€ pages/
鈹? 鈹溾攢鈹€ Dashboard.tsx # ~400琛?
鈹? 鈹斺攢鈹€ Workspace.tsx # ~500琛?
鈹溾攢鈹€ components/
鈹? 鈹溾攢鈹€ AgentPipeline.tsx # ~300琛?
鈹? 鈹溾攢鈹€ AgentCard.tsx # ~100琛?
鈹? 鈹溾攢鈹€ IntentSearch.tsx # ~150琛?
鈹? 鈹溾攢鈹€ ConversationList.tsx # ~200琛?
鈹? 鈹溾攢鈹€ ThinkingBlock.tsx # ~100琛?
鈹? 鈹溾攢鈹€ AttachmentUpload.tsx # ~200琛?
鈹? 鈹溾攢鈹€ AttachmentCard.tsx # ~80琛?
鈹? 鈹斺攢鈹€ SlashCommands.tsx # ~150琛?
鈹溾攢鈹€ hooks/
鈹? 鈹溾攢鈹€ useConversation.ts # ~150琛?
鈹? 鈹溾攢鈹€ useAgents.ts # ~100琛?
鈹? 鈹斺攢鈹€ useIntentRouter.ts # ~80琛?
鈹溾攢鈹€ api/
鈹? 鈹斺攢鈹€ index.ts # ~200琛?
鈹溾攢鈹€ types/
鈹? 鈹斺攢鈹€ index.ts # ~100琛?
鈹斺攢鈹€ index.tsx # ~50琛?
棰勮<EFBFBD>鎬昏<EFBFBD>锛殈2900琛?
```
---
## 馃敆 渚濊禆鍏崇郴
### 鍚庣<E98D9A>渚濊禆
| 渚濊禆 | 鏉ユ簮 | 璇存槑 |
|------|------|------|
| `logger` | `@/common/logging` | 鏃ュ織鏈嶅姟 |
| `storage` | `@/common/storage` | OSS瀛樺偍 |
| `cache` | `@/common/cache` | Redis/PG缂撳瓨 |
| `jobQueue` | `@/common/jobs` | 寮傛<E5AFAE>浠诲姟 |
| `promptService` | `@/common/prompts` | Prompt绠悊 |
| `LLMFactory` | `@/common/llm` | LLM閫傞厤鍣?|
| `prisma` | `@/config/database` | 鏁版嵁搴?|
| `ExtractionClient` | `@/clients` | 鏂囨。鎻愬彇 |
| `TokenService` | `@/services` | Token璁℃暟 |
### 鍓嶇<E98D93>渚濊禆
| 渚濊禆 | 鏉ユ簮 | 璇存槑 |
|------|------|------|
| `ChatContainer` | `@/shared/components/Chat` | 閫氱敤瀵硅瘽缁勪欢 |
| `Ant Design` | `antd` | UI缁勪欢搴?|
| `Ant Design X` | `@ant-design/x` | AI瀵硅瘽缁勪欢 |
| `KaTeX` | `katex` | 鍏<>紡娓叉煋 |
| `react-markdown` | `react-markdown` | Markdown娓叉煋 |
---
## 馃搱 椋庨櫓璇勪及
| 椋庨櫓 | 姒傜巼 | 褰卞搷 | 缂撹В<D092>柦 |
|------|------|------|---------|
| 娴佸紡杈撳嚭鍏煎<E98D8F>鎬?| 涓?| 楂?| 澶嶇敤宸查獙璇佺殑 SSE 浠g爜 |
| 闄勪欢鎻愬彇瓒呮椂 | 涓?| 涓?| 浣跨敤 jobQueue 寮傛<E5AFAE>澶勭悊 |
| 绉诲姩绔<E5A7A9>€傞厤闂<E58EA4><E99782> | 浣?| 涓?| 鎻愬墠瑙勫垝鏂<E59E9D>偣鍜屽竷灞€ |
| Prompt绠悊鏈嶅姟鏈<E5A79F>氨缁?| 浣?| 涓?| 鍙<>复鏃跺洖閫€鍒版枃浠惰<E6B5A0>鍙?|
---
## 鉁?楠屾敹鏍囧噯
### 鍔熻兘楠屾敹
- [ ] 鏅鸿兘浣撳ぇ鍘呭畬鏁村睍绀?
- [ ] 鎰忓浘鎼滅储姝<E28098>
- [ ] 澶氳疆瀵硅瘽姝e父
- [ ] 娴佸紡杈撳嚭娴佺晠
- [ ] 娣卞害鎬濊€冩<E282AC><EFBFBD>姌鍙?
- [ ] 闄勪欢涓婁紶瀹屾暣
- [ ] 鐭ヨ瘑搴撳紩鐢ㄦ<E990A2>纭?
- [ ]<>嵎鎸囦护鍙<E68AA4>
- [ ] 绉诲姩绔<E5A7A9>€傞厤姝
### 鎬ц兘楠屾敹
- [ ] TTFB < 1.5s
- [ ] 绉诲姩绔?LCP < 1s
- [ ] 鎰忓浘鎼滅储鍝嶅簲 < 500ms
### 璐ㄩ噺楠屾敹
- [ ] 鏃?console.log锛堜娇鐢?logger锛?
- [ ]爜绗﹀悎浜戝師鐢熻<E990A2>鑼?
- [ ] API 鏂囨。瀹屾暣
- [ ] 鍗曞厓娴嬭瘯瑕嗙洊鏍稿績鍔熻兘
---
## 馃摑 鏇存柊鏃ュ織
| 鏃ユ湡 | 鐗堟湰 | 鍐呭<E98D90> |
|------|------|------|
| 2026-01-11 | V1.0 | 鍒涘缓寮€鍙戣<E98D99>鍒?|
---
**璁″垝鍒跺畾浜?*锛欰I Assistant
**瀹℃牳浜?*锛氬緟瀹?
**鎵瑰噯浜?*锛氬緟瀹?