Commit Graph

9 Commits

Author SHA1 Message Date
MerCry 1000158550 fix: 修复Docker部署健康检查路径和API Key配置 [AC-AISVC-01]
- 修正docker-compose.yaml中健康检查路径从/health改为/ai/health
- 在middleware中添加/ai/health到API Key和租户检查的跳过列表
- 添加前端.env.example配置文件说明API Key配置方法
- 更新README添加API Key配置步骤说明
2026-02-26 02:41:33 +08:00
MerCry f631f1dea0 feat: 统一提示词模板并添加全量提示词日志 [AC-AISVC-02, AC-ASA-19, AC-ASA-20]
PR Check (SDD Full Gate) / sdd-full-gate (pull_request) Successful in 2s Details
- 新增 prompts.py 集中管理系统提示词和证据格式化
- orchestrator.py 添加全量提示词日志打印
- openai_client.py 添加全量提示词日志打印(支持普通和流式)
- rag.py 重构使用统一的提示词模板
2026-02-26 01:12:01 +08:00
MerCry 02f03a3a12 feat: RAG 配置优化与检索日志增强 [AC-AISVC-16, AC-AISVC-17] 2026-02-25 23:42:31 +08:00
MerCry cee884d9a0 feat: RAG 检索优化,实现多维度向量存储和 Nomic 嵌入提供者 [AC-AISVC-16, AC-AISVC-29] 2026-02-25 23:10:12 +08:00
MerCry ac8c33cf94 feat: 实现租户管理功能,支持租户ID格式校验与自动创建 [AC-AISVC-10, AC-AISVC-12, AC-ASA-01] 2026-02-25 23:08:36 +08:00
MerCry 4b64a4dbf4 feat(AISVC-T6.9): 集成Ollama嵌入模型修复RAG检索问题
## 问题修复
- 替换假嵌入(SHA256 hash)为真实Ollama nomic-embed-text嵌入
- 修复Qdrant客户端版本不兼容导致score_threshold参数失效
- 降低默认分数阈值从0.7到0.3

## 新增文件
- ai-service/app/services/embedding/ollama_embedding.py

## 修改文件
- ai-service/app/api/admin/kb.py: 索引任务使用真实嵌入
- ai-service/app/core/config.py: 新增Ollama配置,向量维度改为768
- ai-service/app/core/qdrant_client.py: 移除score_threshold参数
- ai-service/app/services/retrieval/vector_retriever.py: 使用Ollama嵌入
2026-02-24 22:15:53 +08:00
MerCry 66fa2d2677 feat(ai-service): implement confidence calculation for T3.3 [AC-AISVC-17, AC-AISVC-18, AC-AISVC-19]
- Add ConfidenceCalculator class for confidence scoring
- Implement retrieval insufficiency detection (hit count, score threshold, evidence tokens)
- Implement confidence calculation based on retrieval scores
- Implement shouldTransfer logic with configurable threshold
- Add transferReason for low confidence scenarios
- Add comprehensive unit tests (19 test cases)
- Update config with confidence-related settings
2026-02-24 13:31:42 +08:00
MerCry 550d0d8498 feat(ai-service): implement context merging for T3.2 [AC-AISVC-14, AC-AISVC-15]
- Add ContextMerger class for combining local and external history
- Implement message fingerprint computation (SHA256 hash)
- Implement deduplication: local history takes priority
- Implement token-based truncation using tiktoken
- Add comprehensive unit tests (20 test cases)
2026-02-24 13:26:37 +08:00
MerCry 0a167d69f0 feat(ai-service): implement LLM Adapter for T3.1 [AC-AISVC-02, AC-AISVC-06]
- Add LLMClient abstract base class with generate/stream_generate interfaces
- Implement OpenAIClient with httpx for OpenAI-compatible API calls
- Add retry logic with tenacity for timeout handling
- Support both non-streaming and streaming generation
- Add comprehensive unit tests for LLM Adapter
- Fix entities.py JSON column type for SQLModel compatibility
2026-02-24 13:19:38 +08:00