Back to Documentation
Context Decay Algorithm
How LOB limits prompt bloat and saves tokens using time-based relevance decay.
Context windows grow bloated over time, leading to exponential token costs. LOB's Time-To-Live Decay actively prunes low-priority memories to keep prompts dense and efficient.
Relevancy Score Formula
Memory fragments are scored dynamically based on:
- Importance Level (1-5): Assigned at storage time. Critical architecture docs (level 5) persist for years, while trivial debugging logs (level 1) decay within days.
- Age Decay: Linear reduction applied in 24-hour cycles.
- Context Re-heating: Whenever an agent retrieves a memory via
brain_recall, its TTL resets, instantly restoring its relevancy score to max.
Note: Decayed memories are not permanently deleted from the SQLite DB. They are simply excluded from the active prompt window to save tokens, remaining searchable via keyword queries.