Testing how well Qwen 3.5 35B-A3B implements memory decay#1
Open
Testing how well Qwen 3.5 35B-A3B implements memory decay#1
Conversation
added 14 commits
February 25, 2026 16:20
- Add last_accessed, access_count, and access_history fields to Concept - Update to_dict() to serialize access tracking (truncate history to 100 entries) - Update from_dict() to deserialize access tracking fields - Ensures backwards compatibility with existing concepts
- Add retrieval_access_log table to store schema for decay computation - Implement record_concept_access() to log concept accesses - Implement get_concept_access_stats() to retrieve access statistics - Implement get_recent_accesses() for monitoring access patterns - Add migration support for existing databases - Add comprehensive unit tests for all new methods
Add _compute_decay_score() method to MemoryRetriever with: - Recency factor using exponential decay curve (40% weight) - Frequency factor capped at 1.0 (40% weight) - Confidence boost contributing 20% to final score - Minimum decay score threshold enforcement Add comprehensive unit tests covering: - New concepts (never accessed) start with full recency - Disabled decay returns 1.0 for all factors - Recency half-life formula verification - Frequency threshold and capping - Confidence boost calculation - Minimum threshold enforcement - Edge cases (no last_accessed, zero access count)
- Modify retrieve() to record concept accesses after retrieval - Track access_count, last_accessed, and access_history for each concept - Persist changes to retrieval_access_log table in SQLite - Truncate access_history to max 100 entries - Add 7 integration tests verifying end-to-end tracking
- Add decay_score field to ActivatedConcept dataclass for transparency - Modify retrieve() to compute final ranking: (activation × 0.7) + (decay_score × 0.3) - Results sorted by final score (70% retrieval relevance, 30% recency/popularity) - decay_score exposed separately while activation holds final combined score - All 51 retrieval tests pass
Add new remind decay command group with subcommands: - remind decay inspect <concept_id> - Show decay stats for a concept - remind decay reset <concept_id> - Reset decay to maximum for a concept - remind decay recent [--limit N] - Show recent concept accesses - remind decay config - Show current decay configuration All commands provide human-readable output using Rich tables and panels.
- GET /api/v1/concepts/{id}/decay - Get decay stats for a concept
- PUT /api/v1/concepts/{id}/decay/reset - Reset decay for a concept
- GET /api/v1/decay/recent - Get recent concept accesses
- GET /api/v1/decay/config - Get current decay configuration
All endpoints return JSON responses with proper error handling.
Add three new MCP tools for decay management: - get_decay_stats(concept_id): Get decay score and access statistics - reset_decay(concept_id): Reset decay to maximum for a concept - get_recent_accesses(limit): View recent memory access patterns Changes: - src/remind/mcp_server.py: Added tool implementations and FastMCP decorators - docs/AGENTS.md: Added documentation for new decay management tools - tests/test_mcp_tools.py: Added comprehensive integration tests All 217 tests pass.
…racking Test coverage for: - Decay score computation formula and weights (40% recency, 40% frequency, 20% confidence) - Recency decay with exponential decay curve and half-life behavior - Frequency capping at threshold - Access tracking persistence (count, last_accessed, history truncation) - Minimum decay score enforcement - Edge cases (no last_accessed, no confidence, empty access_history, decay disabled)
Implement comprehensive integration tests covering: - Retrieval ranking with decay scores - Access logging and tracking - CLI commands (inspect, reset, recent, config) - API endpoints (decay stats, reset, recent, config) - Decay with consolidation workflow - Decay disabled configuration Tests use real SQLite database with temp files and clean up after themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.