diff --git a/ai-service/app/api/chat.py b/ai-service/app/api/chat.py index f0a7828..97ed5e6 100644 --- a/ai-service/app/api/chat.py +++ b/ai-service/app/api/chat.py @@ -32,12 +32,12 @@ async def get_orchestrator_service_with_memory( Ensures each request has a fresh MemoryService with database session. """ from app.services.llm.factory import get_llm_config_manager - from app.services.retrieval.vector_retriever import get_vector_retriever + from app.services.retrieval.optimized_retriever import get_optimized_retriever memory_service = MemoryService(session) llm_config_manager = get_llm_config_manager() llm_client = llm_config_manager.get_client() - retriever = await get_vector_retriever() + retriever = await get_optimized_retriever() return OrchestratorService( llm_client=llm_client, diff --git a/ai-service/app/services/orchestrator.py b/ai-service/app/services/orchestrator.py index fde1158..79d0d7c 100644 --- a/ai-service/app/services/orchestrator.py +++ b/ai-service/app/services/orchestrator.py @@ -402,6 +402,12 @@ class OrchestratorService: messages.extend(ctx.merged_context.messages) messages.append({"role": "user", "content": ctx.current_message}) + + logger.info( + f"[AC-AISVC-02] Built {len(messages)} messages for LLM: " + f"system_len={len(system_content)}, history_count={len(ctx.merged_context.messages) if ctx.merged_context else 0}" + ) + logger.debug(f"[AC-AISVC-02] System prompt preview: {system_content[:500]}...") return messages