langchain-memory
Scannednpx machina-cli add skill a5c-ai/babysitter/langchain-memory --openclawFiles (1)
SKILL.md
1.3 KB
LangChain Memory Skill
Capabilities
- Implement various LangChain memory types
- Configure ConversationBufferMemory for short-term recall
- Set up ConversationSummaryMemory for long conversations
- Integrate vector-based memory for semantic search
- Design memory retrieval strategies
- Handle memory persistence and serialization
Target Processes
- conversational-memory-system
- chatbot-design-implementation
Implementation Details
Memory Types
- ConversationBufferMemory: Stores full conversation history
- ConversationBufferWindowMemory: Rolling window of recent messages
- ConversationSummaryMemory: Summarizes older messages
- ConversationSummaryBufferMemory: Hybrid approach
- VectorStoreRetrieverMemory: Semantic similarity-based retrieval
Configuration Options
- Memory key naming conventions
- Return message format (string vs messages)
- Summary LLM selection
- Vector store backend selection
- Token limits and window sizes
Dependencies
- langchain
- langchain-community
- Vector store client (optional)
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/ai-agents-conversational/skills/langchain-memory/SKILL.mdView on GitHub Overview
This skill enables multiple LangChain memory types—ConversationBufferMemory, ConversationSummaryMemory, and vector-based memory—to manage short-term recall, long conversations, and semantic search. It covers memory design, retrieval strategies, persistence, and serialization, helping chatbots stay context-aware across sessions.
How This Skill Works
It exposes configurable memory types (ConversationBufferMemory, ConversationBufferWindowMemory, ConversationSummaryMemory, ConversationSummaryBufferMemory, and VectorStoreRetrieverMemory) with settings for memory keys, return formats, summary LLM, and vector store backends. It handles creation, storage, retrieval, and serialization of memories to support persistent context.
When to Use It
- When short-term recall of the entire conversation is needed (using ConversationBufferMemory).
- When conversations are lengthy and require summarization (ConversationSummaryMemory).
- When you want a rolling window of recent messages (ConversationBufferWindowMemory).
- When you need semantic search across memories (VectorStoreRetrieverMemory).
- When memory persistence across sessions is required (serialization and storage backends).
Quick Start
- Step 1: Install langchain and related memory tooling (pip install langchain langchain-community).
- Step 2: Pick a memory type (e.g., ConversationBufferMemory) and configure keys, return format, and LLM for summarization if needed.
- Step 3: Optional: add VectorStoreRetrieverMemory backed by a vector store and enable persistence.
Best Practices
- Explicitly name memory keys to avoid collisions.
- Choose memory type per scenario: short-term vs long-term memory.
- Tune token limits and window sizes to balance cost and context.
- Plan memory serialization and persistent storage early.
- Test retrieval strategies with real prompts and edge cases.
Example Use Cases
- Customer support chatbot maintaining context over long tickets.
- Personal assistant recalling user preferences and past orders.
- Research assistant indexing and semantically searching documents.
- Gameplay NPCs with episodic memory across sessions.
- E-commerce assistant remembering past browsing history and carts.
Frequently Asked Questions
Add this skill to your agents