引言:ADP 4.0与企业级AgentOps
2026年6月5日,腾讯云智能体开发平台ADP正式发布4.0版本,升级为企业级AgentOps平台。新版本的核心亮点是新增支持Agentic Loop的Claw模式,并通过Connector、Skills、知识库、MCP和Agent Portal,打通企业级Agent构建、连接、分发到治理的全生命周期。
对于开发者而言,ADP 4.0的价值在于提供了一套完整的Agent开发、部署和治理工具链。本文将基于实战场景,详细介绍Claw模式下的Connector配置、Skills安装和知识库对接方法。
Claw模式:自然语言生成智能体
Claw模式是ADP 4.0引入的新型Agent开发模式,支持通过自然语言描述需求,由平台自动生成对应的Agent配置。这一模式降低了Agent开发的门槛,使业务人员也能参与Agent的定义过程。
Claw模式的工作流程:
- 需求描述:用户通过自然语言描述期望Agent完成的功能(如"创建一个能够查询CRM客户信息并生成跟进建议的Agent")。
- 意图解析:平台基于大语言模型解析需求,识别所需的能力模块(如CRM Connector、客户数据知识库、跟进建议生成Skill)。
- 配置生成:平台自动生成Agent的配置JSON,包括Connector绑定、知识库挂载、Skill调用逻辑等。
- 人工审核与调整:开发者或管理员审核自动生成的配置,进行必要的调整。
- 部署与测试:将Agent部署到指定环境,进行功能测试。
Claw模式配置示例:
以下是通过ADP API创建Claw模式Agent的示例代码:
import requests
import json
# ADP平台API地址(示例,实际使用请参考官方文档)
ADP_API_BASE = "https://adp.tencentcloudapi.com"
# 请求头配置
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
# Claw模式Agent定义
claw_agent_definition = {
"AgentName": "CRM客户分析助理",
"Description": "基于CRM数据,分析客户特征并生成跟进建议",
"ClawMode": True, # 启用Claw模式
"NaturalLanguageSpec": """
我需要一个Agent,能够:
1. 从企业CRM系统查询客户基本信息
2. 检索客户历史跟进记录
3. 基于客户特征生成跟进建议
4. 将跟进任务写入项目管理工具
""",
"SuggestedConnectors": ["CRMConnector", "ProjectToolConnector"],
"SuggestedSkills": ["CustomerAnalysisSkill", "FollowUpSuggestionSkill"],
"KnowledgeBaseIds": ["customer_profile_kb", "product_info_kb"]
}
# 调用ADP API创建Agent
response = requests.post(
f"{ADP_API_BASE}/CreateAgent",
headers=headers,
data=json.dumps(claw_agent_definition)
)
if response.status_code == 200:
result = response.json()
print(f"Agent创建成功,ID: {result['AgentId']}")
print(f"自动生成的配置: {json.dumps(result['GeneratedConfig'], indent=2)}")
else:
print(f"Agent创建失败: {response.text}")
Connector配置:打通企业业务系统
Connector是ADP平台中负责Agent与企业业务系统对接的组件。ADP 4.0首批上线近40个精选Connector,覆盖CRM、ERP、OA、工单、客服、项目协作、企业网盘、知识库、文档系统等高频办公与业务场景。
Connector配置的核心步骤:
步骤1:选择并添加Connector
在ADP控制台的"Connector管理"页面,选择所需的Connector(如"企业微信Connector"或"Salesforce CRM Connector")。
步骤2:配置认证信息
大多数Connector需要配置认证信息,才能访问对应的业务系统。以REST API类型的Connector为例:
{
"ConnectorName": "EnterpriseCRMConnector",
"ConnectorType": "REST_API",
"BaseURL": "https://api.enterprise-crm.example.com/v2",
"AuthConfig": {
"AuthType": "OAuth2",
"ClientId": "YOUR_CLIENT_ID",
"ClientSecret": "YOUR_CLIENT_SECRET",
"TokenURL": "https://api.enterprise-crm.example.com/oauth/token",
"Scope": "read_customers write_followups"
},
"RateLimit": {
"RequestsPerMinute": 60,
"BurstSize": 10
}
}
步骤3:定义可调用操作(Actions)
配置Connector支持的操作,如查询客户、创建跟进记录等:
{
"Actions": [
{
"Name": "QueryCustomer",
"DisplayName": "查询客户信息",
"Method": "GET",
"Path": "/customers/{customer_id}",
"Parameters": [
{
"Name": "customer_id",
"Type": "string",
"Required": true,
"Description": "客户唯一标识"
}
],
"ResponseMapping": {
"CustomerName": "$.data.name",
"Company": "$.data.company",
"LastContactDate": "$.data.last_contact_date"
}
},
{
"Name": "CreateFollowUp",
"DisplayName": "创建跟进记录",
"Method": "POST",
"Path": "/customers/{customer_id}/followups",
"RequestBodyTemplate": {
"content": "{{followup_content}}",
"scheduled_time": "{{scheduled_time}}",
"type": "{{followup_type}}"
}
}
]
}
步骤4:测试Connector连通性
在ADP控制台中,使用"测试Connector"功能验证配置是否正确:
# 测试Connector连通性的示例代码
def test_connector(connector_id):
test_payload = {
"ConnectorId": connector_id,
"TestAction": "QueryCustomer",
"TestParameters": {
"customer_id": "TEST_CUSTOMER_001"
}
}
response = requests.post(
f"{ADP_API_BASE}/TestConnector",
headers=headers,
data=json.dumps(test_payload)
)
if response.status_code == 200:
print("Connector连通性测试通过")
print(f"测试响应: {response.json()}")
else:
print(f"Connector测试失败: {response.text}")
# 调用测试
test_connector("EnterpriseCRMConnector")
Skills安装与开发:扩展Agent能力
Skills是ADP平台中封装特定能力的可复用组件。ADP 4.0升级了Skills广场,已支持150+Skills。企业也可以将自定义Skills封装并提交为企业共享插件。
从Skills广场安装Skill:
- 在ADP控制台的"Skills广场"页面,浏览或搜索所需Skill(如"客户画像分析Skill")。
- 查看Skill的详细描述、输入输出参数、所需权限。
- 点击"安装到我的空间",选择安装范围(个人/团队/企业)。
- 如Skill需要额外配置(如API Key),按提示完成配置。
自定义Skill开发示例:
以下示例展示如何开发一个自定义的"客户价值评分Skill":
# custom_skills/customer_value_scorer/skill_definition.json
{
"SkillName": "CustomerValueScorer",
"DisplayName": "客户价值评分",
"Description": "基于客户历史交易数据,计算客户价值评分(0-100)",
"Version": "1.0.0",
"InputParameters": [
{
"Name": "customer_id",
"Type": "string",
"Required": true,
"Description": "客户唯一标识"
},
{
"Name": "scoring_model",
"Type": "string",
"Required": false,
"Default": "RFM",
"Description": "评分模型,支持RFM、CLV等"
}
],
"OutputParameters": [
{
"Name": "score",
"Type": "number",
"Description": "客户价值评分(0-100)"
},
{
"Name": "level",
"Type": "string",
"Description": "客户等级(高价值/中价值/低价值)"
}
],
"RequiredConnectors": ["CRMConnector"],
"RequiredPermissions": ["customers:read", "transactions:read"]
}
# custom_skills/customer_value_scorer/main.py
# Skill实现代码
def calculate_customer_value(customer_id, scoring_model="RFM"):
"""
计算客户价值评分
"""
# 1. 从CRM系统获取客户数据(通过Connector)
customer_data = call_connector(
connector_name="CRMConnector",
action="QueryCustomer",
params={"customer_id": customer_id}
)
# 2. 获取客户交易历史
transactions = call_connector(
connector_name="CRMConnector",
action="QueryTransactions",
params={"customer_id": customer_id, "limit": 50}
)
# 3. 根据评分模型计算评分
if scoring_model == "RFM":
score = calculate_rfm_score(customer_data, transactions)
elif scoring_model == "CLV":
score = calculate_clv_score(customer_data, transactions)
else:
raise ValueError(f"不支持的评分模型: {scoring_model}")
# 4. 确定客户等级
if score >= 80:
level = "高价值"
elif score >= 50:
level = "中价值"
else:
level = "低价值"
return {
"score": score,
"level": level,
"model_used": scoring_model
}
def calculate_rfm_score(customer_data, transactions):
"""
RFM模型计算:Recency(最近消费)、Frequency(消费频率)、Monetary(消费金额)
"""
# 简化示例,实际实现需要更复杂的计算逻辑
import datetime
# Recency: 最近一次消费距今天数
last_transaction_date = datetime.datetime.strptime(
transactions[0]["transaction_date"], "%Y-%m-%d"
)
recency_days = (datetime.datetime.now() - last_transaction_date).days
recency_score = max(0, 100 - recency_days) # 越近越高
# Frequency: 消费频率
frequency = len(transactions)
frequency_score = min(100, frequency * 10) # 越多越高
# Monetary: 消费金额
total_amount = sum([t["amount"] for t in transactions])
monetary_score = min(100, total_amount / 1000) # 越高越高
# 综合评分(平均)
final_score = (recency_score + frequency_score + monetary_score) / 3
return round(final_score, 2)
# Skill入口函数
if __name__ == "__main__":
import sys
import json
# 从标准输入读取输入参数
input_data = json.loads(sys.stdin.read())
# 调用核心函数
result = calculate_customer_value(
customer_id=input_data["customer_id"],
scoring_model=input_data.get("scoring_model", "RFM")
)
# 将结果输出到标准输出
print(json.dumps(result))
将自定义Skill提交到企业Skills广场:
- 在ADP控制台进入"Skills管理" > "提交新Skill"。
- 上传Skill代码包(需符合ADP Skill打包规范)。
- 填写Skill定义JSON(如上述
skill_definition.json)。 - 提交后,Skill进入安全检测流程(代码静态扫描、数据访问审查、网络出站规则检查等)。
- 安全检测通过后,进入多级审批流程。
- 审批通过后,Skill上架到企业Skills广场,供其他开发者或Agent调用。
知识库对接:为Agent提供领域知识
知识库是Agent获取领域知识的重要来源。ADP 4.0支持多种知识库对接方式,包括平台托管知识库和外部知识库系统对接。
创建并配置平台托管知识库:
# 创建知识库的API调用示例
# 1. 创建知识库
create_kb_payload = {
"KnowledgeBaseName": "产品知识库",
"Description": "存储公司产品介绍、技术文档、常见问题解答",
"DataSourceType": "DOCUMENTS", # 数据源类型:DOCUMENTS, FAQ, STRUCTURED_DATA
"EmbeddingModel": "text-embedding-ada-002", # 向量化模型
"ChunkStrategy": {
"Method": "SEMANTIC", # 分块策略:SEMANTIC, FIXED_LENGTH, PARAGRAPH
"ChunkSize": 512, # 每块token数
"Overlap": 50 # 块间重叠token数
},
"IndexType": "HNSW" # 索引类型:HNSW, IVF, FLAT
}
create_kb_response = requests.post(
f"{ADP_API_BASE}/CreateKnowledgeBase",
headers=headers,
data=json.dumps(create_kb_payload)
)
kb_id = create_kb_response.json()["KnowledgeBaseId"]
print(f"知识库创建成功,ID: {kb_id}")
# 2. 上传文档到知识库
upload_document_payload = {
"KnowledgeBaseId": kb_id,
"Documents": [
{
"Name": "产品A技术白皮书.pdf",
"SourceType": "COS", # 来源类型:COS, LOCAL, URL
"SourcePath": "adp-documents/product-a-whitepaper.pdf",
"Metadata": {
"product": "产品A",
"version": "2.0",
"document_type": "whitepaper"
}
}
]
}
upload_response = requests.post(
f"{ADP_API_BASE}/UploadDocuments",
headers=headers,
data=json.dumps(upload_document_payload)
)
print(f"文档上传成功,索引任务ID: {upload_response.json()['IndexTaskId']}")
# 3. 查询索引状态
import time
task_id = upload_response.json()["IndexTaskId"]
while True:
status_response = requests.get(
f"{ADP_API_BASE}/DescribeIndexTask",
headers=headers,
params={"TaskId": task_id}
)
status = status_response.json()["Status"]
if status == "COMPLETED":
print("文档索引完成")
break
elif status == "FAILED":
print(f"索引失败: {status_response.json()['ErrorMessage']}")
break
else:
print(f"索引中... 进度: {status_response.json()['Progress']}%")
time.sleep(5)
将知识库挂载到Agent:
# 将知识库挂载到Agent的配置示例
mount_kb_payload = {
"AgentId": "agent-xxxxxx",
"KnowledgeBaseIds": [kb_id, "product_faq_kb"],
"RetrievalConfig": {
"TopK": 5, # 检索返回的最相关Chunk数量
"ScoreThreshold": 0.7, # 相似度阈值
"RerankingEnabled": True, # 是否启用重排序
"RerankingModel": "bge-reranker" # 重排序模型
}
}
mount_response = requests.post(
f"{ADP_API_BASE}/MountKnowledgeBase",
headers=headers,
data=json.dumps(mount_kb_payload)
)
if mount_response.status_code == 200:
print("知识库挂载成功")
else:
print(f"挂载失败: {mount_response.text}")
实战案例:构建"智能客户跟进助理"
结合上述Connector、Skills和知识库的配置,以下展示如何构建一个完整的"智能客户跟进助理"Agent。
Agent功能需求:
- 从CRM系统获取客户基本信息
- 检索客户历史跟进记录
- 基于客户特征和产品知识库,生成个性化跟进建议
- 将跟进任务写入项目管理工具
Agent配置JSON(由Claw模式自动生成,经人工调整):
{
"AgentName": "智能客户跟进助理",
"Description": "基于客户数据和产品知识,生成个性化跟进建议",
"Model": "hunyuan-pro",
"Prompt": "你是一位资深的客户成功经理,擅长基于客户特征制定跟进策略...",
"Connectors": [
{
"Name": "CRMConnector",
"Actions": ["QueryCustomer", "QueryTransactions", "UpdateCustomer"]
},
{
"Name": "ProjectToolConnector",
"Actions": ["CreateTask", "UpdateTask"]
}
],
"Skills": [
{
"Name": "CustomerValueScorer",
"Version": "1.0.0"
},
{
"Name": "FollowUpSuggestionGenerator",
"Version": "2.1.0"
}
],
"KnowledgeBases": [
{
"Id": "product_kb",
"RetrievalConfig": {
"TopK": 3,
"ScoreThreshold": 0.75
}
},
{
"Id": "customer_success_kb",
"RetrievalConfig": {
"TopK": 2,
"ScoreThreshold": 0.7
}
}
],
"Workflow": {
"Steps": [
{
"StepName": "获取客户数据",
"Action": "CallConnector",
"Connector": "CRMConnector",
"Operation": "QueryCustomer",
"OutputVariable": "customer_data"
},
{
"StepName": "计算客户价值",
"Action": "CallSkill",
"Skill": "CustomerValueScorer",
"Input": {"customer_id": "${customer_data.id}"},
"OutputVariable": "value_score"
},
{
"StepName": "检索产品知识",
"Action": "QueryKnowledgeBase",
"KnowledgeBase": "product_kb",
"Query": "基于${customer_data.industry}行业的解决方案",
"OutputVariable": "product_info"
},
{
"StepName": "生成跟进建议",
"Action": "CallSkill",
"Skill": "FollowUpSuggestionGenerator",
"Input": {
"customer_data": "${customer_data}",
"value_score": "${value_score}",
"product_info": "${product_info}"
},
"OutputVariable": "suggestion"
},
{
"StepName": "创建跟进任务",
"Action": "CallConnector",
"Connector": "ProjectToolConnector",
"Operation": "CreateTask",
"Input": {
"title": "跟进客户${customer_data.name}",
"content": "${suggestion.content}",
"due_date": "${suggestion.suggested_contact_date}"
}
}
]
}
}
结语
ADP 4.0通过Claw模式、Connector、Skills和知识库等能力的整合,为企业提供了完整的AgentOps工具链。开发者可以基于本文介绍的方法,快速构建和部署符合业务需求的智能体应用。
需要注意的是,Agent的开发和部署应遵循企业的安全规范和治理要求。在将自定义Connector或Skill提交到企业平台前,务必进行充分的安全检测和测试。
更多技术细节和API参考,请访问腾讯云官方文档:cloud.tencent.com/document/product/ADP
关于上海华万
上海华万,专注为企业提供SaaS产品的一站式选型与集成服务。国内产品线涵盖腾讯会议、企业微信、腾讯电子签等腾讯生态产品,国际产品线包括Microsoft Teams、Zoom、DocuSign等协作与签约工具。从需求诊断、产品选型到系统部署、API集成与长期运维,华万为企业量身定制落地路径,覆盖售前咨询、方案设计、部署实施与售后服务全流程。目前已服务制造、零售、教育、金融等多个行业的中小企业客户。