Search Memory API
출처: 문서
본문
Search Memory API
2.12에 도입됨 {: .label .label-purple }
이 API는 conversational search를 위한 대화형 메모리를 조회해요. 메모리를 검색할 때는 이 명령어를 사용해요.
Security plugin이 활성화되어 있으면 모든 메모리는 private 보안 모드로 존재해요. 메모리를 생성한 사용자만 해당 메모리 및 그 메시지와 상호작용할 수 있어요.
{: .important}
엔드포인트
GET /_plugins/_ml/memory/_search
POST /_plugins/_ml/memory/_search
예제 요청: 모든 메모리 검색
POST /_plugins/_ml/memory/_search
{
"query": {
"match_all": {}
},
"size": 1000
}
{% include copy-curl.html %}
예제 요청: 이름으로 메모리 검색
POST /_plugins/_ml/memory/_search
{
"query": {
"term": {
"name": {
"value": "conversation"
}
}
}
}
{% include copy-curl.html %}
예제 응답
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 3,
"relation": "eq"
},
"max_score": 0.2195382,
"hits": [
{
"_index": ".plugins-ml-memory-meta",
"_id": "znCqcI0BfUsSoeNTntd7",
"_version": 3,
"_seq_no": 39,
"_primary_term": 1,
"_score": 0.2195382,
"_source": {
"updated_time": "2024-02-03T20:36:10.252213029Z",
"create_time": "2024-02-03T20:30:46.395829411Z",
"application_type": null,
"name": "Conversation about NYC population",
"user": "admin"
}
},
{
"_index": ".plugins-ml-memory-meta",
"_id": "iXC4bI0BfUsSoeNTjS30",
"_version": 4,
"_seq_no": 11,
"_primary_term": 1,
"_score": 0.20763937,
"_source": {
"updated_time": "2024-02-03T02:59:39.862347093Z",
"create_time": "2024-02-03T02:07:30.804554275Z",
"application_type": null,
"name": "Test conversation for RAG pipeline",
"user": "admin"
}
},
{
"_index": ".plugins-ml-memory-meta",
"_id": "gW8Aa40BfUsSoeNTvOKI",
"_version": 4,
"_seq_no": 6,
"_primary_term": 1,
"_score": 0.19754036,
"_source": {
"updated_time": "2024-02-02T19:01:32.121444968Z",
"create_time": "2024-02-02T18:07:06.887061463Z",
"application_type": null,
"name": "Conversation for a RAG pipeline",
"user": "admin"
}
}
]
}
}
응답 본문 필드
다음 표는 모든 응답 필드를 정리한 거예요.
| 필드 | 데이터 타입 | 설명 |
|---|---|---|
memory_id |
String | 메모리 ID예요. |
create_time |
String | 메모리가 생성된 시간이에요. |
updated_time |
String | 메모리가 마지막으로 업데이트된 시간이에요. |
name |
String | 메모리 이름이에요. |
user |
String | 메모리를 생성한 사용자의 사용자 이름이에요. |