메모리에서 대화 컨텍스트를 구성합니다. (기본값 소스: 에피소드, 시맨틱; 최근 턴을 위해 enabled_sources에 stm을 포함합니다.) 프로젝트 범위는 경로 ID 매개 변수에 의해 전달되며 조직은 해당 프로젝트에서 파생됩니다. 빈 값이 아닌 쿼리(일반적으로 최신 사용자 메시지)와 메모리를 조립할 user_id를 입력하세요.
body
필수 사항
컨텍스트 빌드 요청
-
EnabledSources는 메모리 소스(stm, 에피소드, 의미, 분류, 절차)를 선택합니다. 생략된 경우 기본값으로 에피소드 및 의미가 선택됩니다.
-
MaxTokens는 총 컨텍스트 구성 예산입니다(가져오기 비용이 아닙니다). 검색 및 순위 지정 후 메모리 서버는 500토큰 서식 지정 예비 공간을 빼낸 다음 적합한 전체 메모리 청크를 탐욕적으로 선택합니다. 500 이하의 양수 값은 메모리에 대한 예산을 남기지 않습니다. 500 보다 큰 값은 청크가 맞지 않을 때도 빈 문맥을 생성할 수 있습니다.
최소값은
1입니다. -
추가 속성이 허용됩니다.
-
최소값은
1, 최대값은200입니다.
게시 /api/v1/프로젝트/{id}/memory/context
curl \
--request POST 'https://agentengine.mongodb.com/api/v1/projects/{id}/memory/context' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--data '{
"enabled_sources": [
"string"
],
"format_style": "string",
"include_memories": true,
"max_tokens": 42,
"metadata_filter": {},
"model_type": "string",
"query": "string",
"query_embedding": [
42.0
],
"session_id": "string",
"similarity_threshold": 42.0,
"top_k": 42,
"user_id": "string",
"visibility": "string"
}'
요청 예시
{
"enabled_sources": [
"string"
],
"format_style": "string",
"include_memories": true,
"max_tokens": 42,
"metadata_filter": {},
"model_type": "string",
"query": "string",
"query_embedding": [
42.0
],
"session_id": "string",
"similarity_threshold": 42.0,
"top_k": 42,
"user_id": "string",
"visibility": "string"
}
응답 예시(406)
작업을 사용할 수 없습니다.
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "This operation supports text/event-stream, which the Accept header excludes. Remove unsupported media-type parameters or accept this type with a positive q value.",
"error": 406,
"errorCode": "UNACCEPTABLE_MEDIA_TYPE",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
{
"detail": "The requested API version is not supported. Supported versions: 2026-09-20-preview.",
"error": 406,
"errorCode": "UNSUPPORTED_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
응답 예시(406)
{
"detail": "This operation is not available in API version 2026-09-20-preview.",
"error": 406,
"errorCode": "OPERATION_NOT_IN_API_VERSION",
"parameters": [
"Accept"
],
"reason": "Not Acceptable"
}
응답 예시(200)
{}
응답 예시(200)
{}
응답 예시(400)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(400)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(401)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(401)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(403)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(403)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(500)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(500)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(502)
{
"code": "string",
"error": "string",
"success": true
}
응답 예시(502)
{
"code": "string",
"error": "string",
"success": true
}