fix: Diagnose and fix RAG system query failures#160
Open
sjsh-jason wants to merge 8 commits intohttps-deeplearning-ai:mainfrom
Open
fix: Diagnose and fix RAG system query failures#160sjsh-jason wants to merge 8 commits intohttps-deeplearning-ai:mainfrom
sjsh-jason wants to merge 8 commits intohttps-deeplearning-ai:mainfrom
Conversation
- Fixed empty vector store issue by auto-loading courses on startup - Added comprehensive diagnostic tests and reports - Improved error handling and logging - Added test suite for RAG components Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add language detection to identify Chinese vs English queries - Store language preference per session for consistency - Add Chinese system prompt for Claude API - Automatically respond in the detected language Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
… selection Implement frontend language selector button in top-left corner with Chinese/English toggle. Add i18n.js with complete translations for all UI elements. Update backend API to support user-selected language preference with priority: user selection > session language > auto-detection. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…tion When user selects Chinese language, suggested questions now display and send Chinese text instead of English. Added translations for all four suggested questions in i18n.js and updated script.js to use language-specific questions based on current language preference. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add /api/upload-course endpoint for uploading .txt course files - Add file upload UI in sidebar with upload button and status display - Update import paths in app.py to use relative imports - Enable CORS middleware for cross-origin requests - Add test route for debugging Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add .claude/commands directory for Claude Code commands - Add backend-tool-refactor.md for refactoring notes - Add test_course.txt for testing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
backend/app.pyto auto-load course documents during startupDIAGNOSTIC_REPORT.mdandFINAL_DIAGNOSTIC_SUMMARY.mdbackend/tests/with:test_search_tools.py- Tests for CourseSearchTooltest_ai_generator.py- Tests for AIGeneratortest_rag_system.py- Tests for RAGSystemrun_diagnostics.py- Integration diagnostic scripttest_query_flow.py- Query flow analysisTest plan
/api/coursesendpoint returns course list/api/queryendpoint returns responsesRoot Cause Analysis
The "query failed" error was caused by an empty vector store. The
startup_event()function was skipping document loading, so no course data was available for the search tool to find.🤖 Generated with Claude Code