Spaces:
Running
Running
Commit History
-
feat: Add query enhancements and flexible prompting (v2.1)
Major improvements to RAG pipeline: 1. Language Detection - Auto-detect query language (en, ar, am, so, sw, fr) - Script-based detection for Arabic/Amharic (100% accurate) - Pattern and langdetect fallbacks for other languages - Cached results for performance 2. Query Expansion & Enhancement - Expand short/vague queries for better results - Automatic typo correction (ethopia -> ethiopia) - Entity extraction (locations, organizations, dates) - Auto-detect source filters from query - LLM-based expansion with caching 3. Confidence-Based Search Strategies - High confidence (>0.8): Aggressive strategies - Medium confidence (0.6-0.8): Moderate strategies - Low confidence (<0.6): Safe, balanced strategies - Reduces cost and errors on uncertain queries 4. Flexible LLM Prompting - Offers related information instead of just 'not found' - Three response modes: direct match, related info, no info - Prioritizes high-authority sources (BBC, Reuters…6246bba