함수 호출은 애플리케이션이 이미 모델 요청을 소유한 경우 선호되는 메모리 통합입니다. 모델은 현재 컨텍스트에 장기 기억이 필요한지 여부를 결정합니다. 서버는 ID 및 자격 증명을 소유합니다.
#함수 선언
{
"name": "halo_retrieve_end_user_memory",
"description": "Retrieve relevant long-term memory for this end user.",
"parameters": {
"type": "object",
"properties": {
"sessionData": {
"type": "object",
"description": "Current conversation and application state."
},
"query": {
"type": "string",
"description": "Optional retrieval focus."
},
"limit": {
"type": "number",
"description": "Maximum raw records to return."
}
},
"required": ["sessionData"]
}
}#함수 실행
curl -X POST \
https://api.agihalo.com/api/v1/memory/functions/halo_retrieve_end_user_memory \
-H "Authorization: Bearer $HALO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"projectKey": "customer-product",
"endUserKey": "user_123",
"arguments": {
"sessionData": {
"messages": [
{
"role": "user",
"content": "What format do I prefer for weekly reports?"
}
]
},
"query": "weekly report preference",
"limit": 5
}
}'#응답 사용
HALO는 검색 가능한 주제와 연결된 처리된 원시 교환을 즉시 선택합니다. 응답에는 selectedTopicKeys,selectionReason, overallSummary,주제, rawEntries 및 소형functionResponse.topics, rawEntries및 소형functionResponse.
{
"name": "halo_retrieve_end_user_memory",
"projectKey": "customer-product",
"endUserKey": "user_123",
"selectedTopicKeys": ["report_preferences"],
"selectionReason": "The user is asking about report format.",
"overallSummary": "The user prefers concise weekly reports.",
"functionResponse": {
"requestId": "memory_request_id",
"rawEntries": [
{
"id": "raw_entry_id",
"topic": { "topicKey": "report_preferences" },
"requestRaw": { "messages": [] },
"responseRaw": { "role": "assistant", "content": "..." }
}
]
}
}범위가 없으면 HALO는 빈 주제와 원시 배열이 포함된 동일한 모양을 반환합니다. 이를 일반적인 최초 사용자 상태로 간주합니다.
#답변 후 캡처
검색은 쓰기를 의미하지 않습니다. 모델이 최종 보조 메시지를 생성한 후 호출 캡처.
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."
}
}'