IDEA-2/1/5/7: 스마트 알림, 대화 기반 RAG, CRAG, 파라미터 자동 튜닝

- IDEA-2 스마트 알림: td_reminders 테이블, set_reminder/list_reminders 도구,
  SchedulerService(asyncio 60초 루프, D-7/D-1/D-0 Telegram push),
  FastAPI lifespan 연동, GET /reminders/{user_id} 엔드포인트

- IDEA-1 대화 기반 RAG: IngestionService.store_text() 추가,
  AgentService._maybe_index_conversation() — 응답 후 LLM 판단 → Qdrant 저장
  (CONV_RAG_ENABLED=true 활성화, background task로 응답 속도 무관)

- IDEA-5 CRAG: AgentState에 crag_fallback_used 플래그 추가,
  crag_check LangGraph 노드 — search_documents 결과 없으면 web_search 자동 주입,
  route_after_crag으로 fallback 1회 루프 제어 (CRAG_ENABLED=true 활성화)

- IDEA-7 RAG Auto-Eval: eval/auto_tune.py — API 서버 없이 파라미터 조합별
  context_precision/recall 비교, 최적 설정 추천

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sal
2026-06-04 10:04:05 +09:00
parent c264573a67
commit 0b50444e43
11 changed files with 715 additions and 11 deletions
+14
View File
@@ -10,6 +10,8 @@ from services.db.mysql_service import DatabaseService
from services.db.conversation_repository import ConversationRepository
from services.db.user_profile_repository import UserProfileRepository
from services.db.feedback_repository import FeedbackRepository
from services.db.reminder_repository import ReminderRepository
from services.scheduler_service import SchedulerService
from services.ui.cli_service import CliUiService
from services.events.event_bus import EventBus
from services.events.handlers import StreamTokenHandler, StreamEndHandler
@@ -69,6 +71,18 @@ class Container(containers.DeclarativeContainer):
db=db_service,
)
reminder_repository = providers.Singleton(
ReminderRepository,
db=db_service,
)
scheduler_service = providers.Singleton(
SchedulerService,
reminder_repo=reminder_repository,
bot_token=providers.Callable(lambda c: c.telegram_bot_token, config),
user_map_json=providers.Callable(lambda c: c.telegram_user_map, config),
)
history_service = providers.Factory(
HistoryService,
system_prompt=providers.Callable(lambda c: c.system_prompt, config),