Memory health

From kbanc85/claudia · View interactive version

Memory health is an AI agent skill from the GitHub repository kbanc85/claudia. Check memory system health and data quality. Use when user asks "how's my memory?", "system health", "memory stats", "data quality", "how's my brain?", or for periodic self-diagnostics. See also: `memory-audit` for content-level provenance; `diagnose` for daemon connectivity issues.

How to use this skill

Skill file

Memory Health

Provide a dashboard view of the memory system's health, including entity counts, memory statistics, data quality indicators, and recommendations.

Triggers

Schema Reference

Use these exact column names in all SQLite queries. Do NOT guess column names.

entities table: id, name, type, canonical_name, description, importance (REAL), created_at, updated_at, metadata, last_contact_at, contact_frequency_days, contact_trend, attention_tier, close_circle (BOOLEAN), close_circle_reason, deleted_at, deleted_reason

memories table: id, content, content_hash, type, importance (REAL), confidence (REAL), source, source_id, source_context, created_at, updated_at, last_accessed_at, access_count, verified_at, verification_status, metadata, source_channel, deadline_at, temporal_markers, lifecycle_tier, sacred_reason (NOT sacred), archived_at, fact_id, hash, prev_hash, workspace_id, corrected_at, corrected_from, invalidated_at, invalidated_reason, origin_type

relationships table: id, source_entity_id, target_entity_id, relationship_type, strength (REAL), origin_type, direction, valid_at, invalid_at (NOT invalidated_at), created_at, updated_at, metadata, lifecycle_tier

predictions table: id, content, prediction_type, priority (REAL), expires_at, is_shown, is_acted_on, created_at, shown_at, prediction_pattern_name, metadata

Important distinctions:

Workflow

Step 1: Gather Statistics

Use the memory_system_health MCP tool or direct SQLite queries with the schema above.

Alternatively, use the Claudia CLI to get current system state:

claudia memory session context --scope full --project-dir "$PWD"

This returns entity counts, memory counts, relationship counts, and predictions.

Step 2: Calculate Health Indicators

From the session context, derive:

Entity Health

Memory Health

Relationship Health

Data Quality

Step 3: Present Dashboard

Format:

## Memory System Health Report

### Entities
| Type         | Count | Stale (90d) |
|--------------|-------|-------------|
| People       |    23 |           2 |
| Projects     |    12 |           5 |
| Organizations|     8 |           0 |
| Topics       |    15 |           3 |

### Memories
- **Total:** 847 active memories
- **Average importance:** 0.72
- **By type:** 412 facts, 198 preferences, 156 observations, 81 learnings
- **Corrected:** 12 memories have been corrected
- **Invalidated:** 34 memories marked as no longer true

### Relationships
- **Active:** 67 relationships
- **Cooling:** 8 relationships (no contact in 30+ days)

### Data Quality
- **Potential duplicates:** 3 entity pairs to review
- **Orphan memories:** 5 memories without entity links
- **Low importance:** 23 memories below 0.3 threshold

### Recommendations
1. Review potential duplicates: "John Smith" and "Jon Smith" may be the same person
2. Consider archiving 5 stale projects with no recent activity
3. 8 relationships are cooling - may want to reconnect

Quick Stats Mode

If user just wants numbers:

Your memory at a glance:
- 58 people, 12 projects, 8 orgs
- 847 memories (avg importance: 0.72)
- 67 relationships tracked
- Last consolidation: 2 hours ago

Troubleshooting Mode

When user reports memory issues ("you forgot X", "why don't you remember"):

  1. Search for the specific topic/entity
  2. Check if memories exist but are below recall threshold
  3. Check if memories were invalidated
  4. Report findings:
I searched for memories about "[topic]":
- Found 3 memories, but all below importance 0.4 (not surfacing in context)
- One memory was corrected on [date]
- Recommendation: I can boost the importance of these if they're still relevant

Recommendations Engine

Based on health metrics, suggest:

Never

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.