Repository navigation
feat: Evidence Research Agent를 AgentCore Gateway(MCP)로 연결 + Lambda 웜업 버그 수정 - #83
Merged
Merged
Conversation
… Lambda warmup Evidence Research Agent's tools now have two code paths, chosen by whether evidence_research_gateway_url is set (empty by default, so nothing changes for existing callers): - unset: in-process @tool functions (existing behavior) - set: connects to the deployed AgentCore Gateway over MCP (mcp-proxy-for-aws's aws_iam_streamablehttp_client handles SigV4 signing), calling the same 7 tools remotely via kure_retriever Lambda Verified for real against the deployed prod Gateway: listed all 7 tools with their qualified names, and called resolve_ontology_synonyms end to end (Gateway -> Lambda -> ontology.yaml, real response). Also found and fixed a real bug while testing search_korean_evidence live: the Lambda's warmup ping short-circuited before ever loading the KURE-v1 embedding model, so it kept every container "warm" without the model actually loaded. Every real search call then paid full cold-load time (measured 60s+, exceeding the Gateway's own ~30s tool-call timeout) even on a supposedly warm container. The warmup handler now actually calls _get_embedding_model().predict(["ping"]) so the model is cached in the process for subsequent real invocations.
jeongmin1999
self-requested a review
July 4, 2026 05:36
jeongmin1999
approved these changes
Jul 4, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
Evidence Research Agent의 7개 검색 tool을 AgentCore Gateway(MCP, AWS_IAM 인증) 경유로 원격 호출할 수 있게 합니다 (Infra PR #390에서 만든 Gateway/Lambda 대상).
evidence_research_gateway_url설정값이 비어있으면(기본값) 기존처럼 in-process tool 그대로 사용 — 기존 동작 변경 없음mcp-proxy-for-aws의aws_iam_streamablehttp_client(SigV4 자동 서명)로 Gateway에 연결해 같은 7개 tool을 원격 호출run_report_generation()을 in-process로 호출합니다 - 이건 별도 작업입니다.실제 prod Gateway로 검증하며 발견한 버그 수정
fetch/resolve_ontology_synonyms같은 DB/모델 안 쓰는 tool은 바로 됐는데,search_korean_evidence(KURE 모델 로딩 + DB 필요)가 계속 실패했습니다:30초)을 넘겨버렸습니다 (prod 로그로 확인: 콜드 60180초+, 로컬 RIE 재현으로는 ~20초 - 차이는 VPC ENI 콜드스타트로 추정)_get_embedding_model().predict(["ping"])를 실제로 호출해 모델을 로드/캐싱하도록 변경검증
resolve_ontology_synonyms실제 호출 성공 확인search_korean_evidence(DB 포함) 10.4초 - 전부 프로덕션 배포 없이 검증pytest tests/179 passed,ruff check통과Test plan
search_korean_evidence등 DB+모델 필요한 tool도 Gateway 경유로 성공하는지 재확인 필요