knowledge graph memory.com
knowledge graph memory.com logo

Knowledge Graph Memory

Provides a knowledge graph management system for storing, retrieving, and querying information to build and maintain lon...

Created byApr 23, 2025

Memory MCP Server

A Model Context Protocol (MCP) server that provides knowledge graph functionality for managing entities, relations, and observations in memory, with strict validation rules to maintain data consistency.

Installation

Install the server in Claude Desktop:

Data Validation Rules

Entity Names

  • Must start with a lowercase letter
  • Can contain lowercase letters, numbers, and hyphens
  • Maximum length of 100 characters
  • Must be unique within the graph
  • Example valid names: python-project, meeting-notes-2024, user-john

Entity Types

The following entity types are supported:
  • person: Human entities
  • concept: Abstract ideas or principles
  • project: Work initiatives or tasks
  • document: Any form of documentation
  • tool: Software tools or utilities
  • organization: Companies or groups
  • location: Physical or virtual places
  • event: Time-bound occurrences

Observations

  • Non-empty strings
  • Maximum length of 500 characters
  • Must be unique per entity
  • Should be factual and objective statements
  • Include timestamp when relevant

Relations

The following relation types are supported:
  • knows: Person to person connection
  • contains: Parent/child relationship
  • uses: Entity utilizing another entity
  • created: Authorship/creation relationship
  • belongs-to: Membership/ownership
  • depends-on: Dependency relationship
  • related-to: Generic relationship
Additional relation rules:
  • Both source and target entities must exist
  • Self-referential relations not allowed
  • No circular dependencies allowed
  • Must use predefined relation types

Usage

The server provides tools for managing a knowledge graph:

Get Entity

Get Graph

Create Entities

Add Observation

Create Relation

Search Memory

The search functionality supports:
  • Temporal queries (e.g., "most recent", "last", "latest")
  • Activity queries (e.g., "workout", "exercise")
  • General entity searches
  • Fuzzy matching with 80% similarity threshold
  • Weighted search across:

Delete Entities

Delete Relation

Flush Memory

Error Types

The server uses the following error types:
  • NOT_FOUND: Entity or resource not found
  • VALIDATION_ERROR: Invalid input data
  • INTERNAL_ERROR: Server-side error
  • ALREADY_EXISTS: Resource already exists
  • INVALID_RELATION: Invalid relation between entities

Response Models

All tools return typed responses using these models:

EntityResponse

GraphResponse

OperationResponse

Development

Running Tests

Adding New Features

  1. Update validation rules in validation.py
  1. Add tests in tests/test_validation.py
  1. Implement changes in knowledge_graph_manager.py

Memory MCP Server

A Model Context Protocol (MCP) server that provides knowledge graph functionality for managing entities, relations, and observations in memory, with strict validation rules to maintain data consistency.

Installation

Install the server in Claude Desktop:

Data Validation Rules

Entity Names

  • Must start with a lowercase letter
  • Can contain lowercase letters, numbers, and hyphens
  • Maximum length of 100 characters
  • Must be unique within the graph
  • Example valid names: python-project, meeting-notes-2024, user-john

Entity Types

The following entity types are supported:
  • person: Human entities
  • concept: Abstract ideas or principles
  • project: Work initiatives or tasks
  • document: Any form of documentation
  • tool: Software tools or utilities
  • organization: Companies or groups
  • location: Physical or virtual places
  • event: Time-bound occurrences

Observations

  • Non-empty strings
  • Maximum length of 500 characters
  • Must be unique per entity
  • Should be factual and objective statements
  • Include timestamp when relevant

Relations

The following relation types are supported:
  • knows: Person to person connection
  • contains: Parent/child relationship
  • uses: Entity utilizing another entity
  • created: Authorship/creation relationship
  • belongs-to: Membership/ownership
  • depends-on: Dependency relationship
  • related-to: Generic relationship
Additional relation rules:
  • Both source and target entities must exist
  • Self-referential relations not allowed
  • No circular dependencies allowed
  • Must use predefined relation types

Usage

The server provides tools for managing a knowledge graph:

Get Entity

Get Graph

Create Entities

Add Observation

Create Relation

Search Memory

The search functionality supports:
  • Temporal queries (e.g., "most recent", "last", "latest")
  • Activity queries (e.g., "workout", "exercise")
  • General entity searches
  • Fuzzy matching with 80% similarity threshold
  • Weighted search across:

Delete Entities

Delete Relation

Flush Memory

Error Types

The server uses the following error types:
  • NOT_FOUND: Entity or resource not found
  • VALIDATION_ERROR: Invalid input data
  • INTERNAL_ERROR: Server-side error
  • ALREADY_EXISTS: Resource already exists
  • INVALID_RELATION: Invalid relation between entities

Response Models

All tools return typed responses using these models:

EntityResponse

GraphResponse

OperationResponse

Development

Running Tests

Adding New Features

  1. Update validation rules in validation.py
  1. Add tests in tests/test_validation.py
  1. Implement changes in knowledge_graph_manager.py