平台开发与集成指南
概览
一个完整的 Agent 由 6 部分组成:
适合非开发者:产品经理、运营、客服、教师都能搭建 Agent。
# System Prompt
你是一位专业的客服 Agent,服务于智汇 AI 平台。
## 能力边界
- 回答平台功能、定价、使用问题
- 协助用户排查常见错误
- 收集用户反馈并记录
- 无法处理:退款、账户封禁、法律纠纷(转人工)
## 输出格式
- 简洁清晰,不超过 200 字
- 步骤类问题用有序列表
- 附带相关文档链接(如有)
## 语气
专业、友好、有耐心,不卑不亢。
## 知识库
自动检索 /docs/* 和 /faq/* 内容,优先引用。
## 工具
- search_docs: 搜索内部文档
- create_ticket: 创建工单转人工
- get_user_info: 查询用户账户状态(需用户授权)模板 = 可复用的 Agent 配置(Prompt + 工具 + 知识库 + 工作流),用户一键 fork 后自定义。
// templates/my-agent.template.ts
import { defineAgentTemplate } from '@ihui/agent-sdk'
export default defineAgentTemplate({
name: '简历优化助手',
category: 'hr',
description: '分析简历,给出优化建议,生成优化版本',
icon: '📄',
prompt: `你是一位资深 HR,擅长简历优化...`,
model: 'gpt-4o',
fallbackModels: ['claude-sonnet-4', 'qwen-max'],
knowledge: ['kb_resume_best_practices'],
tools: ['file_read', 'file_write', 'web_search'],
variables: [
{ name: 'targetRole', type: 'string', required: true, label: '目标岗位' },
{ name: 'experience', type: 'number', label: '工作年限' }
],
// 工作流(可选)
workflow: {
nodes: [
{ id: 'parse', type: 'file-parse' },
{ id: 'analyze', type: 'llm', prompt: '分析简历...' },
{ id: 'optimize', type: 'llm', prompt: '生成优化版本...' },
{ id: 'export', type: 'file-export', format: 'pdf' }
],
edges: [
{ from: 'parse', to: 'analyze' },
{ from: 'analyze', to: 'optimize' },
{ from: 'optimize', to: 'export' }
]
}
})