Memory Custom

Extiende el servidor MCP Memory para crear y gestionar un grafo de conocimiento a partir de interacciones con LLM.

Documentación

Memory Custom

smithery badge

Este proyecto añade nuevas funcionalidades al servidor Memory ofrecido por el equipo de MCP. Permite la creación y gestión de un grafo de conocimiento que captura interacciones mediante un modelo de lenguaje (LLM).

Memory Custom MCP server

Nuevas características

1. Rutas de memoria personalizadas

  • Los usuarios ahora pueden especificar diferentes rutas de archivos de memoria para varios proyectos.
  • ¿Por qué?: Esta característica mejora la organización y gestión de los datos de memoria, permitiendo un almacenamiento de memoria específico por proyecto.

2. Marcas de tiempo

  • El servidor ahora genera marcas de tiempo para las interacciones.
  • ¿Por qué?: Las marcas de tiempo permiten rastrear cuándo se creó o modificó cada memoria, proporcionando un mejor contexto e historial para los datos almacenados.

Primeros pasos

Requisitos previos

  • Node.js (versión 16 o superior)

Instalación mediante Smithery

Para instalar Knowledge Graph Memory Server para Claude Desktop automáticamente mediante Smithery:

npx -y @smithery/cli install @BRO3886/mcp-memory-custom --client claude

Instalación

  1. Clona el repositorio:

    git clone git@github.com:BRO3886/mcp-memory-custom.git
    cd mcp-memory-custom
    
  2. Instala las dependencias:

    npm install
    

Configuración

Antes de ejecutar el servidor, puedes establecer la variable de entorno MEMORY_FILE_PATH para especificar la ruta del archivo de memoria. Si no se establece, el servidor usará por defecto memory.json en el mismo directorio que el script.

Ejecutando el servidor

Actualizando el archivo json del servidor mcp

Añade esto a tu archivo claude_desktop_config.json / .cursor/mcp.json:

{
  "mcpServers": {
    "memory": {
      "command": "node",
      "args": ["/path/to/mcp-memory-custom/dist/index.js"]
    }
  }
}

Cambios en el prompt del sistema:

Follow these steps for each interaction:
1. The memoryFilePath for this project is /path/to/memory/project_name.json - always pass this path to the memory file operations (when creating entities, relations, or retrieving memory etc.)
2. User Identification:
   - You should assume that you are interacting with default_user
   - If you have not identified default_user, proactively try to do so.

3. 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"

4. 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)

5. 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


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 4).

Ejecutando el servidor localmente

Para iniciar el Knowledge Graph Memory Server, ejecuta:

npm run build
node dist/index.js

El servidor escuchará solicitudes a través de la entrada/salida estándar.

Endpoints de la API

El servidor expone varias herramientas que se pueden llamar con parámetros específicos:

  • 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

Agradecimientos

  • Inspirado en el servidor Memory de Anthropic.