#18919: feat: importance-weighted temporal decay for memory search
size: M
Cluster:
Memory Management Enhancements
## Summary
Adds an optional importance-weighted boost to the temporal decay system, so emotionally significant or important memories decay slower in search results.
## Changes
- Extended `TemporalDecayConfig` with optional `importanceBoost` settings
- Added `ImportanceBoostConfig` type with configurable boost factor and pattern matching
- `isImportantChunk()` detects importance via file path patterns and content markers (`<!-- important -->`, `**IMPORTANT**`, `[!important]`)
- Important memories have their effective age divided by the boost factor (default 3x), making them decay slower
- Fully backwards-compatible: importance boost is disabled by default
- Added 8 new test cases
## How it works
When enabled, the system checks each memory chunk against configurable patterns:
- **File patterns**: e.g., `MEMORY.md` files
- **Content markers**: inline markers like `<!-- important -->` in the snippet
Matching chunks get their effective age divided by `boostFactor`, so a 90-day-old important memory with factor 3 decays as if it were only 30 days old.
## Configuration
```ts
temporalDecay: {
enabled: true,
halfLifeDays: 30,
importanceBoost: {
enabled: true,
boostFactor: 3,
patterns: {
contentMarkers: ['<!-- important -->', '**IMPORTANT**', '[!important]'],
filePatterns: ['MEMORY.md'],
},
},
}
```
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds an optional importance-weighted boost to the temporal decay system for memory search. When enabled, chunks matching configurable file path patterns (e.g., `MEMORY.md`) or content markers (e.g., `<!-- important -->`) have their effective age divided by a configurable `boostFactor`, causing them to decay slower in search results.
- New `ImportanceBoostConfig` and `ImportanceBoostPatterns` types with defaults
- `isImportantChunk()` function for pattern-based importance detection (case-insensitive)
- Importance boost integrated into `applyTemporalDecayToHybridResults` with proper guards (`enabled` check, `boostFactor > 1`)
- Fully backwards-compatible: disabled by default, generic constraint change (`snippet?: string`) is non-breaking
- 8 new test cases with good edge case coverage (disabled state, `boostFactor=1` no-op, integration with hybrid merge)
- Note: the default `MEMORY.md` file pattern in importance boost config is effectively a no-op for `source: "memory"` entries since evergreen memory paths already skip decay entirely via `extractTimestamp` returning `null`
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — the feature is disabled by default and the logic is well-guarded.
- Clean, focused implementation with proper feature flag (disabled by default), guard against division by zero/no-op (`boostFactor > 1`), and comprehensive test coverage. No breaking changes to the generic constraint or config shape. Only minor style issue found (redundant type assertion).
- No files require special attention.
<sub>Last reviewed commit: e1b8d73</sub>
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#20194: feat(memory): support path-based weights for QMD search (Fixes #20139)
by FradSer · 2026-02-18
75.3%
#9089: feat(memory): semantic markdown chunking for better recall
by Kuroro92100 · 2026-02-04
73.3%
#12737: feat: add maxLines option for memory chunk splitting
by fastroc · 2026-02-09
72.1%
#19967: feat(memory): add semantic clustering and enhanced MMR
by alihassan6520 · 2026-02-18
72.0%
#10644: feat: add runDuringHeartbeats option for memory flush (AI Assisted)
by tripphillips · 2026-02-06
69.6%
#12425: feat(core): Native Token Optimization Defaults (Pruning, Compaction...
by oneles · 2026-02-09
69.5%
#18912: feat: periodic fact extraction from conversations
by ruypang · 2026-02-17
69.2%
#8795: feat(memory): add Redis-backed long-term memory plugin
by tf-gmail · 2026-02-04
69.1%
#9149: Fix: Allow QMD backend to work without OpenAI auth
by vishaltandale00 · 2026-02-04
69.0%
#6362: fix(memory): add ignore patterns to chokidar file watcher
by Glucksberg · 2026-02-01
68.9%