MCP

Enhance Claude with Persistent Memory

MCP server that gives Claude persistent memory across conversations using a local knowledge graph of entities, relations, and observations stored in JSONL


89
Spark score
out of 100
Updated 4 months ago
Version 1.0.0

Add to Favorites

Why it matters

Empower Claude with persistent memory by storing user interactions and knowledge in a local knowledge graph. This allows Claude to recall information across conversations, creating a more personalized and context-aware experience.

Outcomes

What it gets done

01

Store user preferences and facts as entities, relations, and observations.

02

Retrieve and utilize past conversation data for contextually relevant responses.

03

Build a dynamic knowledge graph for long-term memory recall.

04

Integrate with Claude to provide a seamless, memory-enhanced chat experience.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-memory | bash

Capabilities

Tools your agent gets

create_entities

Create multiple new entities in the knowledge graph.

create_relations

Create relations between entities in the knowledge graph.

add_observations

Add new observations to existing entities.

delete_entities

Remove entities and their associated relations from the graph.

delete_observations

Remove specific observations from entities.

delete_relations

Remove specific relations from the knowledge graph.

read_graph

Read the entire knowledge graph.

search_nodes

Search for nodes by query across names, types, and observations.

open_nodes

Retrieve specific nodes by name with their relations.

Overview

Memory MCP

What it does

MCP server providing persistent memory through a local knowledge graph

How it connects

When you need Claude to remember information about users, preferences, and relationships across multiple chat sessions

Source README

The Memory MCP server provides Claude with persistent memory using a local knowledge graph. This lets Claude remember information about users across chats through entities, relations, and observations.

Installation

npm install -g @modelcontextprotocol/server-memory

Configuration

Add to your Claude Code settings:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}

Custom Memory File Path

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.jsonl"
      }
    }
  }
}

Core Concepts

Entities

Primary nodes in the knowledge graph with a unique name, type, and observations.

{
  "name": "John_Smith",
  "entityType": "person",
  "observations": ["Speaks fluent Spanish"]
}

Relations

Directed connections between entities in active voice.

{
  "from": "John_Smith",
  "to": "Anthropic",
  "relationType": "works_at"
}

Observations

Discrete, atomic pieces of information attached to entities.

Available Tools

create_entities

Create multiple new entities in the knowledge graph.

create_entities(entities: Entity[]): void

create_relations

Create relations between entities.

create_relations(relations: Relation[]): void

add_observations

Add new observations to existing entities.

add_observations(observations: ObservationInput[]): AddedObservations[]

delete_entities

Remove entities and their associated relations.

delete_entities(entityNames: string[]): void

delete_observations

Remove specific observations from entities.

delete_observations(deletions: DeletionInput[]): void

delete_relations

Remove specific relations from the graph.

delete_relations(relations: Relation[]): void

read_graph

Read the entire knowledge graph.

read_graph(): KnowledgeGraph

search_nodes

Search for nodes by query across names, types, and observations.

search_nodes(query: string): SearchResults

open_nodes

Retrieve specific nodes by name with their relations.

open_nodes(names: string[]): NodeResults

Recommended System Prompt

Add this to your Claude project for optimal memory usage:

Follow these steps for each interaction:

1. User Identification:
   - Assume you are interacting with default_user
   - Proactively try to identify the user if unknown

2. Memory Retrieval:
   - Begin chats by saying "Remembering..." and retrieve relevant information
   - Refer to the knowledge graph as your "memory"

3. Memory Updates:
   - Be attentive to new information: identity, behaviors, preferences, goals, relationships
   - Create entities for recurring people, organizations, and events
   - Connect them using relations and store facts as observations

Usage Example

Claude, remember that I prefer morning meetings and
my favorite programming language is Python.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.