模块 1 · 客户视角

客户能做什么?
从 SSE 对话到 Core 只读

登录客户(如 CUST-9527)打开「客户助手」后,可走同步或 SSE 流式 对话。未登录访客另有游客试聊(只 RAG、不查持仓)。 2026-09 merger 分支:客户线 SSE 已接通,测试基线 **786 passed**。

四条能力线(指挥 AI 改功能前先对齐)

对话 SSE / 同步

POST /api/chat/stream 或 POST /api/chat,请求头 X-Agent-Type: customer + Bearer JWT。

持仓 / 流水 / 风评 / 净值

意图命中后走 Core 模拟库只读查询 Tool(core_ro_tool.py);含 C-05 最新净值(非实时);C-04 查持仓时可 inline 阈值提醒。

产品规则 RAG

fin_* 知识库(Milvus)回答申购赎回、费率等产品咨询;画像语境注入但不泄露敏感字段。

游客试聊

POST /api/chat/visitor 免登录,游客试聊 9 节点编排(visitor_service.py),不写客户会话表。

和理财师线的区别: 客户线走登录客户 14 节点 LangGraph 编排(customer_service.py),不走 顾问通用 tool→llm→guard 编排(agent_service.py)。

数据流:浏览器问「我持仓多少」

客户发消息后,四 Agent 对话 HTTP 入口(chat.py)按 X-Agent-Type 分流到客户编排,再查 Core。

🖥浏览器
🚪对话 HTTP 入口(chat.py)
🤖customer_service
🗄core_ro_tool

点击「下一步」看请求怎么走

入口 · 四 Agent 对话 HTTP 入口(chat.py)
if agent_type == "customer":
    host_ctx = host_auth_for_customer_service(auth, trace_id=trace_id)
    customer_prep = prepare_customer_stream(
        host_ctx, message, sid, cust_id, req.end_session
    )
    # 图跑完后按 chunks 推 SSE
白话

看到 customer 就换轨道:不进 agent_service,改走客户专用编排。

先把 JWT 转成 customer_service 认识的 AuthContext(字段名对齐)。

流式路径:LangGraph 整图跑完,再把回复切成块推给前端——Tool/RAG 仍是同步完成。

未登录访客在首页试聊,会查到自己的持仓吗?