美妝品牌如何啟動 Agent to Agent 旅程?
玩美 AI Beauty Agent 是由玩美移動打造、為單一品牌隔離的可立即呼叫 AI Agent。在 Agent-to-Agent(A2A)架構下,品牌自家 Agent 擔任主控端(host)——接收使用者請求,透過 SKILL.md 介面委派美妝任務,並回傳結果。主控 Agent 完整掌握對話流程,玩美 AI Beauty Agent 則輸出專業美妝智慧。
為什麼不能只用一般的 LLM?
為什麼不能只用一般 AI Agent 來做 A2A 工作流程?
注意:本指南涵蓋第 2 階段(Agent Skill 介面)。在正式 GA 前,細節仍可能調整。
Agent-to-Agent(A2A)流程架構說明
整體流程可分為兩端:
- Client 端——終端使用者 → 品牌官網/ App → Client AI Agent 載入 SKILL.md → 呼叫玩美 AI Beauty Agent。影像輸入(自拍/即時相機)可透過 Perfect CameraKit 或裝置原生相機擷取。
- 玩美移動端——玩美 AI Agent 流程包含:LLM(OpenAI 或指定 LLM)解析意圖 → RAG 讀取品牌知識庫、SKU 與推薦邏輯(來自 Perfect Console)→ Services Catalog 執行服務。
brand_id 分區管理。任何資料都不會跨越品牌邊界。
Agent-to-Agent(A2A)系統中的意圖與可用能力
每個能力都以命名 intent 暴露給外部。主控 Agent 會將這些 intent 註冊成工具,並由 Agent 執行環境依照使用者需求,自動選擇並呼叫正確的 intent。
| Intent | 觸發範例 | 必填輸入 | 回應內容包含 |
|---|---|---|---|
| skin_analysis | 「Analyze my skin」/「Help with skincare」 | brand_id + 影像(CameraKit) | 膚質類型、肌膚問題分數、完整報告、推薦 SKU 清單 |
| product_recommendation | 「Recommend a serum for dark spots」 | brand_id + 肌膚困擾說明,或 analysis_id | 排序後的 SKU 清單、匹配分數與推薦理由 |
| try_on | 「Let me try this lipstick」 | brand_id + sku_id + mode | AR 試妝工作階段 token 或試妝渲染圖 |
| beauty_consultation | 「What foundation suits oily skin?」 | brand_id + prompt | 以自然語言回覆,並以品牌 RAG 為依據 |
Agent-to-Agent(A2A)請求與回應格式
4.1 Request — 輸入欄位
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| intent | string | Yes | 要呼叫的能力:skin_analysis|product_recommendation|try_on|beauty_consultation |
| brand_id | string | Yes | 品牌命名空間。所有 SKU、RAG 與歷史記錄都會依此 brand 作用域隔離。 |
| prompt | string | Yes | 使用者的自然語言問題或指令。 |
| image | base64 / URL | Conditional | 在 skin_analysis 與 try_on 必填。可為自拍照或產品圖,由 Perfect CameraKit 擷取。 |
| sku_id | string | Conditional | 在 try_on 必填。來自品牌商品庫的產品 SKU。 |
| mode | string | No | 用於 try_on:live_camera(預設)或 photo。 |
| context | object | No | 前序對話輪次,或先前的 analysis_id,可用來串接結果。 |
4.2 Response — 輸出欄位
| 欄位 | 型別 | 必填 | 說明 |
|---|---|---|---|
| message | string | Always | 可直接顯示給終端使用者的自然語言回覆。 |
| image | URL / base64 | Conditional | 在 skin_analysis(註解標記報告)與 try_on(試妝結果)時回傳。 |
| data | object | Conditional | 結構化內容——膚質分數、SKU 清單與匹配分數、問題拆解等。 |
| intent_handled | string | Always | 實際被執行的 intent 回寫,可用於記錄與串接後續流程。 |
| analysis_id | string | Conditional | 由 skin_analysis 回傳。可在後續呼叫 product_recommendation 時帶入,形成個人化串接流程。 |
4.3 範例:串接流程(膚質分析 → 產品推薦)
# Step 1 — 主控 Agent 發送膚質分析請求{"intent": "skin_analysis", "brand_id": "acme-beauty", "prompt": "Help me with my skincare routine.", "image": "<base64 selfie from CameraKit>"}# Step 1 — Perfect AI Beauty Agent 回應{"intent_handled": "skin_analysis", "message": "Your skin type is Normal. Top concerns: Moisture (mild), Dark Circles (mild).", "image": "<annotated skin report URL>", "analysis_id": "ana_abc123", "data": {"skin_type": "Normal", "concern_scores": { "moisture": 68, "dark_circles": 72 }}}# Step 2 — 主控 Agent 串接產品推薦{"intent": "product_recommendation", "brand_id": "acme-beauty", "analysis_id": "ana_abc123", "prompt": "Suggest serums for my top concerns."}# Step 2 — Perfect AI Beauty Agent 回應{"intent_handled": "product_recommendation", "message": "Based on your skin report, here are 2 serums for moisture and dark circles.", "data": {"recommendations": [{ "sku_id": "SERUM-VC01", "name": "Vitamin C Serum", "match_score": 0.94, "reason": "Targets dark circles and hyperpigmentation" }, { "sku_id": "SERUM-HA02", "name": "Hyaluronic Acid Serum", "match_score": 0.89, "reason": "Deep hydration for moisture-deficient skin" }]}}
SKILL.md — Manifest 參考說明
將 skill 資料夾放進 Agent 的 skills 目錄中。Agent 啟動時會讀取 SKILL.md,註冊裡面的 intents 成為可呼叫工具,並依照使用者意圖自動選擇正確的 intent。
資料夾結構
perfect-ai-beauty-agent/
├── SKILL.md # manifest — 能力、驗證、資料隔離設定
├── references/
│ ├── intent-schemas.md # 完整輸入/輸出欄位定義
│ └── brand-onboarding.md # 品牌上線設定清單
└── assets/
└── arch-overview.md # A2A 架構說明筆記關鍵 Frontmatter 欄位
--- name: perfect-ai-beauty-agent description: > Invoke Perfect AI Beauty Agent for skin analysis (CameraKit), skincare product recommendations, virtual try-on, or beauty consultation. Brand-scoped: all data partitioned by brand_id. Trigger: skin analysis, skincare advice, product recommendation, virtual try-on, beauty consultation, skin score, CameraKit. license: Proprietary — contact api-support@perfectcorp.com metadata: author: Perfect Corp RD version: 0.1-draft ---
Agent-to-Agent(A2A)系統逐步設定與品牌導入流程
建立品牌 API Key
登入玩美移動 Console → Settings → Integrations → Agent Skill,產生 Brand API Key。請記下 brand_id,所有 API 呼叫都必須帶入。
將 skill 加入自家 Agent
Clone 或下載 perfect-ai-beauty-agent/ 資料夾,放入 Agent 的 skills 目錄。Agent 啟動時會自動偵測並註冊其中的 intents。
設定 CameraKit(針對影像型 intents)
在主控 App 中初始化 Perfect CameraKit SDK。CameraKit 會負責 skin_analysis 的自拍擷取,以及 try_on 的即時 AR 試妝渲染。每個工作階段都以 token 綁定,為暫時性。
透過玩美移動 Console 匯入 SKU 與妝容
在玩美移動 Console 匯入品牌的彩妝 SKU、保養產品與妝容(looks)。這些資料會填入 SKU 商品庫,並自動與推薦與試妝 intents 綁定。
測試品牌隔離機制
使用自家 brand_id 發送測試請求,確認推薦結果只出現品牌自家商品。再用其他不相干的 brand_id 測試,應回傳 403。
錯誤代碼與處理方式
| 代碼 | 名稱 | 發生情境/處理建議 |
|---|---|---|
| 400 | Bad Request | 缺少必填欄位(例如 intent、brand_id,或需要時未附上 image)。請檢查請求 payload。 |
| 401 | Unauthorized | Brand API Key 無效或缺漏。請在 Perfect Console 驗證金鑰設定。 |
| 403 | Forbidden | 請求中的 brand_id 與 API Key 授權品牌不符,跨品牌存取被拒。 |
| 404 | SKU Not Found | 指定的 sku_id 不存在於品牌商品庫。請確認 SKU 已在 Perfect Console 匯入。 |
| 415 | Unsupported Image | 影像格式不支援或解析度過低。請使用 JPEG/PNG,最小 480×480 px。 |
| 429 | Rate Limit Exceeded | 請求頻率過高。請實作指數退避(exponential backoff),並聯絡技術支援調整額度。 |
| 503 | Service Unavailable | CameraKit 工作階段或下游模型暫時無法服務。請搭配退避機制重試。 |
在 Agent-to-Agent(A2A)工作流程中確保資料隔離與安全性
- 每次請求都必須提供 brand_id。所有 SKU 商品庫、RAG 語料、推薦規則與使用者歷史,會在資料層依照
brand_id分區隔離。 - API Key 皆為品牌範圍。發給品牌 A 的金鑰無法存取品牌 B 的資料,否則請求會回傳
403。 - CameraKit 工作階段為暫時性的且以 token 綁定。在工作階段結束後,伺服器端不會保留任何影像畫面或相片。
- user_id 為不透明 token。不需要、也不會儲存任何真實個資(PII)。是否啟用使用者歷史由品牌自行選擇,預設為關閉。
- API Key 可隨時輪替。可在玩美移動 Console 中重發新金鑰,舊金鑰會在輪替後立即失效。
作者







