...
Artificial Intelligence

Use local knowledge graphs in Claude Desktop to achieve lasting memory

The Knowledge Graph Memory Server allows Claude Desktop to remember and organize information about users in multiple chats. It can store content such as user preferences, past conversations, and personal details. Since information is preserved as a knowledge graph, Claude can understand the relationship between different information. This results in more personalized responses and less duplication – you don’t have to explain the same thing again and again.

In this tutorial, we will implement a simple lasting memory using the local knowledge graph in Claude Desktop to help it remember user information in chat and provide a more personalized, consistent response.

Node.js installation

We will use NPX to run the Knowledge Graph memory server, and for this, Node.js is required.

  • Download the latest news Version nodejs.org’s node.js
  • Run the installer.
  • Leave all settings as default settings and complete installation

Claude desktop installation

You can download the latest version of Claude Desktop next, you need to configure Claude to connect to the MCP server. To do this, use any text editor to open the Claude_Desktop_config.json file located in the Claude directory. If the file does not exist, continue to create it manually.

In the MCP.JSON file, enter the following code:

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

Now we need to configure Claude so that it can use a knowledge graph to create entities, build relationships, and retrieve relevant information.

  • Go to File > Settings > Claude Settings > Configuration.
  • In the Personal preferences section, add the following text:

(This preference will automatically apply to all conversations.)

Follow these steps for each interaction:

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"

3. Memory
   - 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
     b) Connect them to the current entities using relations
     b) Store facts about them as observations

Once everything is configured, you will see 9 MCP tools available for knowledge graph servers. These tools allow you to: create entities, create relationships, add observations, delete entities, delete observations, delete relationships, read graphs, search nodes and open nodes.

Additionally, the text we added in the Preferences section enables Claude to use these tools automatically during conversations.

Even if we go to a new chat, Claude remembers the information from previous chats through the knowledge graph. The integration of this MCP tool enhances Claude’s ability to create, modify and utilize knowledge in real time, making it a powerful assistant for tasks such as database management and SQL query generation. With this memory system, Claude becomes a smarter, responsive, consistent tool for all your future interactions. For more details on Knowledge Memory Server, you can visit this link to find resources here to help you build more advanced applications.


Also, don’t forget to follow us twitter And join us Telegram Channel and LinkedIn GrOUP. Don’t forget to join us 90K+ ml reddit.

🔥 [Register Now] Minicon Agesic AI Virtual Conference: Free Registration + Certificate of Attendance + 4-hour Short Event (May 21, 9am-1pm) + Hands-On the Workshop


I am a civil engineering graduate in Islamic Islam in Jamia Milia New Delhi (2022) and I am very interested in data science, especially neural networks and their applications in various fields.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.