バックエンドがメモリの書き込みと読み取りを明示的に制御する場合は、REST API を使用します。どちらの操作も、プロジェクトのsk- クライアント キーを使用して認証します。
#キャプチャ
curl -X POST https://api.agihalo.com/api/v1/memory/capture \
-H "Authorization: Bearer $HALO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"projectKey": "customer-product",
"endUserKey": "user_123",
"sessionData": {
"messages": [
{
"role": "user",
"content": "Keep my weekly reports short and send them in the morning."
}
]
},
"response": {
"role": "assistant",
"content": "I will keep them concise and morning-ready."
}
}'キャプチャは、生の交換を保存し、書き込み使用量を記録し、メモリ ワーカーのトピック分類と要約作業をキューに入れます。
#ダイレクト取得
curl -X POST https://api.agihalo.com/api/v1/memory/retrieve \
-H "Authorization: Bearer $HALO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"projectKey": "customer-product",
"endUserKey": "user_123",
"topics": ["report_preferences"],
"limit": 5,
"includeRaw": true,
"includeDisabledTopics": false
}'| フィールド | 目的 |
|---|---|
topics | 明示的なトピック キーに制限する |
limit | バインドされて返された生のレコード |
includeRaw | リンクされたソース交換を含める |
includeDisabledTopics | 通常の取得が無効になっているトピックを含める |
#エンドポイントの概要
POST
/api/v1/memory/capturePOST
/api/v1/memory/retrievePOST
/api/v1/memory/functions/halo_retrieve_end_user_memoryPOST
/api/v1/memory/delete