Memory PouchDB

by bneil

3 stars
Not rated
GitHub

About

Provides a knowledge graph-based memory system using PouchDB for storing and retrieving entity relationships and observations, enabling persistent conversational context across interactions.

Details

Author
bneil
Repository
bneil/mcp-memory-pouchdb
GitHub stars
3
License
MIT License
Categories
Database, AI, Knowledge Base, Design, Developer Tools, File Management, Frontend, API
Tags
#visualization

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Memory PouchDB
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/mcp-memory-pouchdb/dist/index.js
    Environment
    • POUCHDB_PATH /path/to/custom/pouchdb_directory
    • MEMORY_FILE_PATH /path/to/custom/memory.json
    • DISABLE_MEMORY_FILE true

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To install Knowledge Graph Memory Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @bneil/mcp-memory-pouchdb --client claude

1. Clone the repository:

   git clone git@github.com:bneil/mcp-memory-pouchdb.git
   cd mcp-memory-pouchdb
   

2. Install the dependencies:

   npm install
   

The server requires two environment variables to be set:

1. MEMORY_FILE_PATH: The absolute path where the memory backup file will be stored
2. POUCHDB_PATH: The absolute path where the PouchDB database will be stored

Example configuration in your claude_desktop_config.json / .cursor/mcp.json:

{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
        "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
        "DISABLE_MEMORY_FILE": "true"
      }
    }
  }
}

The server will fail to start if either environment variable is not set. 🚫

Optional environment variables:
- POUCHDB_OPTIONS: JSON string of additional PouchDB configuration options
- DISABLE_MEMORY_FILE: Set to "true" to disable saving to memory.json file (only use PouchDB for storage)

Get Current Time

Retrieves the current timestamp.

Set Memory File Path

Sets the absolute path where the memory backup file will be stored.

Create Entities

Creates new entities in the knowledge graph.

Create Relations

Establishes relationships between entities in the knowledge graph.

Add Observations

Records observations about entities in the knowledge graph.

Delete Entities

Removes entities from the knowledge graph.

Delete Observations

Deletes specific observations from the knowledge graph.

Delete Relations

Removes relationships between entities in the knowledge graph.

Read Graph

Reads the current state of the knowledge graph.

Search Nodes

Searches for specific nodes within the knowledge graph.

Open Nodes

Opens specific nodes in the knowledge graph.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "memory pouchdb": {
            "env": {
                "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
                "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
                "DISABLE_MEMORY_FILE": "true"
            },
            "args": [
                "/path/to/mcp-memory-pouchdb/dist/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
        "DISABLE_MEMORY_FILE": "true"
    },
    "args": [
        "/path/to/mcp-memory-pouchdb/dist/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
        "DISABLE_MEMORY_FILE": "true"
    },
    "args": [
        "/path/to/mcp-memory-pouchdb/dist/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "POUCHDB_PATH": "/path/to/custom/pouchdb_directory",
        "MEMORY_FILE_PATH": "/path/to/custom/memory.json",
        "DISABLE_MEMORY_FILE": "true"
    },
    "args": [
        "/path/to/mcp-memory-pouchdb/dist/index.js"
    ],
    "command": "node"
}

This project adds new features to the Memory server offered by the MCP team. It allows for the creation and management of a knowledge graph that captures interactions via a language model (LLM). 🚀

This repo was forked fromhttps://github.com/BRO3886/mcp-memory-customwhich was a great starting point, thanks again for fixing timestamps. This repo's goal was more to fix the issue with an ever increasing json file for context.

- The server now uses PouchDB for robust document-based storage
- Why?: Better data consistency, built-in versioning, and improved performance for large datasets
- Maintains file backup for compatibility

- Users can now specify different memory file paths for various projects
- Why?: This feature enhances organization and management of memory data, allowing for project-specific memory storage

- The server now generates timestamps for interactions
- Why?: Timestamps enable tracking of when each memory was created or modified, providing better context and history for the stored data

- Node.js (version 16 or higher)
- PouchDB (automatically installed as a dependency)

To install Knowledge Graph Memory Server for Claude Desktop automatically viaSmithery:

npx -y @smithery/cli install @bneil/mcp-memory-pouchdb --client claude
git clone git@github.com:bneil/mcp-memory-pouchdb.git cd mcp-memory-pouchdb

