Spaces:
Running
Running
Deployment Fixes for RAG API v2.4
Issues Fixed
1. β
Qdrant order_by Error (FIXED IN CODE)
- Status: Fixed in commit
7110008 - Action: Already deployed, no action needed
2. β DuckDuckGo Decode Error (FIXED IN CODE)
- Status: Fixed with better error handling
- Action: Deploy latest code
- Details: System now gracefully handles decode errors and falls back to database
3. β οΈ Reranker Tokenizer Error (NEEDS DEPLOYMENT)
- Status: Fix ready, needs dependency upgrade
- Action: Run upgrade script (see below)
Deployment Steps
Option A: Automatic Upgrade (Recommended)
cd services/apis/rag-api
chmod +x upgrade_dependencies.sh
./upgrade_dependencies.sh
Option B: Manual Upgrade
pip install --upgrade FlagEmbedding>=1.2.11
pip install --upgrade transformers>=4.45.0
Option C: Fresh Install
cd services/apis/rag-api
pip install -r requirements.txt --upgrade
Verification
After deployment, check logs for:
β Success Indicators:
# No more Qdrant errors
β No "order_by not supported" warnings
# No more reranker errors
β No "XLMRobertaTokenizer has no attribute prepare_for_model" errors
# DuckDuckGo graceful handling
β "DuckDuckGo decode error (likely rate limit)" β Falls back to DB
β System continues working with database results
β If Still Broken:
# Check installed versions
pip show FlagEmbedding transformers
# Should show:
# FlagEmbedding: 1.2.11 or higher
# transformers: 4.45.0 or higher
# If not, force reinstall:
pip uninstall FlagEmbedding transformers -y
pip install FlagEmbedding==1.2.11 transformers==4.45.0
Testing
Test 1: Check Reranker
# Query the API and check logs
curl -X POST http://localhost:7860/api/v1/rag/chat/stream \
-H "Content-Type: application/json" \
-d '{"query": "Ethiopia news today"}'
# Check logs - should NOT see:
# β "Reranker scoring failed"
# Should see:
# β
"DEBUG: After hybrid ranking: 15 results"
Test 2: Check DuckDuckGo
# Query with temporal intent
curl -X POST http://localhost:7860/api/v1/rag/chat/stream \
-H "Content-Type: application/json" \
-d '{"query": "breaking news today"}'
# Check logs:
# β
"DEBUG: Hybrid search returned X DB + Y live results"
# If Y=0, check for:
# β
"DuckDuckGo decode error (likely rate limit)" β Graceful fallback
Test 3: Check News Endpoint
# Test browse endpoint
curl http://localhost:7860/api/v1/news/latest?limit=10
# Should return:
# β
200 OK with recent articles
# β
No 400 errors in logs
Rollback Plan
If issues occur after deployment:
# Rollback to previous versions
pip install FlagEmbedding==1.2.5 transformers==4.40.0
# Or rollback code
git revert 7110008
git push
Support
If issues persist:
- Check logs for specific error messages
- Verify Python version (should be 3.10+)
- Check if running in virtual environment
- Try fresh install in clean environment
Version History
- v2.4 (2026-05-04): Fixed Qdrant order_by, DuckDuckGo errors, upgraded reranker
- v2.3 (2026-05-04): Interactive thinking indicator with Lucide icons
- v2.2 (2026-05-03): Time-based filtering for news endpoint
- v2.1 (2026-05-03): Query enhancements and flexible prompting
- v2.0 (2026-05-02): Hybrid RAG with live search