Implement Query Expansion System with Comprehensive Testing
HYPERXD
02955c8
- Added `query_expansion_examples.py` to demonstrate practical usage of the Query Expansion system, showcasing various expansion strategies and their outputs.
- Created `test_query_expansion.py` to provide a comprehensive test suite for all components of the Query Expansion system, including QueryAnalyzer, QueryRephraser, MultiQueryExpander, MultiHopReasoner, and FallbackStrategies.
- Developed `utils/query_expansion.py` containing the core logic for query analysis, rephrasing, expansion, and fallback strategies, enhancing retrieval quality in the CogniChat RAG application.
- Included detailed examples and testing scenarios to ensure robust functionality and integration within the application.
feat: add comprehensive memory leak fixes and upgrade documentation
HYPERXD
ae279de
- Add SessionManager with TTL-based automatic cleanup (24h default)
- Add FileManager with automatic file cleanup and disk monitoring
- Implement background cleanup threads (every 5-10 minutes)
- Add /stats endpoint for server statistics and monitoring
- Add /cleanup endpoint for manual session cleanup
- Add cleanup on server shutdown via atexit
- Create comprehensive documentation:
* MEMORY_LEAK_FIX.md - Technical explanation
* MEMORY_LEAK_FIX_SUMMARY.md - Executive summary
* IMPLEMENTATION_GUIDE.md - Step-by-step instructions
* CODE_CHANGES_BEFORE_AFTER.md - Code comparison
* IMPLEMENTATION_CHECKLIST.md - Implementation tracking
* ARCHITECTURE_DIAGRAMS.md - Visual architecture
- Add test_memory_leak_fix.py with 14 unit + integration tests
- Include upgrade documentation for project improvements
- Fix CRITICAL memory leak: RAG chains stored indefinitely
- Fix CRITICAL memory leak: Uploaded files stored indefinitely
- Add production-ready session and file management
Resolv…