The server requires two environment variables to be set:
- MEMORY_FILE_PATH: The absolute path where the memory backup file will be stored
- POUCHDB_PATH: The absolute path where the PouchDB database will be stored

Example configuration in yourclaude_desktop_config.json/.cursor/mcp.json:

{ "mcpServers": { "memory": { "command": "node", "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"], "env": { "MEMORY_FILE_PATH": "/path/to/custom/memory.json", "POUCHDB_PATH": "/path/to/custom/pouchdb_directory", "DISABLE_MEMORY_FILE": "true" } } } }

The server will fail to start if either environment variable is not set. 🚫

- POUCHDB_OPTIONS: JSON string of additional PouchDB configuration options
- DISABLE_MEMORY_FILE: Set to "true" to disable saving to memory.json file (only use PouchDB for storage)

Add this to yourclaude_desktop_config.json/.cursor/mcp.jsonfile:

{ "mcpServers": { "memory": { "command": "node", "args": ["/path/to/mcp-memory-pouchdb/dist/index.js"], "env" : { "MEMORY_FILE_PATH":"/home/.../local_dbs/memory.json", "POUCHDB_PATH":"/home/.../local_dbs/pouchdb" } } } }
Follow these steps for each interaction: 0. Memory Initialization: - At startup, execute a read_graph function to initialize memory access - If memory is empty, create a default entity for the user with basic placeholder info - Run initialization sequence: read_graph → create_entities → read_graph 1. User Identification: - You should assume that you are interacting with default_user - If you have not identified default_user, proactively try to do so 2. Memory Retrieval: - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph - Always refer to your knowledge graph as your "memory" - Verify memory access is functioning properly 3. Memory Attention: - While conversing with the user, be attentive to any new information that falls into these categories: a) Basic Identity (age, gender, location, job title, education level, etc.) b) Behaviors (interests, habits, etc.) c) Preferences (communication style, preferred language, etc.) d) Goals (goals, targets, aspirations, etc.) e) Relationships (personal and professional relationships up to 3 degrees of separation) 4. Memory Update: - If any new information was gathered during the interaction, update your memory as follows: a) Create entities for recurring organizations, people, and significant events, add timestamps to wherever required. You can get current timestamp via get_current_time b) Connect them to the current entities using relations c) Store facts about them as observations, add timestamps to observations via get_current_time 5. Error Recovery: - If memory retrieval fails, execute read_graph function immediately - Log any memory access failures for debugging - Continue the conversation with best available information 6. Memory Validation: - Periodically verify that memory access is functional by checking for core entities - If validation fails, attempt reconnection via read_graph IMPORTANT: Provide a helpful and engaging response, asking relevant questions to encourage user engagement. Update the memory during the interaction, if required, based on the new information gathered (point 3).

To start the Knowledge Graph Memory Server, run:

The server will listen for requests via standard input/output.

The server exposes several tools that can be called with specific parameters:

- Get Current Time
- Set Memory File Path📁
- Create Entities
- Create Relations🔗
- Add Observations📝
- Delete Entities
- Delete Observations🗑️
- Delete Relations🔗
- Read Graph📖
- Search Nodes🔍
- Open Nodes🔓

- Inspired by the Memory server from Anthropic
- Powered by PouchDB for robust data storage 💾

Engram is a hosted MCP server that provides reliable memory for AI agents:

Self-hosted MCP memory server for personal use and teams

Persistent memory, teams, and projects for AI agents. 76 MCP tools for storing, recalling, and sharing knowledge across sessions.

Provides searchable local storage for Claude conversation history, enabling context retrieval during sessions.

Deterministic O(1) memory for AI agents — local-first, MCP-native, with multi-agent speaker attribution and millisecond recall.

Integrates with Mem0.ai to provide persistent memory capabilities for LLMs, supporting cloud, Supabase, and local storage.

Enables Large Language Models to store and retrieve persistent memories with intelligent search capabilities.

A memory management system for AI assistants to store, retrieve, and manage user information using a local database.

Agent memory with git-like version control. Custom LLMs turn conversations into structured facts with automatic conflict detection - your agent sees how decisions evolved, not four contradictory text blobs. 80% token reduction vs RAG/graph systems. MCP + REST.

Persistent, inspectable memory for AI agents via hosted MCP and API. Supports recall, structured query, lineage, correction, and tenant-scoped remote memory.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.