Team B: 전략 라우팅

분석 대상

on_message_added 메서드의 4가지 메모리 전략 라우팅 로직

전략 라우팅 흐름

def on_message_added(self, event: MessageAddedEvent):
    user_query = messages[-1]["content"][0]["text"].lower()

    # 키워드 기반 전략 선택
    if "permission" in user_query and "architecture" in user_query:
SEMANTIC MEMORY

    elif "sop" in user_query:
USER PREFERENCE MEMORY

    elif "check connectivity" in user_query:
SEMANTIC MEMORY + TOOL CALLING

    elif "system crashed" in user_query or "where were we" in user_query:
SUMMARIZATION MEMORY

4가지 전략 상세

전략 1: Semantic Memory (Q1: 권한 + 아키텍처)

항목

트리거

"permission" AND "architecture"

네임스페이스

examplecorp/user/{actor_id}/facts

용도

사용자 권한, 플랫폼 아키텍처 정보

예시 쿼리

"What are my permissions and tell me about the architecture?"

전략 2: User Preference Memory (Q2: SOP)

항목

트리거

"sop"

네임스페이스

examplecorp/user/{actor_id}/preferences

용도

운영 절차, 커뮤니케이션 선호도

예시 쿼리

"Give me the SOP for database connectivity issues"

전략 3: Semantic + Tool Calling (Q3: 연결 확인)

항목

트리거

"check connectivity"

네임스페이스

examplecorp/user/{actor_id}/facts

용도

사실 정보 참조 + 실제 도구 실행

예시 쿼리

"Check connectivity between reporting and database"

특수 동작

메모리 컨텍스트 로드 후 도구 호출도 강제

전략 4: Summarization Memory (Q4: 세션 복구)

항목

트리거

"system crashed" OR "where were we"

네임스페이스

examplecorp/user/{actor_id}/{session_id}

용도

이전 세션의 분석 결과 복원

예시 쿼리

"System crashed, where were we?"

특수 동작

도구 호출 금지, 메모리만 사용

메모리 검색 핵심 메서드

대화 자동 저장

토론 질문

  1. "permission"과 "architecture" 둘 다 포함되어야 하는 이유는?

  2. 키워드 매칭이 실패하면 어떤 전략이 적용되나요? (기본값?)

  3. Summarization Memory에서 도구 호출을 금지하는 이유는?

  4. top_k=3의 값을 변경하면 응답 품질에 어떤 영향이 있나요?

마지막 업데이트