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 規範

本頁目錄