콘텐츠로 이동

관리 API

에이전트가 실행 중일 때 Agent Card URL 변경, 메모리 설정 변경, 세션 조회/삭제 등을 재시작 없이 수행할 수 있는 관리 API입니다.

  • AGENT_ID: 에이전트 식별자 (CLI scaffold 시 자동 설정, .env에서 변경 가능)
  • INTERNAL_RUNTIME_CONTROL_ENABLED=true: Registry 관리 API(/api/v1/registry/*) 활성화에 필요
  • 메모리 관리 API(/api/v1/memory/*)는 INTERNAL_RUNTIME_CONTROL_ENABLED와 무관하게 항상 등록됩니다

모든 엔드포인트는 동일한 envelope 구조를 사용합니다.

// 성공
{"success": true, "data": {...}, "error": null}
// 에러
{"success": false, "data": null, "error": {"code": "...", "message": "...", ...}}

HTTP 상태 코드: 200 성공, 400 잘못된 요청, 403 권한 없음, 404 리소스 없음, 409 충돌, 422 처리 불가.

MCP/A2A 연결 상태와 에이전트 ID를 조회합니다.

Terminal window
curl http://localhost:8000/api/v1/status
{"success": true, "data": {"agent_id": "my-agent", "mcp": {}, "a2a": {}}, "error": null}

하위 호환 경로: GET /status


현재 agent-card에 설정된 공개 URL을 조회합니다.

Terminal window
curl http://localhost:8000/api/v1/card/url
{"success": true, "data": {"url": "http://10.10.20.22:24002/admin/a2a/my-agent"}, "error": null}

agent-card의 공개 URL을 런타임에 변경합니다. 프록시/게이트웨이 주소가 변경되었을 때 재시작 없이 즉시 반영합니다.

필드타입필수설명
urlstring필수새 공개 URL
Terminal window
curl -X PATCH http://localhost:8000/api/v1/card/url \
-H "Content-Type: application/json" \
-d '{"url": "http://new-proxy:8080/admin/a2a/my-agent"}'
{
"success": true,
"data": {
"url": "http://new-proxy:8080/admin/a2a/my-agent",
"previous_url": "http://10.10.20.22:24002/admin/a2a/my-agent",
"persisted": true
},
"error": null
}
응답 필드설명
url변경된 URL
previous_url변경 전 URL
persisted.envPUBLIC_AGENT_URL이 동기화되었는지 여부. false이면 재시작 시 원복됩니다

현재 메모리 설정을 조회합니다.

Terminal window
curl http://localhost:8000/api/v1/memory/config

런타임에 메모리 설정을 변경합니다. 에이전트 재시작 없이 즉시 반영됩니다.

필드런타임 변경설명
summarize가능장기 기억 요약 활성화
window_size가능LLM에 전달할 최근 메시지 수
summarize_threshold가능요약 트리거 메시지 수
enabled불가체크포인터/그래프 재빌드 필요
backend불가커넥션 풀 재생성 필요
postgres_dsn불가커넥션 풀 재생성 필요
Terminal window
curl -X PATCH http://localhost:8000/api/v1/memory/config \
-H "Content-Type: application/json" \
-d '{"summarize": true, "window_size": 10}'

모든 thread 관리 API는 AGENT_ID 기반 소유권 검증을 수행합니다. 다른 에이전트가 소유한 thread에 접근하면 FORBIDDEN (403) 에러가 반환됩니다.

자기 에이전트가 소유한 thread 목록을 반환합니다.

Terminal window
curl http://localhost:8000/api/v1/memory/threads
{"success": true, "data": {"agent_id": "my-agent", "threads": ["session-001", "session-002"]}, "error": null}

GET /api/v1/memory/threads/{thread_id}/messages

섹션 제목: “GET /api/v1/memory/threads/{thread_id}/messages”

특정 세션의 채팅 기록을 조회합니다.

Terminal window
curl http://localhost:8000/api/v1/memory/threads/session-001/messages
{
"success": true,
"data": {
"thread_id": "session-001",
"messages": [
{"role": "human", "content": "안녕"},
{"role": "ai", "content": "안녕하세요!"}
]
},
"error": null
}

특정 세션의 모든 데이터(checkpoint + persistent_memory)를 삭제합니다.

Terminal window
curl -X DELETE http://localhost:8000/api/v1/memory/threads/session-001

이 에이전트가 소유한 모든 thread를 삭제합니다. AGENT_ID 기반으로 자기 데이터만 삭제되므로 공유 DB에서도 안전합니다.

Terminal window
curl -X DELETE "http://localhost:8000/api/v1/memory/threads?all=true"
{"success": true, "data": {"agent_id": "my-agent", "deleted": {"checkpoints": 10, "checkpoint_blobs": 20, "persistent_memory": 5}}, "error": null}

AGENT_ID 변경 시 기존 thread의 소유권을 일괄 갱신합니다.

Terminal window
curl -X POST http://localhost:8000/api/v1/memory/migrate-agent-id \
-H "Content-Type: application/json" \
-d '{"old_id": "my-agent-old", "new_id": "my-agent"}'
{"success": true, "data": {"old_id": "my-agent-old", "new_id": "my-agent", "migrated_threads": 5}, "error": null}

INTERNAL_RUNTIME_CONTROL_ENABLED=true 설정이 필요합니다.

Registry 참조 목록과 generation을 조회합니다.

하위 호환 경로: GET /internal/runtime-metadata

변경된 Registry 컴포넌트를 핫리로드합니다.

하위 호환 경로: POST /internal/reload


코드HTTP설명
MEMORY_DISABLED404메모리가 활성화되어 있지 않음
AGENT_ID_REQUIRED409AGENT_ID 환경변수 미설정
IMMUTABLE_FIELD422런타임 변경 불가 필드 요청
INVALID_BODY400요청 본문이 유효한 JSON이 아님
INVALID_PARAM400필수 파라미터 누락 또는 잘못된 타입
MISSING_THREAD_ID400thread_id 누락
THREAD_NOT_FOUND404해당 thread_id 데이터 없음
FORBIDDEN403다른 에이전트 소유의 thread
RUNTIME_UNAVAILABLE409Registry 런타임을 사용할 수 없음