mcpField
A
agent-memory

agent-memory

github.com/pluginagentmarketplaceAgent workflows166 installsUpdated 43w ago
Repository

About agent-memory

agent-memory is a skill for developers designing agent memory, covering conversation history, long-term memory, personalization, and context-window management. It explains buffer, summary, vector, and hybrid approaches, with a multi-layer architecture example.

Key features

  1. 01Buffer, summary, vector, and hybrid memory
  2. 02Session, user, and global persistence options
  3. 03Multi-layer memory architecture example
  4. 04Guidance for context overflow and retrieval issues

Use cases

  1. 01Add conversation history to an agent
  2. 02Design long-term or personalized memory
  3. 03Manage a limited context window

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pluginagentmarketplace/custom-plugin-ai-agents --skill agent-memory

After installing, type/agent-memoryin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
config.yaml
schema.json
references/
GUIDE.md
PATTERNS.md
scripts/
multi_layer_memory.py
validate.py

Details

From the project README

Agent Memory

Give agents the ability to remember and learn across conversations.

When to Use This Skill

Invoke this skill when:

  • Adding conversation history
  • Implementing long-term memory
  • Building personalized agents
  • Managing context windows

Parameter Schema

ParameterTypeRequiredDescriptionDefault
taskstringYesMemory goal-
memory_typeenumNobuffer, summary, vector, hybridhybrid
persistenceenumNosession, user, globalsession

Quick Start

from langchain.memory import ConversationBufferWindowMemory

# Simple buffer (last k messages)
memory = ConversationBufferWindowMemory(k=10)

# With summarization
from langchain.memory import ConversationSummaryBufferMemory
memory = ConversationSummaryBufferMemory(llm=llm, max_token_limit=2000)

# Vector store memory
from langchain.memory import VectorStoreRetrieverMemory
memory = VectorStoreRetrieverMemory(retriever=vectorstore.as_retriever())

Memory Types

TypeUse CaseProsCons
BufferShort chatsSimpleNo compression
SummaryLong chatsCompactLoses detail
VectorSemantic recallRelevantSlower
HybridProductionBest of allComplex

Multi-Layer Architecture

class ProductionMemory:
    def __init__(self):
        self.short_term = BufferMemory(k=10)    # Recent
        self.summary = SummaryMemory()           # Compressed
        self.long_term = VectorMemory()          # Semantic

Troubleshooting

IssueSolution
Context overflowAdd summarization
Slow retrievalCache, reduce k
Irrelevant recallImprove embeddings
Memory not persistingCheck storage backend

Best Practices

  • Use multi-layer memory for production
  • Set token limits to prevent overflow
  • Add metadata (timestamps, importance)
  • Implement TTL for old memories

Related Skills

  • rag-systems - Vector retrieval
  • llm-integration - Context management
  • ai-agent-basics - Agent architecture

References

Comments

Markdown supported