控制台
记忆

捕获和检索

用于写入和读取记忆的直接 REST 流程。

当您的后端显式控制记忆写入和读取时,请使用 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."
    }
  }'

Capture 存储原始交换、写入使用情况,并对记忆工作线程进行主题分类和汇总工作排队。

#直接检索

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/capture
POST/api/v1/memory/retrieve
POST/api/v1/memory/functions/halo_retrieve_end_user_memory
POST/api/v1/memory/delete

#处理一致性