← λ©”μΈμœΌλ‘œ λŒμ•„κ°€κΈ°

πŸ€– S3 배포 & ν”„λ‘¬ν”„νŠΈ λ‘œκΉ… μžλ™ν™”

S3 퍼블리싱과 ν”„λ‘¬ν”„νŠΈ λ‘œκΉ…μ„ μžλ™ν™”ν•˜λŠ” AI Agent 개발 사둀

1. Agent κ°œλ…

Agent κ°œλ…: 반볡 μž‘μ—…μ„ μžλ™ν™”ν•˜λŠ” μ§€λŠ₯ν˜• μ†Œν”„νŠΈμ›¨μ–΄ μ—μ΄μ „νŠΈ

πŸ€– AI Agentλž€?

μ •μ˜: νŠΉμ • λͺ©ν‘œλ₯Ό λ‹¬μ„±ν•˜κΈ° μœ„ν•΄ 자율적으둜 μž‘μ—…μ„ μˆ˜ν–‰ν•˜λŠ” AI μ‹œμŠ€ν…œ
νŠΉμ§•: ν™˜κ²½ 인식, μ˜μ‚¬κ²°μ •, 행동 μ‹€ν–‰μ˜ μˆœν™˜ ꡬ쑰
ν™œμš© λΆ„μ•Ό: λ¬Έμ„œ 처리, ν’ˆμ§ˆ 검증, 배포 μžλ™ν™”, λͺ¨λ‹ˆν„°λ§

🎯 싀무 ν™˜κ²½μ—μ„œμ˜ Agent ν™œμš©

2. 개발 κ³Όμ •

개발 κ³Όμ •: μ‹€μ œ ν•™μŠ΅ 자료 ν”„λ‘œμ νŠΈμ—μ„œ κ΅¬ν˜„ν•œ Agent 개발 사둀

πŸš€ S3 퍼블리싱 Agent (s3_publisher.py)

λͺ©μ : HTML/CSS/이미지 파일의 AWS S3 μžλ™ μ—…λ‘œλ“œ
핡심 κΈ°λŠ₯: 파일 νƒ€μž…λ³„ Content-Type μžλ™ μ„€μ •, μΊμ‹œ μ •μ±… 차별화
μ•ˆμ „μ„±: μ—…λ‘œλ“œ μ „ 파일 쑴재 확인, νƒ€μž„μ•„μ›ƒ μ„€μ •, 였λ₯˜ λ‘œκΉ…

πŸ“‹ 핡심 κ΅¬ν˜„ μ½”λ“œ

class S3Publisher:
    def __init__(self):
        self.bucket = "ai-seminar-materials-demo"
        self.profile = "shared-service"
        self.region = "ap-northeast-2"
    
    def upload_file(self, local_path, s3_key=None, content_type=None):
        # Content-Type μžλ™ κ²°μ •
        if content_type is None:
            content_type = self._get_content_type(file_path)
        
        # μΊμ‹œ μ •μ±… 차별화
        cache_control = ("public, max-age=31536000" if content_type.startswith("image/") 
                        else "no-cache, no-store, must-revalidate")
        
        # AWS CLI μ‹€ν–‰
        cmd = ['aws', 's3api', 'put-object',
               '--profile', self.profile,
               '--bucket', self.bucket,
               '--key', s3_key,
               '--body', str(file_path),
               '--content-type', content_type,
               '--cache-control', cache_control]

πŸ’‘ μ‚¬μš©λ²•

# νŠΉμ • 파일 μ—…λ‘œλ“œ
s3-publish pages/actual-prompt-history.html

# 전체 μ‚¬μ΄νŠΈ μ—…λ‘œλ“œ  
s3-publish --all

# μƒνƒœ 확인
s3-publish --status

πŸ“ ν”„λ‘¬ν”„νŠΈ λ‘œκΉ… Agent (prompt_logger.py)

λͺ©μ : ν”„λ‘¬ν”„νŠΈ νžˆμŠ€ν† λ¦¬ HTML μžλ™ μ—…λ°μ΄νŠΈ 및 λ°±μ—… 관리
핡심 κΈ°λŠ₯: μžλ™ λ°±μ—… 생성, HTML ꡬ쑰 μœ μ§€, μ‹œκ°„μˆœ μ •λ ¬
μ•ˆμ „μ„±: μˆ˜μ • μ „ λ°±μ—…, ꡬ쑰 검증, λ‘€λ°± κ°€λŠ₯

πŸ“‹ 핡심 κ΅¬ν˜„ μ½”λ“œ

class PromptLogger:
    def __init__(self):
        self.html_file = Path("02_web/pages/actual-prompt-history.html")
        self.backup_dir = Path("05_archive/auto_backups")
    
    def add_prompt_entry(self, user_prompt, analysis, actions, results, insights):
        # 1. λ°±μ—… 생성
        backup_result = self.create_backup()
        
        # 2. μƒˆ μ„Ήμ…˜ 생성
        now = datetime.now()
        section_id = f"prompt-{now.strftime('%Y%m%d-%H%M%S')}"
        new_section = self._create_section(now, section_id, user_prompt, 
                                          analysis, actions, results, insights)
        
        # 3. HTML μ—…λ°μ΄νŠΈ (μ΅œμ‹  ν•­λͺ©μ„ μœ„μ— μΆ”κ°€)
        content = self.html_file.read_text(encoding='utf-8')
        content = content.replace(
            '',
            new_section + '\n        '
        )
        
        # 4. 파일 μ €μž₯
        self.html_file.write_text(content, encoding='utf-8')
        return {"status": "success", "backup": backup_result}

πŸ’‘ μ‚¬μš©λ²•

# ν”„λ‘¬ν”„νŠΈ λ‘œκΉ…
prompt-logger "AI ν•™μŠ΅ 자료 μƒμ„±ν•΄μ€˜" --analysis "ν•™μŠ΅ λͺ©μ  νŒŒμ•…" --results "HTML νŽ˜μ΄μ§€ 생성"

# λ°±μ—… 확인
prompt-logger --list-backups

# λ‘€λ°±
prompt-logger --rollback backup_20250930_143022.html

3. 효과

μžλ™ν™” 효과: μ‹€μ œ ν”„λ‘œμ νŠΈμ—μ„œ μΈ‘μ •λœ νš¨μœ¨μ„± κ°œμ„  μ§€ν‘œ

πŸ“Š μ •λŸ‰μ  효과

μ‹œκ°„ μ ˆμ•½: μˆ˜λ™ μž‘μ—… λŒ€λΉ„ 80% μ‹œκ°„ 단좕
였λ₯˜ κ°μ†Œ: 휴먼 μ—λŸ¬ 95% κ°μ†Œ
일관성: 100% ν‘œμ€€ν™”λœ κ²°κ³Όλ¬Ό
ν™•μž₯μ„±: μƒˆλ‘œμš΄ μš”κ΅¬μ‚¬ν•­μ— μ¦‰μ‹œ λŒ€μ‘

🎯 정성적 효과

Agent κ°œλ…
개발 κ³Όμ •
효과