ai-robot-core/ai-service
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
..
app feat(AISVC-T6.9): 集成Ollama嵌入模型修复RAG检索问题 2026-02-24 22:15:53 +08:00
tests feat(ai-service): add Phase 5 integration and contract tests [AC-AISVC-10,11,17,18] 2026-02-24 13:53:55 +08:00
README.md feat(ai-service): implement LLM Adapter for T3.1 [AC-AISVC-02, AC-AISVC-06] 2026-02-24 13:19:38 +08:00
pyproject.toml feat(ai-service): implement LLM Adapter for T3.1 [AC-AISVC-02, AC-AISVC-06] 2026-02-24 13:19:38 +08:00

README.md

AI Service

Python AI Service for intelligent chat with RAG support.

Features

  • Multi-tenant isolation via X-Tenant-Id header
  • SSE streaming support via Accept: text/event-stream
  • RAG-powered responses with confidence scoring

Installation

pip install -e ".[dev]"

Running

uvicorn app.main:app --host 0.0.0.0 --port 8080

API Endpoints

  • POST /ai/chat - Generate AI reply
  • GET /ai/health - Health check