feat: RAG混合检索系统完整实现 + 启动脚本修复
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Failing after 5m4s

- 实现了稠密+稀疏混合检索,使用 Qdrant 原生 RRF 融合
- 修复了 retriever.py 的 BaseRetriever 继承和稀疏向量包装问题
- 修复了 pipeline.py 的 Optional 导入问题
- 添加了稀疏 embedder 的缓存配置
- 简化了 vector_store.py,移除不必要的逻辑
- 修复了 start.sh 的 PROJECT_DIR 硬编码和端口配置问题
- 完善了 RAG 检索的测试文件
This commit is contained in:
2026-05-04 02:54:37 +08:00
parent 54ba2d3457
commit 8af82f8f7f
9 changed files with 461 additions and 157 deletions

View File

@@ -14,7 +14,7 @@ YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 项目根目录
PROJECT_DIR="/root/projects/ailine"
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} AI Agent - 个人生活助手${NC}"
@@ -34,7 +34,7 @@ start_backend() {
set +a
export PYTHONPATH="$PROJECT_DIR/backend"
export BACKEND_PORT=10079
export BACKEND_PORT=8079
python -m app.backend &
BACKEND_PID=$!
echo -e "${GREEN}✓ 后端服务已启动 (PID: $BACKEND_PID)${NC}"
@@ -51,7 +51,7 @@ start_frontend() {
set +a
export PYTHONPATH="$PROJECT_DIR/frontend/src"
export API_URL="http://127.0.0.1:10079/chat"
export API_URL="http://127.0.0.1:8079/chat"
streamlit run frontend/src/frontend_main.py --server.port 10501 --server.address 0.0.0.0 &
FRONTEND_PID=$!
echo -e "${GREEN}✓ 前端服务已启动 (PID: $FRONTEND_PID)${NC}"