Skip to content

Testing how well Qwen 3.5 35B-A3B implements memory decay#1

Open
sandst1 wants to merge 14 commits intomainfrom
qwen3.5-35B-A3B-memory-decay
Open

Testing how well Qwen 3.5 35B-A3B implements memory decay#1
sandst1 wants to merge 14 commits intomainfrom
qwen3.5-35B-A3B-memory-decay

Conversation

@sandst1
Copy link
Copy Markdown
Owner

@sandst1 sandst1 commented Feb 25, 2026

No description provided.

Topi Santakivi 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant