AI Copilot Architecture

Context-aware Agent with MCP tool orchestration

PRESENTATION AGENT CORE LLM TOOL LAYER · MCP DATA 运营用户 Operator 投放管理平台 Web Application ┌── 页面路径感知 ──┐ 路径自动拼接 · 作为 context 传递 AI Copilot 对话交互面板 ┌── 混合交互 ──┐ tool_call → UI确认组件 用户确认/编辑 → 执行反馈 交互闭环 ① AI 建议 → tool_call ② 渲染为 UI 确认组件 ③ 用户确认/编辑参数 ④ Agent 执行 → 反馈 操作 嵌入 用户输入 + 页面路径 Agent Server 推理循环编排 · 对话管理 消息组装 · 上下文注入 system prompt · 对话历史 · 工具路由 system prompt + messages + tools DeepSeek API tool_call 推理 finish_reason = tool_calls tool_call 返回 路由至对应 MCP MCP Server 工具注册 · 参数解析 · 异常兜底 数据查询 消耗/转化/ROI 关键词分析 分类/画像/竞争度 策略推荐 出价/预算调整 告警诊断 异常检测/归因 工具执行结果返回 投放数据 消耗/展示/点击/转化 归因数据 AppsFlyer/Adjust 业务数据 客户/账户/预算 规则配置 告警/策略/分类规则 Legend Frontend Agent Core LLM MCP / Tools Data Result Return Data Flow

Core Architecture

  • • MCP protocol for standardized tool orchestration
  • • Context-aware via page path injection
  • • Dynamic tool mapping per user scenario
  • • Human-in-the-loop confirmation pattern

Agent Design

  • • Custom system prompt with behavior boundary
  • • LLM tool_call → interactive UI rendering
  • • Multi-turn conversation management
  • • Fallback and error handling strategy

Tech Stack

  • • LLM: DeepSeek API (tool_calling)
  • • Protocol: MCP (Model Context Protocol)
  • • Backend: Python Agent Server
  • • Frontend: Embedded dialog + UI rendering