Retrieval Strategies Module
The retrieval module provides various strategies for finding relevant documents from the knowledge base.Quick Start
Retrieval Strategies
RetrievalStrategy Enum
Strategy Descriptions
Classes
RetrievalResult
Dataclass for retrieval results.RetrieverProtocol
Protocol for retriever implementations.Utility Functions
reciprocal_rank_fusion
Combine results from multiple retrievers using RRF.merge_adjacent_chunks
Merge consecutive chunks from the same document.Using with Knowledge
Creating Custom Retrievers
Thread Safety
RetrieverRegistry is a thread-safe singleton — register, get, list_retrievers, and clear are all guarded by an internal lock, and concurrent get_retriever_registry() calls always return the same instance.
Safe to call from multiple agents at once — no external locking required. Since PraisonAI #5197.
Performance
- All utility functions are pure Python (no external deps)
- RRF fusion is O(n log n) where n is total results
- Chunk merging is O(n) with single pass
RetrieverRegistryoperations acquire a lightweight lock — negligible overhead in single-threaded use, noKeyErroror iteration errors under concurrent register/clear

