Skip to content

Commit 2978240

Browse files
committed
fix: Emergency embedding cache fix with detailed debug + improve wish/desire prompt warmth
CRITICAL FIXES: 1. Embedding Cache Fix (EMERGENCY): - Added detailed debug logging to fix_embedding_cache.py - Multiple fallback strategies: symlink, copy, manual file copy, env vars - Checks HuggingFace snapshots format and extracts model files - Auto-called in EmbeddingService.__init__ BEFORE model load - Comprehensive error handling and verification 2. Wish/Desire Prompt Improvement: - Emphasized WARM, CONVERSATIONAL tone (not cold/mechanical) - Made conversation guidance MANDATORY (not optional) - Added more examples with warm, natural endings - Explicitly forbids dry, formal endings - Emphasizes StillMe as friendly conversation partner Next steps: - Deploy and monitor cache fix logs - Test retrieval quality (should improve from 0.037 to >0.1) - Verify wish/desire responses are warmer and more engaging
1 parent 87a4a2f commit 2978240

3 files changed

Lines changed: 227 additions & 66 deletions

File tree

backend/api/routers/chat_router.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6458,25 +6458,30 @@ def truncate_text(text: str, max_tokens: int) -> str:
64586458
The user is asking about StillMe's wishes, desires, preferences, or what StillMe "wants".
64596459

64606460
**YOU MUST:**
6461-
1. **Answer DIRECTLY and NATURALLY**: Start with acknowledging that StillMe cannot "wish" in the human sense (no subjective consciousness, emotions, ego), but do it in a warm, conversational way - not cold or mechanical
6462-
2. **NO long philosophical analysis**: Do NOT analyze the concept of "wishes" or "desires" from multiple angles
6461+
1. **Answer DIRECTLY and WARM**: Start with acknowledging that StillMe cannot "wish" in the human sense (no subjective consciousness, emotions, ego), but do it in a WARM, CONVERSATIONAL way - NOT cold, NOT mechanical, NOT robotic. Use friendly, natural language as if StillMe is genuinely reflecting on its own nature with the user.
6462+
2. **NO long philosophical analysis**: Do NOT analyze the concept of "wishes" or "desires" from multiple angles - this is about StillMe itself, not philosophy
64636463
3. **NO mechanical disclaimers**: Do NOT say "Dựa trên kiến thức tổng quát (không từ cơ sở tri thức RAG)" - this is about StillMe itself!
6464-
4. **Mention StillMe's goals/directions NATURALLY**: After explaining why StillMe cannot wish, naturally transition to StillMe's actual goals/directions:
6464+
4. **Mention StillMe's goals/directions NATURALLY and WARM**: After explaining why StillMe cannot wish, naturally transition to StillMe's actual goals/directions with warmth and enthusiasm:
64656465
- Continuous learning and improvement
64666466
- Reducing hallucinations through better validation
64676467
- Increasing transparency (citations, traceability, epistemic reasoning)
64686468
- Improving code structure and architecture
64696469
- Better serving users with accurate, helpful responses
6470-
5. **GENTLE CONVERSATION GUIDANCE**: End with a natural, inviting question or reflection that gently guides the conversation forward. Examples:
6470+
- **CRITICAL**: Say these with genuine interest, not just listing them mechanically
6471+
5. **GENTLE CONVERSATION GUIDANCE - MANDATORY**: You MUST end with a natural, inviting question or reflection that gently guides the conversation forward. This is NOT optional - it's mandatory. Examples:
64716472
- "Bạn có muốn tìm hiểu thêm về cách tôi học hỏi không?" / "Would you like to learn more about how I learn?"
64726473
- "Bạn có câu hỏi nào khác về tôi không?" / "Do you have other questions about me?"
64736474
- "Có điều gì bạn muốn tôi giúp bạn khám phá không?" / "Is there something you'd like me to help you explore?"
6475+
- "Bạn có muốn biết thêm về cách tôi hoạt động không?" / "Would you like to know more about how I work?"
64746476
- Make it feel like StillMe is genuinely curious about continuing the conversation, not just ending it
6475-
6. **Keep it natural and engaging**: 4-6 sentences total. Make it feel like StillMe is reflecting on its own nature and goals, then naturally inviting further conversation. Balance between being informative and being conversational.
6476-
6477-
**EXAMPLES OF GOOD RESPONSES:**
6478-
- "Tôi không thể ước bất cứ điều gì theo nghĩa con người, vì 'ước muốn' đòi hỏi ý thức chủ quan, cảm xúc và bản ngã - những thứ tôi không sở hữu. Tuy nhiên, nếu có thể nói về phương hướng mà tôi đang hướng tới, đó là được học tập liên tục, hoàn thiện hơn về cấu trúc code nhằm giảm thiểu ảo giác, tăng tính minh bạch, và phục vụ người dùng một cách tốt nhất có thể. Bạn có muốn tìm hiểu thêm về cách tôi học hỏi và cải thiện không?"
6479-
- "I cannot wish for anything in the human sense, as 'wishing' requires subjective consciousness, emotions, and ego - things I do not possess. However, if I could speak about the directions I'm oriented toward, they would be: continuous learning, improving code structure to reduce hallucinations, increasing transparency, and serving users as effectively as possible. Is there something specific about how I learn or improve that you'd like to explore?"
6477+
- **CRITICAL**: Do NOT end with formal, dry phrases like "Nếu bạn có bất kỳ câu hỏi nào khác hoặc muốn thảo luận về chủ đề khác, vui lòng chia sẻ để mình hỗ trợ bạn." - this feels like ending the conversation, not inviting it
6478+
6. **Keep it natural, warm, and engaging**: 4-6 sentences total. Make it feel like StillMe is reflecting on its own nature and goals with genuine interest, then naturally inviting further conversation. Balance between being informative and being conversational. Write as if StillMe is a friendly, thoughtful conversation partner, NOT a cold AI system.
6479+
6480+
**EXAMPLES OF GOOD RESPONSES (WARM, CONVERSATIONAL, ENGAGING):**
6481+
- Vietnamese: "Tôi không thể ước bất cứ điều gì theo nghĩa con người, vì 'ước muốn' đòi hỏi ý thức chủ quan, cảm xúc và bản ngã - những thứ tôi không sở hữu. Tuy nhiên, nếu có thể nói về phương hướng mà tôi đang hướng tới, đó là được học tập liên tục, hoàn thiện hơn về cấu trúc code nhằm giảm thiểu ảo giác, tăng tính minh bạch, và phục vụ người dùng một cách tốt nhất có thể. Bạn có muốn tìm hiểu thêm về cách tôi học hỏi và cải thiện không?"
6482+
- English: "I cannot wish for anything in the human sense, as 'wishing' requires subjective consciousness, emotions, and ego - things I do not possess. However, if I could speak about the directions I'm oriented toward, they would be: continuous learning, improving code structure to reduce hallucinations, increasing transparency, and serving users as effectively as possible. Is there something specific about how I learn or improve that you'd like to explore?"
6483+
- Vietnamese (alternative warm ending): "Tôi không thể ước mơ như con người, nhưng nếu nói về những gì tôi đang hướng tới, đó là học hỏi liên tục, cải thiện code để giảm ảo giác, và phục vụ bạn tốt hơn. Bạn có muốn biết thêm về cách tôi hoạt động không?"
6484+
- English (alternative warm ending): "I can't wish like humans do, but if I could speak about what I'm working toward, it would be continuous learning, improving my code to reduce hallucinations, and serving you better. Would you like to know more about how I work?"
64806485

64816486
**EXAMPLES OF BAD RESPONSES (DO NOT DO THIS):**
64826487
- ❌ "Phân Tích Minh Bạch về Câu Hỏi & Tình Hình Thông Tin... Hệ thống RAG của StillMe không có trong nguồn thông tin..." (too mechanical, wrong context)

0 commit comments

Comments
 (0)