
{"type":"doc","content":[{"type":"blockquote","attrs":{"id":"9f02e8a7-77fa-44bd-b37a-f715a868a35a","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"3842388b-6ad1-4323-adff-1193956e078e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"摘要:生成式 AI 浪潮下,传统业务软件正在从流程工具向智能业务载体演进。很多团队直接调用大模型 API 完成 AI 功能,上线后容易出现数据泄露、大模型幻觉、服务不稳定、业务与 AI 强耦合等工程问题。本文分享一套可落地的分层架构方案,介绍如何将大模型能力安全接入小程序、后台管理系统,实现 RAG 知识库、多模型适配、安全风控、异步任务调度等能力。"}]}]},{"type":"heading","attrs":{"id":"d4cdaf59-ca73-4570-a9ad-5e887e6a791b","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"一、AI 业务集成的工程痛点"}]},{"type":"paragraph","attrs":{"id":"9128eb5f-909e-4c30-bd03-34a679db7800","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"在给中小型业务系统增加 AI 能力时,很多项目仅做简单 API 封装,会遇到一系列现实工程问题:"}]},{"type":"orderedList","attrs":{"id":"81ed1528-a620-4522-a98a-a4da8c6b7498","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"155f546f-71ff-4faa-8abd-4fa85166e026"},"content":[{"type":"paragraph","attrs":{"id":"311fcbba-52f1-41b6-b914-12381ea252ff","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务原始数据直接提交给大模型,缺少脱敏与隔离,存在业务数据泄露风险;"}]}]},{"type":"listItem","attrs":{"id":"49a75778-93e3-473b-8d91-7ec23e77697e"},"content":[{"type":"paragraph","attrs":{"id":"0d8cc5a8-7119-480c-9405-19ed122f7124","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"直接使用通用大模型输出,缺少私有业务知识库,幻觉严重,输出内容和业务场景不匹配;"}]}]},{"type":"listItem","attrs":{"id":"dc738ef9-b2b0-439c-9619-aec6fcf9b74c"},"content":[{"type":"paragraph","attrs":{"id":"2605460c-40ce-48f7-b785-3e3699d076dc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"缺少限流、熔断、降级策略,大模型接口不稳定时直接导致主业务崩溃;"}]}]},{"type":"listItem","attrs":{"id":"020cf450-ba9f-4c51-8d4d-d47f757e76a1"},"content":[{"type":"paragraph","attrs":{"id":"2c3d29f1-e19c-4b7b-90b7-78d3ab3901df","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"AI 逻辑和业务代码高度耦合,更换大模型服务商需要大规模修改业务代码;"}]}]},{"type":"listItem","attrs":{"id":"64676561-f128-4288-b75b-6e3c76d4eea8"},"content":[{"type":"paragraph","attrs":{"id":"3ebeb83b-9534-49ed-9278-75877dbea320","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"缺少调用审计、Token 统计,无法管控 AI 调用成本;"}]}]},{"type":"listItem","attrs":{"id":"ebde02f5-37dc-486b-9536-6e21241b655f"},"content":[{"type":"paragraph","attrs":{"id":"036104a1-c900-4ed9-9665-b71b50ffe224","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"AI 模块和现有用户权限体系割裂,无法复用已有的 RBAC 权限。"}]}]}]},{"type":"paragraph","attrs":{"id":"58a9b890-2e78-4515-863c-2bd6901627b0","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"想要稳定落地 AI 能力,不能只做简单 API 调用,需要一套完整的中间适配层架构,隔离业务系统与外部大模型服务。"}]},{"type":"heading","attrs":{"id":"207fce9e-24f5-4a7c-bf2e-20c4c6f61e1f","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"二、整体技术栈选型"}]},{"type":"heading","attrs":{"id":"0b68aadf-6388-4c64-b50b-75d2659a669a","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"后端技术栈"}]},{"type":"bulletList","attrs":{"id":"7b15b625-4489-46a4-9943-5072b8e9676f","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"c688aa91-60a9-4a11-8418-c7664b9f478c"},"content":[{"type":"paragraph","attrs":{"id":"5da1b921-968e-42c6-b6a4-d03d2232c317","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务框架:Spring Boot 3.x/ NestJS,根据项目规模二选一"}]}]},{"type":"listItem","attrs":{"id":"8811a276-eda4-420f-bd30-879e3a1c1a92"},"content":[{"type":"paragraph","attrs":{"id":"2e60871d-852e-4fd7-b1f2-4a6b89ee3f92","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"关系数据库:MySQL 8.0,存储核心业务数据"}]}]},{"type":"listItem","attrs":{"id":"44421bcf-e101-493c-81b3-7dd4489f9de1"},"content":[{"type":"paragraph","attrs":{"id":"882eaac2-8c6b-4a17-a0be-a524a01502dd","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"缓存中间件:Redis 7,承担会话存储、接口限流、向量检索缓存"}]}]},{"type":"listItem","attrs":{"id":"9b31a75c-2326-422f-b074-c633463cf5dc"},"content":[{"type":"paragraph","attrs":{"id":"1c56514b-e788-4eae-b5c5-a7b67e66638d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"消息队列:RabbitMQ,处理 AI 长耗时任务异步解耦"}]}]},{"type":"listItem","attrs":{"id":"29d06de5-4027-4900-b80e-97c9671d1fe8"},"content":[{"type":"paragraph","attrs":{"id":"b5c4726e-0538-411f-844b-3aab539aa993","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"部署方式:Docker 容器化,支持云服务器、Serverless 多种部署形态"}]}]},{"type":"listItem","attrs":{"id":"29ae06a3-ff17-4470-9680-ba3da3649743"},"content":[{"type":"paragraph","attrs":{"id":"b689d593-08a2-4905-8ad0-be26608362b3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"对象存储:用于知识库文档、附件、静态资源存储"}]}]}]},{"type":"heading","attrs":{"id":"1962b862-d11f-4242-9edd-d06fb33f72d7","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"AI 中间层技术组件"}]},{"type":"bulletList","attrs":{"id":"6305b7b1-0d6d-480d-a810-2f2014b0d035","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"a9e98a19-279c-4300-ac63-a239584b3dea"},"content":[{"type":"paragraph","attrs":{"id":"b6c89cf3-51ea-47f1-8c4e-f8f56e8973a6","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"模型适配器:统一封装多家大模型接口,标准化入参出参,实现模型无感切换"}]}]},{"type":"listItem","attrs":{"id":"e8da9cc8-a483-4a67-99f5-234d4e74c4c4"},"content":[{"type":"paragraph","attrs":{"id":"7a718944-7b7f-48c4-982d-003bf18365c5","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"RAG 检索增强模块:文档解析、文本分块、向量化、向量召回"}]}]},{"type":"listItem","attrs":{"id":"9de62ee8-0594-4e21-b1db-0304548c4eb6"},"content":[{"type":"paragraph","attrs":{"id":"fa9ebfc9-cbc2-417c-84a8-597ee4d45023","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"Prompt 模板管理:模板版本化管理,避免硬编码 Prompt 散布业务代码"}]}]},{"type":"listItem","attrs":{"id":"2bca6366-000e-490b-83b1-2a7968ba1255"},"content":[{"type":"paragraph","attrs":{"id":"8242b001-04ee-4022-b600-68de5fa4d8d9","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"任务调度模块:区分同步问答、异步生成任务队列"}]}]},{"type":"listItem","attrs":{"id":"57ed8bce-6dc5-4da9-bda4-79413f2969f8"},"content":[{"type":"paragraph","attrs":{"id":"0edc1093-e666-4552-903d-cc16d2c67100","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"安全中间件:输入输出内容过滤、数据脱敏、全链路调用日志"}]}]}]},{"type":"heading","attrs":{"id":"29e6cb16-5302-442f-a04a-5215f796eb3a","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"前端与终端"}]},{"type":"bulletList","attrs":{"id":"d835886a-b83a-4e30-afd3-451d85d1304c","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"e540a8c9-4bf0-4a9b-8840-478776364a39"},"content":[{"type":"paragraph","attrs":{"id":"d6956608-e703-4903-aeaa-92ad71116e2a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"PC 管理后台:Vue3 Element‑Plus"}]}]},{"type":"listItem","attrs":{"id":"ccd2f402-e1f2-47e9-8e67-5247fb4901b2"},"content":[{"type":"paragraph","attrs":{"id":"ec813367-dee0-426c-8d54-dc1e33719a64","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"多端应用:uni‑app,实现小程序、H5 一套代码多端发布"}]}]},{"type":"listItem","attrs":{"id":"270394cb-502d-4948-9de8-d0c746b75961"},"content":[{"type":"paragraph","attrs":{"id":"67bbdc00-9447-4e3b-bba0-a15baaab5c69","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"AI 交互组件:封装通用对话组件,可嵌入各类业务页面"}]}]}]},{"type":"heading","attrs":{"id":"4b7d229b-7326-4c68-a1cb-6fabee4d401f","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"三、分层架构设计"}]},{"type":"paragraph","attrs":{"id":"41c3defa-5e3d-47fa-8f41-62b727dc8f94","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"整体分为五层:接入网关层、业务服务层、AI 适配中台层、数据存储层、外部大模型服务层。业务逻辑与 AI 能力完全解耦。"}]},{"type":"paragraph","attrs":{"id":"7f881555-5bd9-476b-a5fb-f5472ca34d5d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"plaintext"}]},{"type":"codeBlock","attrs":{"id":"347456b5-38cc-4072-9ab7-87df4b326105","language":"javascript","theme":"atom-one-dark","runtimes":0,"isHoverDragHandle":false,"key":"","languageByAi":"javascript"},"content":[{"type":"text","text":"客户端(小程序 / H5 / PC后台)n↓n【接入网关层】n鉴权、跨域、请求限流、参数校验、访问日志n↓n【业务服务层】n用户管理、权限RBAC、业务模块、工作流、业务数据组装n↓n【AI适配中台层】n├─多模型适配器:统一大模型接口封装n├─RAG知识库引擎:文档解析、分块、向量检索召回n├─Prompt模板中心:模板版本管理、变量渲染n├─任务调度:同步接口、MQ异步任务队列n├─安全风控:内容过滤、信息脱敏、调用计量与日志n↓n【数据存储层】nMySQL业务库|Redis缓存|向量数据库|对象存储n↓n【外部大模型服务层】n第三方大模型API服务n"}]},{"type":"heading","attrs":{"id":"9efa463c-7c91-480b-b345-5fe098f35c3e","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.1 接入网关层"}]},{"type":"paragraph","attrs":{"id":"1492cee5-ed2c-4e2e-bee7-47c7b8725635","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"网关作为所有请求统一入口,核心职责:"}]},{"type":"orderedList","attrs":{"id":"cb01a40c-4fd2-4d09-89b9-c0fc58b0f049","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"8750c118-2f42-4f08-a5db-70a092215e85"},"content":[{"type":"paragraph","attrs":{"id":"60c7cc6e-dc63-495d-a81e-5b9b01dcbddc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"统一身份鉴权,复用系统原有权限体系;"}]}]},{"type":"listItem","attrs":{"id":"cf19ffae-7020-4bb3-8eec-7f4784b03286"},"content":[{"type":"paragraph","attrs":{"id":"addc81bf-ed08-4580-8f6d-553ec154dc04","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"针对 AI 相关接口单独限流,防止突发调用造成高额模型费用;"}]}]},{"type":"listItem","attrs":{"id":"82dc944a-e3d8-4b86-9b79-85cb27efd3ef"},"content":[{"type":"paragraph","attrs":{"id":"ea351b09-91cf-4ca4-ba9c-4755964350ee","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"请求日志完整留存,用于问题排查与审计;"}]}]},{"type":"listItem","attrs":{"id":"70e964cd-629f-4062-b398-db90700df3da"},"content":[{"type":"paragraph","attrs":{"id":"ca2f20fa-0953-4a6c-af70-23c6b4563211","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"禁止前端直接访问大模型密钥"},{"type":"text","text":",所有大模型请求全部后端转发。"}]}]}]},{"type":"heading","attrs":{"id":"97fd09e2-480d-43be-b147-9a1d72c914bf","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.2 业务服务层"}]},{"type":"paragraph","attrs":{"id":"1252c94b-bdcc-4407-aba6-72deb49a8419","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务层承载原有全部业务逻辑,AI 作为能力扩展而非独立系统。"}]},{"type":"paragraph","attrs":{"id":"8b521bc6-e7de-4a3c-83ed-fe307bd268fc","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 业务层负责:"}]},{"type":"bulletList","attrs":{"id":"726d85d0-423e-43f4-997b-e43c1b075b0d","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"6fdfe247-91b4-4be6-8c60-2dafb021ffac"},"content":[{"type":"paragraph","attrs":{"id":"83525af6-dc02-4332-95a4-d63fb9b25a9a","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"判断当前用户是否具备 AI 功能访问权限;"}]}]},{"type":"listItem","attrs":{"id":"f8cf6719-7fc8-4de4-9f5d-3f0c3832eb39"},"content":[{"type":"paragraph","attrs":{"id":"311628c3-d331-4ba1-bb43-728ad366a65d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"组装业务上下文数据,传给 AI 中台;"}]}]},{"type":"listItem","attrs":{"id":"ce7557c5-07e1-41fb-8568-1631e26d281a"},"content":[{"type":"paragraph","attrs":{"id":"762b7867-2ec9-4eee-b968-a079d7219cdb","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"接收 AI 返回结果,做业务合法性校验,再写入业务数据库。"}]}]}]},{"type":"blockquote","attrs":{"id":"38f0e84d-7e64-44ea-9667-3813b882045e","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"28f888be-74da-4cc8-afa8-401a0c7d5a54","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务层不关心底层使用哪家大模型,只调用 AI 中台提供的标准化接口。"}]}]},{"type":"heading","attrs":{"id":"1c011a92-9e8d-4224-85eb-dd49ce3b3767","textAlign":"inherit","indent":0,"level":3,"isHoverDragHandle":false},"content":[{"type":"text","text":"3.3 AI 适配中台层(核心模块)"}]},{"type":"paragraph","attrs":{"id":"58395834-eb67-4a4e-86e7-5c50e0f959b4","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"这一层是整套架构的核心,隔离业务系统与外部大模型服务。"}]},{"type":"orderedList","attrs":{"id":"43f9bcb8-4f21-4e2f-ad1a-63d6087d5773","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"1311c2d2-c772-429e-b3db-f44145c8ad27"},"content":[{"type":"paragraph","attrs":{"id":"24c61c2d-7227-4c8f-a529-5631f33270de","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"多模型适配器"}]},{"type":"paragraph","attrs":{"id":"fc0adc16-eeaf-4a00-8603-6b97c95f0398","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 对各家大模型 API 做封装,对外输出统一调用协议。业务侧无需感知底层模型,配置即可切换服务商;当某一个大模型服务故障,可快速切换兜底,保障业务可用。"}]}]},{"type":"listItem","attrs":{"id":"54ada7c3-3bec-40cf-abe6-ccb2433e54b1"},"content":[{"type":"paragraph","attrs":{"id":"36799c14-babe-4f44-a6ce-6ffa6d3ce863","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"RAG 私有知识库检索增强"}]},{"type":"paragraph","attrs":{"id":"74bc91c9-824f-4fea-8d2c-92a1c2f9cc16","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 支持上传业务文档、产品资料,系统自动完成文档解析、文本分块、向量化存入向量库。"}]},{"type":"paragraph","attrs":{"id":"a07e2c82-18ec-4d98-a88f-e6b477c10352","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 用户发起 AI 请求时,优先检索知识库相关片段,把业务资料和用户提问拼接后再交给大模型,有效降低幻觉,让输出贴合自身业务。"}]}]},{"type":"listItem","attrs":{"id":"0bce9f86-2a05-4159-8ca7-65568767882c"},"content":[{"type":"paragraph","attrs":{"id":"ee28e6d5-5571-4cde-a41f-b602f68669ec","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"任务调度与安全管控"}]}]}]},{"type":"bulletList","attrs":{"id":"a97f15cf-029d-42f1-b1cb-126368c4faf9","isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"c939df22-453c-43bd-b3f4-23498c519579"},"content":[{"type":"paragraph","attrs":{"id":"e4302880-565e-4fb6-b70a-f086852f431b","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"简短问答同步返回;文档总结、长文案生成等耗时任务放入消息队列异步处理;"}]}]},{"type":"listItem","attrs":{"id":"7f95b61c-bf42-4df5-a84d-e6d40f60c7d4"},"content":[{"type":"paragraph","attrs":{"id":"51b7351d-71e6-4ef0-aa17-2f30f6b83b51","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"对输入输出做内容过滤,敏感业务字段自动脱敏;"}]}]},{"type":"listItem","attrs":{"id":"1bc3e57d-25e8-43a9-9305-f7d7ecebe66f"},"content":[{"type":"paragraph","attrs":{"id":"a008246b-6e35-47df-a0cd-2159d88ce06e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"统计每次调用 Token 消耗、调用次数,实现成本可观测。"}]}]}]},{"type":"heading","attrs":{"id":"1efa38cd-04c3-4f7d-b793-13232c80cda3","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"四、RAG 问答典型调用流程"}]},{"type":"orderedList","attrs":{"id":"be68955c-778c-4027-8c1f-ab24473e3364","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"726063d2-6842-45ae-baa1-10900e6be248"},"content":[{"type":"paragraph","attrs":{"id":"fa0b8b63-835c-4ad8-9e10-03273fe19e68","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"用户端发起 AI 问答请求,请求到达接入网关;"}]}]},{"type":"listItem","attrs":{"id":"1d6f61f6-aff3-45fb-b552-9c5a43d7fcbb"},"content":[{"type":"paragraph","attrs":{"id":"d4549844-a742-48a6-9e8d-1be42e77993c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"网关完成身份、权限校验,转发至业务服务层;"}]}]},{"type":"listItem","attrs":{"id":"80b1eeba-3613-4433-a312-c7e3488d5afe"},"content":[{"type":"paragraph","attrs":{"id":"841e643b-8413-4321-b46a-6820aa7572f3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务层组装业务上下文,调用 AI 中台标准化接口;"}]}]},{"type":"listItem","attrs":{"id":"c221e0d2-1ce0-4a9c-a419-dac64890dfbd"},"content":[{"type":"paragraph","attrs":{"id":"5e44df54-69e6-42b2-80dc-b23983a3a245","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"AI 中台执行向量检索,召回私有知识库相关片段;"}]}]},{"type":"listItem","attrs":{"id":"3b3d4699-d888-45fc-ba5f-e6fd5dc526f0"},"content":[{"type":"paragraph","attrs":{"id":"dab53e0f-2d00-41e5-8912-bfa791ec3f87","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"将召回片段、用户问题、版本化 Prompt 模板组合请求报文;"}]}]},{"type":"listItem","attrs":{"id":"85a9eccf-bfee-44f0-90bf-c11866a48f5d"},"content":[{"type":"paragraph","attrs":{"id":"7f93ca56-1e07-45f0-87e7-a590074e08ad","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"通过模型适配器调用外部大模型服务;"}]}]},{"type":"listItem","attrs":{"id":"6f650c4e-977e-4c2c-8a68-e3486b7690a1"},"content":[{"type":"paragraph","attrs":{"id":"f03bf631-4f66-40b7-9847-c02b078aae00","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"返回结果经过风控脱敏处理;"}]}]},{"type":"listItem","attrs":{"id":"e9c3bd36-bced-4d0c-a2ed-52e0e70bed33"},"content":[{"type":"paragraph","attrs":{"id":"5b97c26d-afb7-4873-8c60-3feb13750fb8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"结果回传给业务层,业务层完成业务校验后返回前端;"}]}]},{"type":"listItem","attrs":{"id":"031d0a7d-474b-457e-b544-987388e6d3d8"},"content":[{"type":"paragraph","attrs":{"id":"96d0f0c1-bc7d-4b63-941c-3788e67a2b0d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"全链路调用信息落库保存。"}]}]}]},{"type":"heading","attrs":{"id":"98bc3104-d8c7-4c03-9a42-61d0ff7c58dc","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"五、架构带来的工程价值"}]},{"type":"orderedList","attrs":{"id":"a304c7dd-297e-4c06-b171-971e42d8dd72","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"d380a712-6e2a-4b5d-9796-af4ddce4e645"},"content":[{"type":"paragraph","attrs":{"id":"cdd120f4-b374-4510-9649-9ed82480e909","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"业务与 AI 解耦"}]},{"type":"paragraph","attrs":{"id":"8071f98b-cd03-4865-abef-2c0e6de8b4e2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 迭代升级 AI 模块、更换大模型服务商,不需要改动上层业务代码。"}]}]},{"type":"listItem","attrs":{"id":"60101425-1127-4f80-b8c0-e7be57fb0361"},"content":[{"type":"paragraph","attrs":{"id":"6de5cacc-2c6a-4b45-918d-82db76fc71f8","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"业务数据安全可控"}]},{"type":"paragraph","attrs":{"id":"8571fb9a-4c5f-4fe7-8b4f-251518a4c072","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 私有业务数据经过检索、脱敏后再提交大模型,密钥统一保管后端,避免泄露风险。"}]}]},{"type":"listItem","attrs":{"id":"34cbf0fe-5fd5-4fc1-9311-253ac01cbdba"},"content":[{"type":"paragraph","attrs":{"id":"77307092-773d-47d9-b6bd-da5e38b3664d","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"调用成本可观测"}]},{"type":"paragraph","attrs":{"id":"85c85d6d-6155-487d-a270-3e38edd3b661","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 每一次 AI 调用都做埋点统计,可以按功能、用户维度统计消耗,便于成本管控。"}]}]},{"type":"listItem","attrs":{"id":"d617e215-3ac2-40cc-9f62-7342cb9fa2a3"},"content":[{"type":"paragraph","attrs":{"id":"5543eaff-fec9-4767-be2d-25bcfa0700a3","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"能力多场景复用"}]},{"type":"paragraph","attrs":{"id":"5ce4fd6b-4e77-4841-83bc-4455d99c1782","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 同一套 AI 中台,可以支撑智能客服、文案生成、文档解析、业务知识库问答等多种业务场景。"}]}]},{"type":"listItem","attrs":{"id":"8b3e58c5-35ce-4c13-8186-efb07ba3d9ad"},"content":[{"type":"paragraph","attrs":{"id":"be017656-76d5-4d6d-94aa-29b5ccf8749f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"云环境友好"}]},{"type":"paragraph","attrs":{"id":"a04f40ab-aab6-4031-9ac6-87434f1d3047","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 容器化部署,支持云服务器、Serverless 等多种云上环境,小项目节省成本,大项目支持弹性扩容。"}]}]}]},{"type":"heading","attrs":{"id":"f198b99b-21eb-458b-96cb-30b55c54ea42","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"六、业务落地场景"}]},{"type":"paragraph","attrs":{"id":"0f1267a8-8f64-4760-aa75-d209cc6e4d3e","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"基于该架构,可用于多种中小企业数字化场景:"}]},{"type":"orderedList","attrs":{"id":"00a5fd20-ee52-4607-8ec1-bd3676791c8d","start":1,"isHoverDragHandle":false},"content":[{"type":"listItem","attrs":{"id":"a7022fd6-71b5-47c4-b47e-65b47ddd9846"},"content":[{"type":"paragraph","attrs":{"id":"7d8bc591-dba4-4d01-91e3-7b024b467182","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"小程序系统集成 AI 能力,智能文案生成、智能问答客服;"}]}]},{"type":"listItem","attrs":{"id":"597d422c-6d31-4d1e-8910-dc0b8059c776"},"content":[{"type":"paragraph","attrs":{"id":"d6949e5d-a5b2-46a3-94af-d924fc19d84f","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"SaaS 管理后台,文档解析、业务数据总结;"}]}]},{"type":"listItem","attrs":{"id":"0f50a48d-48cb-47c2-a314-e927984bcad4"},"content":[{"type":"paragraph","attrs":{"id":"d19883f7-6dd5-4156-b86e-8014315c72ef","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"私有知识库系统,面向企业内部业务资料问答;"}]}]},{"type":"listItem","attrs":{"id":"0de2c96a-09c6-4c63-9229-6394a9e8a331"},"content":[{"type":"paragraph","attrs":{"id":"5c54a364-2e6d-4771-9df5-4d6961d96a2c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"行业定制系统智能化升级。"}]}]}]},{"type":"blockquote","attrs":{"id":"5c2c7b84-3705-4ef9-bb9d-0fe983906cf0","textAlign":"inherit","isHoverDragHandle":false},"content":[{"type":"paragraph","attrs":{"id":"5d36f50c-69cf-40ff-992b-7312dce28b76","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"实践中优先采用 AI 能力深度嵌入业务流程,避免仅做演示 Demo 式套壳。"}]}]},{"type":"heading","attrs":{"id":"3c822645-07fa-44e2-8c2f-214d0bc8ef08","textAlign":"inherit","indent":0,"level":2,"isHoverDragHandle":false},"content":[{"type":"text","text":"七、总结"}]},{"type":"paragraph","attrs":{"id":"ffb838a9-b67f-4b90-a2c6-6c0b951c6a6c","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":"业务系统接入大模型,核心不在于选择性能最强的模型,而在于工程架构设计。"}]},{"type":"paragraph","attrs":{"id":"6e0f4c0c-ffc4-4fe9-9d6f-21801b37fa37","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","text":" 通过分层架构,把鉴权、限流、RAG 知识库、多模型适配、安全收敛到独立 AI 中台,上层业务只聚焦业务本身。这套方案兼顾开发效率、数据安全、成本可控,适合小程序、SaaS 系统、定制化业务软件做智能化升级。"}]},{"type":"paragraph","attrs":{"id":"37463948-85c7-4206-a442-45bf7df25eb2","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false},"content":[{"type":"text","marks":[{"type":"textStyle","attrs":{"color":"","background":"none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0)"}}],"text":"项目实践来源:河北爵图网络科技有限公司"}]},{"type":"paragraph","attrs":{"id":"b766b3e5-e8fc-4d78-ba46-c00d828a5188","textAlign":"inherit","indent":0,"color":null,"background":null,"isHoverDragHandle":false}}]}","createTime":1786604680,"ext":{"closeTextLink":0,"comment_ban":0,"description":"","focusRead":0},"favNum":0,"html":"","isOriginal":0,"likeNum":0,