feat(visitor): Implement visitor chat functionality and enhance customer service interactions

- Added a new visitor chat API endpoint (`/api/chat/visitor`) to allow unauthenticated users to engage in conversations without requiring customer data.
- Introduced a visitor context dependency to manage visitor interactions seamlessly.
- Enhanced the chat API to support explicit session termination and improved response handling for customer service interactions.
- Updated the database configuration to include Redis client support for caching visitor data.
- Added a new customer note repository to persist user notes independently of the L1 profile slots.

This update significantly improves the customer service experience by enabling visitor interactions and ensuring efficient data handling for both registered and unregistered users.
This commit is contained in:
2026-09-09 18:32:00 +08:00
parent ad930c26b1
commit b841f68295
98 changed files with 10682 additions and 630 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
| 向量库 | Milvus Lite + pymilvus 3.0.1 | 本地 `./data/milvus.db`;1024 维 |
| Embedding | Ollama bge-m3 | 本地,不出内网 |
| LLM 生成 | DeepSeek API | 对话/推理 |
| 前端 | React 19 + Vite 7 + AntD 5 + TS strict | **`web/` 脚手架已 init**;Chat/平台读页待接;设计见 `docs/superpowers/specs/2026-09-09-frontend-p0-design.md` |
| 前端 | React 19 + Vite 8 + **AntD 6** + **Tailwind CSS v4** + TS strict | **`web/` 四角色 Dashboard 已真接平台读 API**(`hooks`+`api`+`components/ui|dashboard|layout`);Chat/SSE/market 待接;见 `docs/frontend/FRONTEND-HANDOFF.md` |
| 对象存储 | 本地目录 `data/kb/` | 不用 MinIO |
| 部署 | Windows 原生 | Docker 仅答辩备选 |
@@ -35,7 +35,7 @@
| 模块 | 职责 | 依赖 | 代码状态 |
| --- | --- | --- | --- |
| Agent Gateway / Auth SDK | JWT、RBAC、归属校验 | Redis、MySQL customer_advisor_rel | **已实现(T-01 + AL-09)**:模块 `service/auth_service.py` + `api/deps.py`;宿主 `gateway/` 四件套并存;`/api/auth/login` 统一走 `issue_dev_token`;S2 接缝 `auth_adapter.module_auth_from_host` |
| 客户财富 Agent | L1 画像、事实查询、阈值提醒 | Core RO、Milvus 产品库 | 空壳 service(chat 骨架已通) |
| 客户财富 Agent | L1 画像、事实查询、阈值提醒 | Core RO、Milvus 产品库 | **chat 骨架已通** · **S2 接缝已接线**(customer 并行分流 + visitor 试聊 · 见 `客服Agent-合并说明.md` §3) |
| 代理人助手 Agent | L2 画像、RAG、草稿 | L1 只读、Milvus | 空壳 service(chat 骨架已通) |
| 数据分析 Agent | NL→SQL→解读 | Core RO、画像只读 | 空壳 service(chat 骨架已通) |
| 风控监测 Agent | 预警、L3、R-02 适当性 | 交易事件、AML 名单 | **已实现 B1~B9b + C1~C6(FR-1~10)**:事件线 + 对话线 + 集中度/时效升级/代理人行为链;**AL-09 已并入 `merger` 分支** |