diff --git a/journey/plans/251016_emotion_integration_plan.md b/journey/plans/251016_emotion_integration_plan.md new file mode 100644 index 0000000..25000f7 --- /dev/null +++ b/journey/plans/251016_emotion_integration_plan.md @@ -0,0 +1,55 @@ +# 감정 분류기 Router 통합 계획 + +**날짜**: 2025-10-16 +**목표**: 감정 분석을 대화 흐름에 통합 + +--- + +## 구현 완료 + +**완료일**: 2025-10-16 +**커밋**: `413b1e0` (rb8001) +**상세**: `troubleshooting/251016_emotion_classifier_router_integration.md` + +### 완료 사항 +- ✅ 환경변수 추가: `USE_EMOTION_ANALYSIS` (config.py) +- ✅ Router 통합: `router.py:_call_internal_llm()`에서 감정 분석 실행 +- ✅ skill-embedding 연동: EmotionClassifier → HTTP API 호출 +- ✅ Context 전달: `user_emotion`, `emotion_confidence`를 LLM context에 추가 +- ✅ Graceful degradation: 실패 시 에러 로그만, 서비스 계속 작동 + +--- + +## 미구현: 감정 기반 응답 톤 자동 조정 + +### 현재 한계 +- 감정 분석 → LLM 프롬프트 전달만 +- 톤 조정은 LLM 자율 판단 (불안정) +- 명시적 규칙 없음 + +### 필요 작업 + +**감정-톤 매핑**: +```python +EMOTION_TONE_MAP = { + "fear": {"style": "reassuring", "emoji": False, "length": "short"}, + "anger": {"style": "calm", "emoji": False, "length": "medium"}, + "sadness": {"style": "empathetic", "emoji": True, "length": "medium"} +} +``` + +**LLM 시스템 프롬프트 동적 생성**: +- `services/llm/gemini_handler.py` 수정 +- 감정별 톤 지시 자동 삽입 +- 예: "사용자가 불안(fear)을 느낍니다. 안심시키는 톤으로 짧게 답변하세요." + +**A/B 테스트**: +- ON/OFF 비교 +- 사용자 만족도 측정 + +--- + +## 참고 + +- `troubleshooting/251016_emotion_router_integration.md` +- `311_FastAPI_구조_원칙.md` diff --git a/journey/plans/251017_intent_analysis_improvement_plan.md b/journey/plans/251017_intent_analysis_improvement_plan.md new file mode 100644 index 0000000..5894988 --- /dev/null +++ b/journey/plans/251017_intent_analysis_improvement_plan.md @@ -0,0 +1,79 @@ +# 로빙 의도 파악 개선 플랜 + +**날짜**: 2025-10-17 +**현재**: 정규식 패턴 매칭만 사용 + +--- + +## 현재 문제 + +### 처리 불가 사례 +| 질문 | 현재 처리 | 문제 | +|------|----------|------| +| "오늘 몇일이야?" | UNKNOWN | 시간 질문 패턴 없음 | +| "리버스마운틴 유사 기업 가치평가해줘" | UNKNOWN | 복잡한 멀티스텝 질문 | +| "아까 말한 그 기업 투자 단계는?" | UNKNOWN | 맥락 참조 불가 | + +**결론**: 단순 명령만 처리 가능, 복합 질문 처리 불가 + +--- + +## 개선 방향 (3단계 구조) + +**구현 완료**: `troubleshooting/251126_happybell80_rb8001_의도_3단계_아키텍처_도입_및_배포.md` + +**완료일**: 2025-11-26 +**커밋**: `a4738b9` (rb8001) + +### 완료 사항 +- ✅ 3단계 스키마 정의: `intent/schemas.py` (IntentCategory, IntentGoal, ActionPlan, SkillSequence) +- ✅ IntentAnalyzer 구현: LLM 기반 제로샷 의도 분석 +- ✅ ActionPlanner 구현: IntentGoal → ActionPlan 변환 +- ✅ SkillSelector 구현: ActionPlan → SkillSequence 변환 +- ✅ DecisionEngine 통합: `_build_intent_pipeline()` 메서드 추가, execution_plan에 intent_pipeline 메타데이터 포함 +- ✅ TDD 테스트: `tests/test_intent_3step_architecture.py` 통과 + +``` +1. 의도 파악 → 추상적 목표 (일정 관리, 정보 검색 등) +2. 행동 계획 → 구체적 행동 (등록, 조회, 삭제 등) +3. 스킬 선택 → 적절한 도구 (calendar_skill 등) +``` + +--- + +## 미구현: 하이브리드 시스템 + +### 제안 구조 +``` +사용자 메시지 + ↓ +1단계: 정규식 FastPath (명확한 패턴) + ↓ 실패 +2단계: 임베딩 후보 축소 (Top-3) + ↓ 확신도 < 0.7 +3단계: LLM 제로샷 분류 +``` + +### 필요 작업 + +**1. SemanticIntentClassifier 구현** +- 파일: `app/services/brain/semantic_classifier.py` +- intent_prototypes 테이블 활용 +- 임베딩 유사도로 Top-3 후보 선택 + +**2. LLM 폴백** +- Top-3 후보를 LLM에 전달 +- 확신도 < 0.5 시 CLARIFY + +**3. 성능 최적화** +- 정규식: 80% 케이스 (< 10ms) +- 임베딩: 15% 케이스 (< 200ms) +- LLM: 5% 케이스 (1-2s) + +--- + +## 참고 + +- `troubleshooting/251126_happybell80_rb8001_의도_3단계_아키텍처_도입_및_배포.md` +- `troubleshooting/251126_intent_3step_db_bayesian_integration.md` +- `311_FastAPI_구조_원칙.md` diff --git a/journey/plans/251225_admin_dashboard_code_refactoring.md b/journey/plans/251225_admin_dashboard_code_refactoring.md new file mode 100644 index 0000000..613c8f1 --- /dev/null +++ b/journey/plans/251225_admin_dashboard_code_refactoring.md @@ -0,0 +1,75 @@ +# Admin Dashboard 코드 리팩토링 계획 + +**날짜**: 2025-12-25 +**목표**: Monolithic 코드 분리 및 계층 구조 개선 +**원칙**: 311_FastAPI_구조_원칙.md, 313_React_구조_원칙.md + +--- + +## 현재 상태 + +### Frontend 문제점 +- `app.js`: 1132줄 (여전히 1000줄 이상) +- 일기 모듈만 분리됨 (`modules/diary.js`) +- 시스템, 컨테이너, 사용자, 로빙 모듈 미분리 + +### Backend 문제점 +- `admin_routes.py`: 96줄 (인증만 남음) ✅ +- 시스템 모듈 분리 완료 ✅ + +--- + +## 남은 작업 + +### Frontend 모듈 분리 (미완료) + +**목표 구조**: +``` +frontend/ +├── app.js # 메인 로직만 (~200줄) +├── services/ +│ └── api.js # API 통신 로직 (미구현) +├── utils/ +│ └── helpers.js # 유틸리티 함수 (미구현) +└── modules/ + ├── diary.js # 일기 관리 ✅ + ├── system.js # 시스템 모니터링 (미구현) + ├── containers.js # 컨테이너 관리 (미구현) + ├── users.js # 사용자/팀 관리 (미구현) + └── robeings.js # 로빙 관리 (미구현) +``` + +**분리 기준**: +- API 통신: `services/api.js` (apiCall, fetch 로직) +- 유틸리티: `utils/helpers.js` (markdownToHtml, showError, showLoadingBar 등) +- 기능별 모듈: `modules/*.js` (각 기능별 데이터 로딩 함수) +- 메인 로직: `app.js` (초기화, 네비게이션, 이벤트 핸들링) + +**원칙 준수**: +- 각 파일 300줄 이하 +- UI 렌더링과 비즈니스 로직 분리 +- API 통신 로직 분리 + +--- + +## 구현 완료 + +**완료일**: 2025-12-25 +**커밋**: `ac96e2a` (admin-dashboard) +**상세**: `troubleshooting/251225_admin_dashboard_code_refactoring.md` + +### 완료 사항 +- ✅ Backend 모듈 분리: `admin_routes.py` → `routers/system.py`, `services/system_service.py` +- ✅ 정적 파일 서빙: `routers/admin_static.py` 생성 +- ✅ Frontend 모듈화: `modules/diary.js` 분리, `app.js` 1360줄 → 1132줄 +- ✅ 로그인 오류 수정: `app.js:938` 문자열 결합 문법 오류 수정 +- ✅ 경로 매칭 문제 해결: `/diary/list` → `/diaries`로 변경 +- ✅ Gateway 프록시 호환성: 이중 경로 지원 + +--- + +## 참고 + +- `311_FastAPI_구조_원칙.md` +- `313_React_구조_원칙.md` +- `troubleshooting/251225_admin_dashboard_code_refactoring.md`