Skip to content
Back to skills

Memory Usage

ASecurity

Always-on MemoryManager + LearningPolicy workflow. Use when storing/retrieving memories, emitting retrieval signals, running consolidation/pruning, or when a session should default to the Atlas memory system (MemoryManager, MemoryConsolidator, LearningPolicy). Triggers: memory add/retrieve, consolidation, pruning, semantic search, or 'use the memory system by default.'

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned September 2, 2026

npx -y skills add majiayu000/claude-skill-registry --skill memory-usage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Usage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Usage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-memory-usage-claude-skill-registry/badge)](https://www.skillsdirectory.com/skills/majiayu000-memory-usage-claude-skill-registry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memory-usage
description: "Always-on MemoryManager + LearningPolicy workflow. Use when storing/retrieving memories, emitting retrieval signals, running consolidation/pruning, or when a session should default to the Atlas memory system (MemoryManager, MemoryConsolidator, LearningPolicy). Triggers: memory add/retrieve, consolidation, pruning, semantic search, or 'use the memory system by default.'"
---

# Memory Usage

## Overview

Use this skill to enforce the Atlas memory pipeline: **MemoryManager + LearningPolicy + MemoryConsolidator**. This makes memory storage/retrieval consistent, emits learning signals, and keeps the index healthy via consolidation + pruning.

## Workflow (Always-on)

### 1) Initialize policy + memory system
```ts
import { MemoryManager } from '../system/memory/manager';
import { LearningPolicy } from '../system/learning/ml-policy';

const policy = new LearningPolicy({});
await policy.initialize();

const memory = new MemoryManager({}, policy);
await memory.initialize();
```

### 2) Add memory (always with metadata)
```ts
await memory.add({
  type: 'fact',
  content: 'The capital of France is Paris',
  metadata: {
    source: 'session',
    sessionId: 'current',
    author: 'Atlas',
    provenance: { origin: 'user', confidence: 0.9 },
    tags: ['geo']
  }
});
```

### 3) Retrieve memory (signals are emitted)
```ts
const results = await memory.retrieve({ query: 'France capital', limit: 3 });
// memory_retrieved signal is recorded automatically
```

### 4) Consolidate + prune (daily/weekly)
```ts
await memory.consolidate({ window: 'last_24_hours' });
await memory.prune({
  age: 'older_than_90_days',
  threshold: 0.3,
  minRetrievalCount: 1
});
```

## Required Behaviors
- **Always initialize LearningPolicy** before MemoryManager.
- **Always use MemoryManager** for add/retrieve (no bypassing the index).
- **Do not** store memory without metadata (source/sessionId/provenance/tags).
- **Consolidate** regularly and **prune** low-value entries.

## Quick sanity checks
- Vector index size increases after add.
- Retrieval returns results with `score` and `metadata.similarity`.
- `signals.json` contains `memory_retrieved` events after retrieval.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.