Add a new node to the knowledge graph based on the defined schema
Update an existing node in the knowledge graph
Delete a node from the knowledge graph
Create a relationship (edge) between two nodes
Search for nodes in the knowledge graph
Retrieve the schema definition for a specific node type
MemoryMesh is a knowledge graph server that implements the Model Context Protocol (MCP) to provide structured memory persistence for AI models. It excels at maintaining consistent, structured information across conversations, with particular strength in text-based RPGs and interactive storytelling applications. The server enables dynamic schema-based tools that automatically generate methods for adding, updating, and deleting data in the knowledge graph. With intuitive schema design and relationship handling, MemoryMesh helps AI models understand connections between data points and maintain contextual awareness throughout interactions.
git clone https://github.com/CheMiguel23/MemoryMesh.git
cd MemoryMesh
npm install
npm run build
npm start
The server will start on port 3000 by default. You can access the Schema Manager at http://localhost:3000/SchemaManager.html
and the Memory Viewer at http://localhost:3000/MemoryViewer.html
.
Alternatively, you can use Docker:
docker build -t memorymesh .
docker run -p 3000:3000 memorymesh
MemoryMesh uses schemas to define the structure of your data. Schemas should be placed in the dist/data/schemas
directory after building the project.
Each schema file should follow the naming convention add_[type].schema.json
, for example add_npc.schema.json
.
Schema structure:
{
"name": "add_npc",
"description": "Add a non-player character to the memory",
"properties": {
"name": {
"type": "string",
"description": "The name of the NPC"
},
"metadata": {
"type": "array",
"description": "Descriptive details about the NPC",
"items": {
"type": "string"
}
}
},
"required": ["name", "metadata"],
"relationships": [
{
"type": "located_in",
"description": "The location where this NPC can be found",
"target": "location"
}
]
}
The Schema Manager provides a web interface for creating and managing schemas. Access it at http://localhost:3000/SchemaManager.html
after starting the server.
add_
)The Memory Viewer allows you to visualize and interact with the knowledge graph. Access it at http://localhost:3000/MemoryViewer.html
.
Features include:
To integrate MemoryMesh with your AI model, you'll need to configure your AI client to use the MCP server. The server exposes endpoints that follow the Model Context Protocol.
When properly configured, the AI model will have access to tools for:
The schema-based approach ensures that the AI model understands the structure of your data and can maintain consistency across interactions.