단계 2: 메모리 전략 구성

circle-exclamation

sudo password 요구시 콘솔 > CloudFormation > vscode > output 를 참고하십시오.

AgentCore Memory 생성

세 가지 메모리 전략을 포함한 Memory 리소스를 생성합니다:

python3 scripts/setup_memory.py
chevron-right🔍 이 스크립트는 무엇을 하나요?hashtag
  1. AgentCore Memory 리소스 "ExampleCorpImageGallery" 생성

  2. 3가지 메모리 전략 구성: Semantic(벡터 임베딩), User Preference, Summary

  3. 네임스페이스 패턴 설정 (examplecorp/user/{actor_id}/*)

  4. Amazon Titan Embed V2 임베딩 모델 연결

circle-info

메모리 생성에 약 3-4분이 소요됩니다. 완료될 때까지 기다려주세요.

검증

콘솔 검증

Amazon Bedrock AgentCore Memory 콘솔arrow-up-right로 이동하여 ExampleCorpImageGallery 메모리를 확인합니다.

세 가지 전략 유형이 구성되어 있는지 확인합니다:

전략
설명

Semantic Memory

벡터 임베딩 기반 사실 정보 저장

User-Preference Memory

사용자별 선호도 추적

Summary Memory

대화 요약 생성

ImageCorp Memory

코드 분석: 메모리 전략 구성

메모리 구성 파라미터

네임스페이스 구조

전략
네임스페이스 패턴
저장 데이터 예시

Semantic

examplecorp/user/{actor_id}/facts

"reporting 서버는 VPC-A에 있고 database는 VPC-B에 있습니다"

User Preference

examplecorp/user/{actor_id}/preferences

"SOP: 1. CloudWatch 확인 → 2. 연결성 분석 → 3. 수정"

Summary

examplecorp/user/{actor_id}/{session_id}

"이전 세션에서 PathID: nip-xxx로 분석 완료, SG 수정 필요"

벡터 임베딩 동작 원리

circle-info

핵심 포인트: 메모리 전략은 AgentCore가 자동으로 관리합니다. 에이전트 코드에서는 MemoryHook을 통해 저장/조회만 하면, 적절한 전략이 자동 적용됩니다.

circle-check

마지막 업데이트