feat: 重构知识库系统,移除Hermes集成,增强RAG和同步功能

主要变更:
- 移除Hermes智能体及相关回调服务
- 新增知识库RAG、同步、调度、规范化和索引任务服务
- 重构orchestrator服务,增强运行时聊天功能
- 更新前端聊天、政策制度、设置等页面样式和逻辑
- 更新expense_claims和document_intelligence服务
- 删除llm_wiki相关服务和测试文件
- 更新docker-compose配置和启动脚本
This commit is contained in:
caoxiaozhu
2026-05-17 08:38:41 +00:00
parent 212c935308
commit 68f663f2f4
308 changed files with 83729 additions and 13588 deletions

View File

@@ -1,44 +0,0 @@
from __future__ import annotations
from typing import Annotated
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from app.api.deps import get_db
from app.api.v1.endpoints.settings import require_hermes_agent_token
from app.schemas.common import ErrorResponse
from app.schemas.hermes import HermesCallbackRead, HermesCallbackWrite
from app.services.hermes_callbacks import HermesCallbackService
router = APIRouter(prefix="/hermes")
DbSession = Annotated[Session, Depends(get_db)]
@router.post(
"/callback",
response_model=HermesCallbackRead,
dependencies=[Depends(require_hermes_agent_token)],
summary="接收 Hermes 通用回调",
description="所有 Hermes 任务统一通过该入口回传进度或完成结果,服务端依据 type 分发到对应业务处理器。",
responses={
status.HTTP_400_BAD_REQUEST: {
"model": ErrorResponse,
"description": "Hermes 回调载荷不合法或任务类型暂不支持。",
},
status.HTTP_404_NOT_FOUND: {
"model": ErrorResponse,
"description": "回调引用的 AgentRun 不存在。",
},
},
)
def handle_hermes_callback(
payload: HermesCallbackWrite,
db: DbSession,
) -> HermesCallbackRead:
try:
return HermesCallbackService(db).handle_callback(payload)
except LookupError as exc:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc)) from exc
except ValueError as exc:
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(exc)) from exc

File diff suppressed because it is too large Load Diff

View File

@@ -98,7 +98,7 @@ def test_model_connectivity(
response_model=RuntimeModelConfigRead,
dependencies=[Depends(require_hermes_agent_token)],
summary="读取 Hermes 运行时模型配置",
description="供 Hermes 进程读取主模型、备用模型、VLM 或 Embedding 模型的运行时配置。",
description="供 Hermes 进程读取主模型、备用模型、Embedding 或 Reranker 模型的运行时配置。",
responses={
status.HTTP_401_UNAUTHORIZED: {
"model": ErrorResponse,

View File

@@ -7,7 +7,6 @@ from app.api.v1.endpoints.auth import router as auth_router
from app.api.v1.endpoints.bootstrap import router as bootstrap_router
from app.api.v1.endpoints.employees import router as employees_router
from app.api.v1.endpoints.health import router as health_router
from app.api.v1.endpoints.hermes import router as hermes_router
from app.api.v1.endpoints.knowledge import router as knowledge_router
from app.api.v1.endpoints.ocr import router as ocr_router
from app.api.v1.endpoints.ontology import router as ontology_router
@@ -18,7 +17,6 @@ from app.api.v1.endpoints.system_logs import router as system_logs_router
router = APIRouter()
router.include_router(health_router, tags=["health"])
router.include_router(hermes_router, tags=["hermes"])
router.include_router(bootstrap_router, tags=["bootstrap"])
router.include_router(auth_router, tags=["auth"])
router.include_router(agent_assets_router, tags=["agent-assets"])