Skip to content
Automation
Skill

/mem0-integration

Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.

From plugin
babysitter
1.9k200 skills3 agents21 commands1 MCP

Claude Code

$ npx -y skills add a5c-ai/babysitter --skill mem0-integration --agent claude-code

SKILL.md

mem0-integration.SKILL.md
name: mem0-integration
description: Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.
allowed-tools: Read, Grep, Write, Edit, Bash, Glob, WebFetch
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:ai-agents-conversational]
  skillAreas: [skill-area:context-management, skill-area:retrieval-augmented-generation]
  roles: [role:ml-engineer, role:backend-engineer]
  workflows: [workflow:feature-development, workflow:ml-model-lifecycle]

mem0-integration

Integrate Mem0 (formerly MemGPT) as a universal memory layer for AI agents. Enable persistent memory storage, semantic search across memories, and personalized context retrieval.

Overview

Mem0 provides intelligent memory management for AI applications:

  • Persistent storage of conversation history and facts
  • Semantic search across stored memories
  • User-specific memory isolation
  • Automatic memory extraction from conversations
  • Support for local and cloud deployments

Capabilities

Memory Operations

  • Add memories from text or conversations
  • Search memories semantically
  • Retrieve relevant context by user/agent
  • Update and delete memories
  • Get memory history with timestamps

Memory Types

  • Conversation memories (dialogue history)
  • Fact memories (extracted information)
  • Preference memories (user preferences)
  • Entity memories (people, places, things)

Storage Backends

  • Local SQLite/JSON storage
  • PostgreSQL for production
  • Qdrant vector database integration
  • Cloud-hosted Mem0 platform

Integration Patterns

  • LangChain memory integration
  • Direct API usage
  • MCP server connectivity
  • CrewAI and AutoGen compatibility

Usage

Basic Setup

from mem0 import Memory

# Initialize with default local storage
m = Memory()

# Or with custom configuration
config = {
    "vector_store": {
        "provider": "qdrant",
        "config": {
            "host": "localhost",
            "port": 6333,
        }
    },
    "llm": {
        "provider": "openai",
        "config": {
            "model": "gpt-4o-mini",
            "temperature": 0.1,
        }
    }
}
m = Memory.from_config(config)

Adding Memories

# Add memory from conversation
messages = [
    {"role": "user", "content": "I prefer dark mode for all my applications"},
    {"role": "assistant", "content": "I'll remember that you prefer dark mode."}
]
m.add(messages, user_id="user123")

# Add memory from plain text
m.add("User works at Acme Corp as a software engineer", user_id="user123")

# Add with metadata
m.add(
    "Prefers Python over JavaScript",
    user_id="user123",
    metadata={"category": "preferences", "confidence": 0.9}
)

Searching Memories

# Search for relevant memories
results = m.search(
    query="What are the user's preferences?",
    user_id="user123",
    limit=5
)

for memory in results:
    print(f"Memory: {memory['memory']}")
    print(f"Relevance: {memory['score']}")
    print(f"Created: {memory['created_at']}")

Getting All Memories

# Get all memories for a user
all_memories = m.get_all(user_id="user123")

# Filter by metadata
filtered = m.get_all(
    user_id="user123",
    metadata={"category": "preferences"}
)

Memory History

# Get memory changes over time
history = m.history(memory_id="mem_abc123")

for entry in history:
    print(f"Version: {entry['version']}")
    print(f"Content: {entry['memory']}")
    print(f"Updated: {entry['updated_at']}")

LangChain Integration

from langchain_openai import ChatOpenAI
from mem0 import MemoryClient

# Initialize Mem0 client
mem0_client = MemoryClient(api_key="your-api-key")

# Create LLM with memory-enhanced context
llm = ChatOpenAI(model="gpt-4")

def chat_with_memory(user_message: str, user_id: str) -> str:
    # Retrieve relevant memories
    memories = mem0_client.search(user_message, user_id=user_id, limit=5)
    memory_context = "\n".join([m["memory"] for m in memories])

    # Build prompt with memory context
    system_prompt = f"""You are a helpful assistant.

Here is what you remember about this user:
{memory_context}

Use this context to personalize your response."""

    # Generate response
    response = llm.invoke([
        {"role": "system", "content": system_prompt},
        {"role": "user", "content": user_message}
    ])

    # Store new memory from conversation
    mem0_client.add(
        [
            {"role": "user", "content": user_message},
            {"role": "assistant", "content": response.content}
        ],
        user_id=user_id
    )

    return response.content

MCP Server Usage

# Using Mem0 MCP server with Claude
# Configure in claude_desktop_config.json:
{
    "mcpServers": {
        "mem0": {
            "command": "npx",
            "args": ["-y", "@mem0/mcp-server"]
        }
    }
}

Task Definition

const mem0IntegrationTask = defineTask({
  name: 'mem0-integration-setup',
  description: 'Configure Mem0 memory layer for AI agent',

  inputs: {
    storageBackend: { type: 'string', default: 'local' },  // 'local', 'qdrant', 'postgres', 'cloud'
    vectorDimension: { type: 'number', default: 1536 },
    embeddingModel: { type: 'string', default: 'text-embedding-3-small' },
    memoryCategories: { type: 'array', default: ['facts', 'preferences', 'conversations'] },
    userIsolation: { type: 'boolean', default: true }
  },

  outputs: {
    configured: { type: 'boolean' },
    memoryStats: { type: 'object' },
    artifacts: { type: 'array' }
  },

  async run(inputs, taskCtx) {
    return {
      kind: 'skill',
      title: `Configure Mem0 with ${inputs.storageBackend} backend`,
      skill: {
        name: 'mem0-integration',
        context: {
          storageBackend: inputs.storageBackend,
          vectorDimension: inputs.vectorDimension,
          embeddingModel: inputs.embedd
Read more
@a5c-ai
Ships withbabysitter

Enforce obedience on agentic workforces. Manage extremely complex workflows through deterministic, hallucination-free self-orchestration.

1.9k200 skills3 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.9k
Star history of a5c-ai/babysitter on GitHub, a chart by star-history.com

Other skills on babysitter.

babysit-babysitter-issues

babysit-babysitter-iss…

This skill should be used when the user asks to "babysit issues", "work on assigned issues", "check a5c-agent issues", "process…

@a5c-ai@a5c-aiInstall Skill
catalog-babysitter-users

catalog-babysitter-use…

Discover public GitHub repositories that import defineTask from @a5c-ai/babysitter-sdk and maintain a deduplicated catalog of…

@a5c-ai@a5c-aiInstall Skill
fix-failing-pipelines

fix-failing-pipelines

This skill should be used when the user asks to "fix pipelines", "fix CI", "check staging pipelines", "fix failing workflows",…

@a5c-ai@a5c-aiInstall Skill
process-builder

process-builder

Scaffold new babysitter process definitions following SDK patterns, proper structure, and best practices. Guides the 3-phase…

@a5c-ai@a5c-aiInstall Skill

More skills from other plugins.

agent-builder

agent-builder

Load immediately after an Agent intent, before the first agent_builder_* call. Governs how you create, configure, test, and…

n8n10d209k
@n8n-io@n8n-ioInstall Skill
browser-use

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…

@browser-use@browser-useInstall Skill
agent-browser

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…

@vercel-labs-2@vercel-labs-2Install Skill
add-anydoc

add-anydoc

Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when…

@nanocoai@nanocoaiInstall Skill

Questions about mem0-integration.

Which coding agents can use mem0-integration?
mem0-integration installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.