-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When reranking is enabled (ENABLE_RERANKING=True
, which is the default), the system fails with:
ValueError: Template is required for batch generation
File: rag_solution/generation/providers/watsonx.py:218
Root Cause
- Reranking is enabled by default in
core/config.py:143
LLMReranker
requires aPromptTemplateType.RERANKING
template from database- No reranking template exists in database for users (not seeded during initialization)
- Fallback to
SimpleReranker
exists in code but fails before it can trigger
Impact
- Severity: HIGH - Blocks all search operations when reranking enabled
- Workaround: Disable reranking (
ENABLE_RERANKING=False
)
Proposed Solutions
Option 1: Seed Default Reranking Template (Recommended)
Add reranking template to database initialization
Option 2: Hardcode Fallback Template
Add default template in LLMReranker.__init__()
Option 3: Better Fallback Logic
Fix SearchService.get_reranker()
to catch template errors earlier
Files Involved
backend/rag_solution/services/search_service.py:172-237
backend/rag_solution/retrieval/reranker.py:60-84
backend/rag_solution/generation/providers/watsonx.py:194-227
backend/core/config.py:143
Temporary Fix Applied
Changed default to ENABLE_RERANKING=False
in core/config.py:143
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working