-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Description
Enhance the hybrid search implementation with time-decay scoring and source weighting to improve search relevance and user experience.
Background
This enhancement extends Issue #58 (hybrid search) by adding sophisticated scoring factors that consider content freshness and source credibility, leading to more relevant search results.
Requirements
- Implement time-decay scoring:
score = α·sim + β·bm25 + γ·freshness + δ·source_weight - Add configurable weights for each scoring factor
- Implement namespace-specific boost factors
- Add source credibility scoring
- Add freshness calculation based on document timestamps
- Make scoring factors configurable via environment variables
- Add unit tests for scoring calculations
Implementation Details
Files to modify:
src/contextforge_memory/search/- Extend hybrid search servicesrc/contextforge_memory/config.py- Add scoring configurationsrc/contextforge_memory/main.py- Add scoring parameters to search endpointtests/- Add scoring testsREADME.md- Document scoring parameters
Technical approach:
- Extend existing hybrid search with additional scoring factors
- Add configuration for α, β, γ, δ weights
- Implement time-decay calculation based on document age
- Add source weighting based on namespace or metadata
- Create scoring explanation for debugging
Acceptance Criteria
- Time-decay scoring works correctly with configurable weights
- Source weighting improves result relevance
- All scoring factors are configurable
- Unit tests pass for scoring calculations
- Documentation explains scoring parameters
Testing Requirements
- Unit tests for each scoring factor
- Integration tests for combined scoring
- Performance tests for scoring overhead
- Relevance tests with sample data
Documentation Updates
- README.md - Document scoring parameters
- API documentation - Search scoring options
- Configuration guide - Scoring weights
- Examples - Scoring configuration
Related Issues
- Extends: [P2] Add hybrid search with BM25 + semantic vectors #58 (hybrid search)
- Depends on: None
- Blocks: None