← スキル一覧に戻る

memory-manager
by Dexploarer
AI-powered 3D asset generation platform for game development
⭐ 3🍴 2📅 2026年1月24日
SKILL.md
name: memory-manager description: Manage elizaOS agent memory, context windows, and conversation history. Triggers on "manage memory", "optimize context", or "handle agent memory" allowed-tools: [Read, Edit, Bash]
Memory Manager Skill
Optimize agent memory usage, implement pruning strategies, and manage conversation context effectively.
Capabilities
- 🧠 Memory pruning and optimization
- 📊 Context window management
- 🗂️ Conversation history archiving
- 🎯 Important memory consolidation
- 🔄 Memory decay implementation
- 📈 Memory usage monitoring
Memory Types
Short-term Memory
- Current conversation context
- Working memory (max 50 items default)
- Cleared per session
Long-term Memory
- Important facts and information
- Persistent across sessions
- Decay modeling over time
Knowledge
- Static facts from configuration
- Document-based knowledge
- Dynamically learned information
Memory Operations
// Create memory
await runtime.createMemory({
entityId: userId,
roomId: conversationId,
content: {
text: 'Important information',
metadata: { importance: 'high' }
},
embedding: await generateEmbedding(text)
});
// Retrieve memories
const memories = await runtime.getMemories({
roomId: conversationId,
limit: 10,
unique: true
});
// Search semantically
const results = await runtime.searchMemories(
'query text',
{
roomId: conversationId,
limit: 5,
minScore: 0.7
}
);
// Update memory
await runtime.updateMemory({
id: memoryId,
content: { ...updated content },
metadata: { lastAccessed: Date.now() }
});
Pruning Strategies
Time-based Pruning
async function pruneOldMemories(
runtime: IAgentRuntime,
daysToKeep: number = 30
): Promise<number> {
const cutoffDate = Date.now() - (daysToKeep * 24 * 60 * 60 * 1000);
const oldMemories = await runtime.getMemories({
createdBefore: cutoffDate,
importance: 'low'
});
for (const memory of oldMemories) {
await runtime.deleteMemory(memory.id);
}
return oldMemories.length;
}
Size-based Pruning
async function pruneLargeMemories(
runtime: IAgentRuntime,
maxSize: number = 1000
): Promise<void> {
const memories = await runtime.getMemories({ limit: 10000 });
if (memories.length > maxSize) {
// Keep most important and recent
const toKeep = rankMemoriesByImportance(memories).slice(0, maxSize);
const toDelete = memories.filter(m => !toKeep.includes(m));
for (const memory of toDelete) {
await runtime.deleteMemory(memory.id);
}
}
}
Best Practices
- Set appropriate
conversationLengthlimits - Implement importance scoring
- Use memory decay for temporal relevance
- Archive important conversations
- Monitor memory growth
- Prune regularly
- Use embeddings for semantic search
- Cache frequently accessed memories
- Batch memory operations
- Index memories properly
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です