Dual-path Recall + RRF Fusion
Retrieval Flow
Parameter Configuration
Fallback Strategy
Whenrank-bm25 or jieba is not installed, the system automatically falls back to vector-only search mode, using only pgvector for semantic retrieval. A log message is emitted: ⚠️ BM25 dependencies unavailable, using vector-only search mode.
BM25Store 3-tier Cache
The BM25 index uses a 3-tier cache architecture, supporting lazy loading and multi-instance deployments:Cache Tiers
Index Lifecycle
Index Data Structure
PostgreSQL Persistence Table
Multi-Knowledge-Base Retrieval
When a user associates multiple knowledge bases in a conversation, the system performs dual-path retrieval independently on each knowledge base, then merges all results sorted by score: Each knowledge base has its own independent BM25 index, with no interference between them.RAGService
RAGService is the service-layer wrapper for retrieval, providing: