MINARA

个人资料管理

GET/PUT/DELETE /v1/profile、/v1/profile/tags/:name 和 /v1/profile/prompt:读取和编辑个性化信息(财务资料、标签、自定义提示词)。

GET /v1/profile

返回个性化快照,即 Minara 当前了解的用户信息。等同于 REPL 的 /profile 命令和 minara profile show

方法GET
路径/v1/profile
认证设置 GATEWAY_AUTH_TOKEN 时需要 Authorization: Bearer <token>
类别personalization

响应 200

{
  "ok": true,
  "data": {
    "trading_summary": {
      "platform_wallet_summary": "Cycle-aware swing trader. Spot: BTC accumulation in pullbacks. Perps: short-bias hedge on ETH across two subs.",
      "reference_wallets_summary": null
    },
    "memories": [
      { "id": 1, "statement": "Prefers long-term BTC holds.", "subcategory": "preference", "created_at": "2026-04-13T10:00:00Z" }
    ],
    "tags": [
      { "name": "Risk Profile", "value": "Balanced", "source": "user", "updated_at": "2026-04-13T10:00:00Z" }
    ],
    "custom_prompt": "Respond in casual tone",
    "settings": { "include_memories": true, "include_trading_summary": true, "include_tags": true }
  }
}

个性化重建器会从三个来源组成 platform_wallet_summary:会话内 trade_historyperps_fills(Minara /v1/perp-wallets/fills 的跨子账户镜像)以及 external_spot_activities(Minara /v1/tx/cross-chain/activities)。LLM 会输出四个字段(总览、spotBreakdownperpsBreakdown 和参考钱包),重建器将其拼接为带 Spot: / Perps: 前缀的单一字符串。下游读取方因此能看到一份摘要,同时仍可解析各功能面的分段。完整管线请参阅个性化重建器

tags[].source 字段有三个可能的值:

  • user:由用户显式设置(REPL /profile set、CLI minara profile set 或 REST PUT /v1/profile/tags/:name)。
  • learned_preference:行为偏好升级并桥接到此标签时,由偏好演进系统设置。
  • inferred:由定期个性化重建器根据聊天历史推导。

优先级顺序为 user > learned_preference > inferred;低级别写入遇到高级别记录时会被静默跳过。


PUT /v1/profile/tags/:name

设置或更新单个用户标签。:name 路径参数可接受规范标签名(如 Risk Profile)或 slug 形式(如 risk-profile);URL 必须进行百分号编码。

方法PUT
路径/v1/profile/tags/:name
认证设置 GATEWAY_AUTH_TOKEN 时需要 Authorization: Bearer <token>
请求体用于清除的 { "value": "Conservative" }{ "value": null }
类别personalization

无论请求体中是否有 source 字段,写入都会以 source: "user" 记录。API 使用者不能声明 inferredlearned_preference 来源,这些值保留给重建器和偏好系统。

响应 200(成功):

{ "ok": true, "data": { "name": "Risk Profile", "value": "Conservative", "source": "user", "updated_at": "2026-04-17T10:23:00Z" } }

响应 422(未知标签或无效值):

{ "ok": false, "error": "Invalid value 'Reckless' for \"Risk Profile\". Allowed: Aggressive / Balanced / Conservative" }

DELETE /v1/profile/tags/:name

等同于使用 { "value": null }PUT:清除标签,同时保留软删除标记,避免后续推断重建再次设置它。记录的 source"user"

方法DELETE
路径/v1/profile/tags/:name
认证设置 GATEWAY_AUTH_TOKEN 时需要 Authorization: Bearer <token>
类别personalization

响应 200

{ "ok": true, "data": { "name": "Risk Profile", "value": null, "source": "user", "updated_at": "2026-04-17T10:23:00Z" } }

PUT /v1/profile/prompt

设置用户的自定义系统提示词附加内容。

方法PUT
路径/v1/profile/prompt
认证设置 GATEWAY_AUTH_TOKEN 时需要 Authorization: Bearer <token>
请求体{ "text": "Respond in casual tone" }(最多 2000 个字符)
类别personalization

响应 200

{ "ok": true, "data": { "custom_prompt": "Respond in casual tone" } }

请求体大于约 8 KB 时,响应 413(在解析前拒绝)。

text 缺失、为空、不是字符串或超过 2000 个字符时,响应 422


DELETE /v1/profile/prompt

清除自定义提示词。

方法DELETE
路径/v1/profile/prompt
认证设置 GATEWAY_AUTH_TOKEN 时需要 Authorization: Bearer <token>
类别personalization

响应 200

{ "ok": true, "data": { "custom_prompt": null } }

相关端点

以下端点完善了个人资料/个性化功能,并在各自自动生成的页面中说明:

如需完整的机器可读接口,请下载 OpenAPI 3.1 规范

本页目录