Skip to main content
用户画像

获取用户画像

查询指定用户已提取的画像属性

获取指定用户的画像属性。画像提取为异步过程;调用 AddMemory 添加对话后,首次查询可能尚未返回属性值,请按业务重试策略再次查询。
若返回的属性值均为空,请确认调用 AddMemory 时已传入相同的 profile_schema。未传该参数时不会触发画像提取。

请求方法与路径

GET https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}/user_profile

请求参数

参数类型必填位置说明
profile_schema_idstring是Path画像模板 ID
user_idstring是Query记忆实体 ID
memory_library_idstring否Query记忆库 ID

返回结果

字段类型说明
request_idstring请求 ID
profile.schema_namestring画像模板名称
profile.schema_descriptionstring画像模板描述
profile.attributesarray画像属性列表
profile.attributes[].idstring属性 ID
profile.attributes[].namestring属性名称
profile.attributes[].valuestring属性值

代码示例

curl -X GET "https://dashscope.aliyuncs.com/api/v2/apps/memory/profile_schemas/{profile_schema_id}/user_profile?user_id=user_001" \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY" \
  --header "Content-Type: application/json"

响应示例

{
  "profile": {
    "attributes": [
      {"id": "bb28e6cd522443fc9bf7e75b1377bf9d", "name": "年龄", "value": "28"},
      {"id": "04eb06f5f04a437b82d07ceb088103f9", "name": "爱好", "value": "踢足球"},
      {"id": "2eff4652a6bc47b0803635033b1e08dd", "name": "职业", "value": "软件工程师"}
    ],
    "schema_description": "包含年龄和兴趣的用户信息",
    "schema_name": "用户基础画像"
  },
  "request_id": "78cb6090-a7a5-9897-861c-082a64b43d97"
}
完整画像流程参见使用用户画像。
Managed Agents
Sandbox
Security
RAG
应用调用
ParseX
框架