Files
AIclinicalresearch/docs/02-通用能力层/03-RAG引擎
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
..

RAG寮曟搸

*鑳藉姏瀹氫綅锛? 閫氱敤鑳藉姏灞? 澶嶇敤鐜囷細 43% (3涓<33>ā鍧椾緷璧?
浼樺厛绾э細 P1
鐘舵€侊細 鉁?宸插疄鐜帮紙鍩轰簬Dify锛?


馃搵 鑳藉姏姒傝堪

RAG寮曟搸璐熻矗锛?

  • 鍚戦噺鍖栧瓨鍌<EFBFBD>紙Embedding锛?
  • <EFBFBD>箟妫€绱<EFBFBD>紙Semantic Search锛?
  • 妫€绱㈠<EFBFBD>寮虹敓鎴愶紙RAG锛?
  • Rerank閲嶆帓搴?

馃搳 渚濊禆妯″潡

*3涓<EFBFBD>ā鍧椾緷璧栵紙43%澶嶇敤鐜囷級锛?

  1. AIA - AI鏅鸿兘闂<E58598>瓟锛園鐭ヨ瘑搴撻棶绛旓級
  2. ASL - AI鏅鸿兘鏂囩尞锛堟枃鐚<E69E83>唴瀹规<E780B9><EFBFBD>
  3. PKB - 涓<>汉鐭ヨ瘑搴擄紙RAG闂<47>瓟锛?

馃挕 鏍稿績鍔熻兘

1. 鍚戦噺鍖栧瓨鍌?

  • 鍩轰簬Dify骞冲彴
  • Qdrant鍚戦噺鏁版嵁搴擄紙Dify鍐呯疆锛?

2. 璇<>箟妫€绱?

  • Top-K妫€绱?
  • 鐩稿叧搴﹁瘎鍒?
  • 澶氱煡璇嗗簱鑱斿悎妫€绱?

3. RAG闂<47>

  • 妫€绱?+ 鐢熸垚
  • 鏅鸿兘寮曠敤绯荤粺锛?00%鍑嗙<E28098>簮锛?

馃彈锔?鎶€鏈<E282AC>灦鏋?

*鍩轰簬Dify骞冲彴锛?

// DifyClient灏佽<E7818F>
interface RAGEngine {
  // 鍒涘缓鐭ヨ瘑搴?
  createDataset(name: string): Promise<string>;
  
  // 涓婁紶鏂囨。
  uploadDocument(datasetId: string, file: File): Promise<string>;
  
  // 璇<>箟妫€绱?
  search(datasetId: string, query: string, topK?: number): Promise<SearchResult[]>;
  
  // RAG闂<47>  chatWithRAG(datasetId: string, query: string): Promise<string>;
}

馃搱 浼樺寲鎴愭灉

妫€绱㈠弬鏁颁紭鍖栵細

鎸囨爣 浼樺寲鍓? 浼樺寲鍚? 鎻愬崌
妫€绱㈡暟閲? 3 chunks 15 chunks 5鍊?
Chunk澶у 500 tokens 1500 tokens 3鍊?
鎬昏<EFBFBD>鐩? 1,500 tokens 22,500 tokens 15鍊?
瑕嗙洊鐜? ~5% ~40-50% 8-10鍊?

馃敆 鐩稿叧鏂囨。


鏈€鍚庢洿鏂帮細 2025-11-06
缁存姢浜猴細 鎶€鏈<E282AC>灦鏋勫笀