mcp-knowledge-graph
mcp-knowledge-graph
지식 그래프 메모리 서버
사용자 정의 가능한 --memory-path 사용하여 로컬 지식 그래프를 사용하여 지속적 메모리를 개선하여 구현했습니다.
이를 통해 AI 모델은 채팅 전반에 걸쳐 사용자 정보를 기억할 수 있습니다. 이 기능은 모델 컨텍스트 프로토콜(MCP) 또는 함수 호출 기능을 지원하는 모든 AI 모델과 호환됩니다.
[!NOTE] 이것은 원래 메모리 서버 의 포크이며 임시 메모리 npx 설치 방법을 사용하지 않도록 의도되었습니다.
서버 이름
지엑스피1


Related MCP server: Knowledge Graph Memory Server
핵심 개념
엔티티
엔티티는 지식 그래프의 주요 노드입니다. 각 엔티티는 다음을 갖습니다.
고유한 이름(식별자)
엔터티 유형(예: "사람", "조직", "이벤트")
관찰 목록
예:
{
"name": "John_Smith",
"entityType": "person",
"observations": ["Speaks fluent Spanish"]
}처지
관계는 엔티티 간의 방향성 있는 연결을 정의합니다. 관계는 항상 능동태로 저장되며 엔티티가 서로 어떻게 상호 작용하거나 관계를 맺는지 설명합니다.
예:
{
"from": "John_Smith",
"to": "ExampleCorp",
"relationType": "works_at"
}관찰
관찰은 개체에 대한 개별적인 정보입니다. 관찰은 다음과 같습니다.
문자열로 저장됨
특정 엔터티에 첨부됨
독립적으로 추가하거나 제거할 수 있습니다
원자적이어야 함(관찰당 하나의 사실)
예:
{
"entityName": "John_Smith",
"observations": [
"Speaks fluent Spanish",
"Graduated in 2019",
"Prefers morning meetings"
]
}API
도구
엔티티 생성
지식 그래프에 여러 개의 새 엔터티 만들기
입력:
entities(객체 배열)각 객체에는 다음이 포함됩니다.
name(문자열): 엔터티 식별자entityType(문자열): 유형 분류observations(문자열[]): 연관된 관찰
기존 이름을 가진 엔터티를 무시합니다.
관계 생성
엔터티 간에 여러 개의 새로운 관계를 생성합니다.
입력:
relations(객체 배열)각 객체에는 다음이 포함됩니다.
from(문자열): 소스 엔터티 이름to(문자열): 대상 엔터티 이름relationType(문자열): 활성태의 관계 유형
중복된 관계를 건너뜁니다.
관찰 추가
기존 엔터티에 새로운 관찰 추가
입력:
observations(객체 배열)각 객체에는 다음이 포함됩니다.
entityName(문자열): 대상 엔티티contents(문자열[]): 추가할 새로운 관찰
엔터티당 추가된 관찰 결과를 반환합니다.
엔터티가 존재하지 않으면 실패합니다.
엔티티 삭제
엔터티와 해당 관계 제거
입력:
entityNames(string[])연관된 관계의 계단식 삭제
엔터티가 존재하지 않으면 자동 작업
관찰 삭제
엔터티에서 특정 관찰을 제거합니다.
입력:
deletions(객체 배열)각 객체에는 다음이 포함됩니다.
entityName(문자열): 대상 엔티티observations(string[]): 제거할 관찰
관찰이 존재하지 않으면 조용한 작동
관계 삭제
그래프에서 특정 관계 제거
입력:
relations(객체 배열)각 객체에는 다음이 포함됩니다.
from(문자열): 소스 엔터티 이름to(문자열): 대상 엔터티 이름relationType(문자열): 관계 유형
관계가 존재하지 않으면 자동 작업
읽기_그래프
지식 그래프 전체를 읽어보세요
입력이 필요하지 않습니다
모든 엔터티와 관계가 포함된 완전한 그래프 구조를 반환합니다.
검색_노드
쿼리 기반 노드 검색
입력:
query(문자열)검색 범위:
엔터티 이름
엔터티 유형
관찰 내용
일치하는 엔터티와 해당 관계를 반환합니다.
오픈 노드
이름으로 특정 노드 검색
입력:
names(string[])보고:
요청된 엔터티
요청된 엔터티 간의 관계
존재하지 않는 노드를 자동으로 건너뜁니다.
MCP 호환 플랫폼 사용
이 서버는 Claude, GPT, Llama 등을 포함하여 MCP(모델 컨텍스트 프로토콜) 또는 함수 호출 기능을 지원하는 모든 AI 플랫폼과 함께 사용할 수 있습니다.
Claude Desktop으로 설정
claude_desktop_config.json에 다음을 추가하세요.
{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}다른 AI 플랫폼으로 설정
함수 호출 또는 MCP 표준을 지원하는 모든 AI 플랫폼은 이 서버에 연결할 수 있습니다. 구체적인 구성은 플랫폼에 따라 다르지만, 서버는 MCP 인터페이스를 통해 표준 도구를 제공합니다.
사용자 정의 메모리 경로
메모리 파일에 대한 사용자 지정 경로를 지정할 수 있습니다.
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory", "--memory-path", "/path/to/your/memory.jsonl"]
}
}
}경로가 지정되지 않으면 서버 설치 디렉토리의 memory.jsonl이 기본값으로 사용됩니다.
시스템 프롬프트
메모리 활용 프롬프트는 사용 사례와 사용 중인 AI 모델에 따라 달라집니다. 프롬프트를 변경하면 모델이 생성되는 메모리의 빈도와 유형을 판단하는 데 도움이 됩니다.
다음은 모든 AI 모델에 적용할 수 있는 채팅 개인화 프롬프트 예시입니다. Claude 사용자의 경우, Claude.ai 프로젝트 의 "사용자 지정 지침" 필드에서 이 프롬프트를 사용할 수 있습니다. 다른 모델의 경우, 해당 지침 형식에 맞게 수정하세요.
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 Gathering:
- 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
c) Store facts about them as observations다른 AI 모델과의 통합
이 서버는 모델 컨텍스트 프로토콜(MCP) 표준을 구현하여 함수 호출을 지원하는 모든 AI 모델과 호환됩니다. 지식 그래프 구조와 API는 모델에 구애받지 않으므로 다양한 AI 플랫폼과 유연하게 통합할 수 있습니다.
다른 모델과 통합하려면:
MCP 서버에 액세스하도록 모델 구성
모델이 노출된 도구에 대한 함수 호출을 수행할 수 있는지 확인하십시오.
시스템 프롬프트를 특정 모델의 지침 형식에 맞게 조정합니다.
모델에 관계없이 동일한 지식 그래프 작업을 사용합니다.
특허
이 MCP 서버는 MIT 라이선스에 따라 라이선스가 부여됩니다. 즉, MIT 라이선스의 조건에 따라 소프트웨어를 자유롭게 사용, 수정 및 배포할 수 있습니다. 자세한 내용은 프로젝트 저장소의 LICENSE 파일을 참조하세요.
Available Tools
10 toolsaim_memory_add_factsA
Add new facts to an existing memory. Use this to append information to something already stored.
IMPORTANT: Memory must already exist - use aim_memory_store first. Throws error if not found.
RETURNS: Array of {entityName, addedObservations} showing what was added (duplicates are ignored).
DATABASE: Adds to entities in the specified 'context' database, or master database if not specified.
EXAMPLES:
aim_memory_add_facts({observations: [{entityName: "John", contents: ["Lives in Seattle", "Works in tech"]}]})
aim_memory_add_facts({context: "work", observations: [{entityName: "Q4_Project", contents: ["Behind schedule", "Need more resources"]}]})
Inputs: observations (required), context, location.
aim_memory_forgetA
Forget memories. Removes memories and their associated links.
DATABASE SELECTION: Entities are deleted from the specified database's knowledge graph.
LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
EXAMPLES:
Master database (default): aim_memory_forget({entityNames: ["OldProject"]})
Work database: aim_memory_forget({context: "work", entityNames: ["CompletedTask", "CancelledMeeting"]})
Master database in global location: aim_memory_forget({location: "global", entityNames: ["OldProject"]})
Personal database in project location: aim_memory_forget({context: "personal", location: "project", entityNames: ["ExpiredReminder"]})
Inputs: entityNames (required), context, location.
aim_memory_getA
Retrieve specific memories by exact name. Use this when you know exactly what you're looking for.
VS aim_memory_search: Use aim_memory_get for exact name lookup. Use aim_memory_search for fuzzy matching or when you don't know exact names.
RETURNS: Requested entities and relations between them. Non-existent names are silently ignored.
FORMAT OPTIONS:
"json" (default): Structured JSON for programmatic use
"pretty": Human-readable text format
EXAMPLES:
aim_memory_get({names: ["John", "TechConf2024"]}) - JSON format
aim_memory_get({names: ["Shane"], format: "pretty"}) - Human-readable
aim_memory_get({context: "work", names: ["Q4_Project"], format: "pretty"})
Inputs: names (required), context, location, format.
aim_memory_linkA
Link two memories together with a relationship. Use this to connect related information.
RELATION STRUCTURE: Each link has 'from' (subject), 'relationType' (verb), and 'to' (object).
Use active voice verbs: "manages", "works_at", "knows", "attended", "created"
Read as: "from relationType to" (e.g., "Alice manages Q4_Project")
Avoid passive: use "manages" not "is_managed_by"
IMPORTANT: Both 'from' and 'to' entities must already exist in the same database.
RETURNS: Array of created relations (duplicates are ignored).
DATABASE: Relations are created in the specified 'context' database, or master database if not specified.
EXAMPLES:
aim_memory_link({relations: [{from: "John", to: "TechConf2024", relationType: "attended"}]})
aim_memory_link({context: "work", relations: [{from: "Alice", to: "Q4_Project", relationType: "manages"}]})
Multiple: aim_memory_link({relations: [{from: "John", to: "Alice", relationType: "knows"}, {from: "John", to: "Acme_Corp", relationType: "works_at"}]})
Inputs: relations (required), context, location.
aim_memory_list_storesA
List all available memory databases and show current storage location.
DATABASE TYPES:
"default": The master database (memory.jsonl) - used when no context is specified
Named databases: Created via context parameter (e.g., "work" -> memory-work.jsonl)
RETURNS: {project_databases: [...], global_databases: [...], current_location: "..."}
project_databases: Databases in .aim directory (if project detected)
global_databases: Databases in global --memory-path directory
current_location: Where operations will default to
Use this to discover what databases exist before querying them.
EXAMPLES:
aim_memory_list_stores() - Shows all available databases and current storage location
Inputs: no named parameters.
aim_memory_read_allA
Read all memories in a database. Returns every stored memory and their links.
FORMAT OPTIONS:
"json" (default): Structured JSON for programmatic use
"pretty": Human-readable text format
DATABASE: Reads from the specified 'context' database, or master database if not specified.
EXAMPLES:
aim_memory_read_all({}) - JSON format
aim_memory_read_all({format: "pretty"}) - Human-readable
aim_memory_read_all({context: "work", format: "pretty"}) - Work database, pretty
Inputs: context, location, format.
aim_memory_remove_factsA
Remove specific facts from a memory. Keeps the memory but removes selected observations.
DATABASE SELECTION: Observations are deleted from entities within the specified database's knowledge graph.
LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
EXAMPLES:
Master database (default): aim_memory_remove_facts({deletions: [{entityName: "John", observations: ["Outdated info"]}]})
Work database: aim_memory_remove_facts({context: "work", deletions: [{entityName: "Project", observations: ["Old deadline"]}]})
Master database in global location: aim_memory_remove_facts({location: "global", deletions: [{entityName: "John", observations: ["Outdated info"]}]})
Health database in project location: aim_memory_remove_facts({context: "health", location: "project", deletions: [{entityName: "Exercise", observations: ["Injured knee"]}]})
Inputs: deletions (required), context, location.
aim_memory_searchA
Search memories by keyword. Use this when you don't know the exact name of what you're looking for.
WHAT IT SEARCHES: Matches query (case-insensitive) against:
Memory names (e.g., "John" matches "John_Smith")
Memory types (e.g., "person" matches all person memories)
Facts/observations (e.g., "Seattle" matches memories mentioning Seattle)
VS aim_memory_get: Use aim_memory_search for fuzzy matching. Use aim_memory_get when you know exact names.
FORMAT OPTIONS:
"json" (default): Structured JSON for programmatic use
"pretty": Human-readable text format
EXAMPLES:
aim_memory_search({query: "John"}) - JSON format
aim_memory_search({query: "project", format: "pretty"}) - Human-readable
aim_memory_search({context: "work", query: "Shane", format: "pretty"})
Inputs: query (required), context, location, format.
aim_memory_storeA
Store new memories. Use this to remember people, projects, concepts, or any information worth persisting.
AIM (AI Memory) provides persistent memory for AI assistants. The 'aim_memory_' prefix groups all memory tools together.
WHAT'S STORED: Memories have a name, type (person/project/concept/etc.), and observations (facts about them).
DATABASES: Use the 'context' parameter to organize memories into separate graphs:
Leave blank: Uses the master database (default for general information)
Any name: Creates/uses a named database ('work', 'personal', 'health', 'research', etc.)
New databases are created automatically - no setup required
IMPORTANT: Use consistent, simple names - prefer 'work' over 'work-stuff'
STORAGE LOCATIONS: Files are stored as JSONL (e.g., memory.jsonl, memory-work.jsonl):
Project-local: .aim directory in project root (auto-detected if exists)
Global: User's configured --memory-path directory
Use 'location' parameter to override: 'project' or 'global'
RETURNS: Array of created entities.
EXAMPLES:
Master database (default): aim_memory_store({entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]})
Work database: aim_memory_store({context: "work", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]})
Master database in global location: aim_memory_store({location: "global", entities: [{name: "John", entityType: "person", observations: ["Met at conference"]}]})
Work database in project location: aim_memory_store({context: "work", location: "project", entities: [{name: "Q4_Project", entityType: "project", observations: ["Due December 2024"]}]})
Inputs: entities (required), context, location.
aim_memory_unlinkA
Remove links between memories. Keeps the memories but removes their connections.
DATABASE SELECTION: Relations are deleted from the specified database's knowledge graph.
LOCATION OVERRIDE: Use the 'location' parameter to force deletion from 'project' (.aim directory) or 'global' (configured directory). Leave blank for auto-detection.
EXAMPLES:
Master database (default): aim_memory_unlink({relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]})
Work database: aim_memory_unlink({context: "work", relations: [{from: "Alice", to: "CancelledProject", relationType: "manages"}]})
Master database in global location: aim_memory_unlink({location: "global", relations: [{from: "John", to: "OldCompany", relationType: "worked_at"}]})
Personal database in project location: aim_memory_unlink({context: "personal", location: "project", relations: [{from: "Me", to: "OldHobby", relationType: "enjoys"}]})
Inputs: relations (required), context, location.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a distinct action—store, retrieve, search, list, link, unlink, etc.—with no overlapping purposes. The descriptions clearly differentiate similar tools like get vs search and read_all vs list_stores.
All tools use the consistent prefix 'aim_memory_' followed by a clear snake_case action verb (store, add_facts, get, search, read_all, list_stores, forget, remove_facts, link, unlink). No mixing of styles.
10 tools cover the essential operations for a knowledge graph memory system—CRUD for entities and relations, plus search and listing. This is well-scoped without being excessive or sparse.
The tool set covers creation, retrieval, search, listing, linking, and deletion of entities and facts. Missing is a direct update for entity names or types (requires forget+re-store), but this is a minor gap given the add/remove facts functionality.
Maintenance
Related MCP Connectors
Persistent, outcome-grounded episodic memory for Claude. 14ms CPU retrieval, no GPU, no vector DB.
Persistent memory for AI assistants: store, search, and connect knowledge across conversations.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Your own memory inside ChatGPT and Claude, with the source of every note.
Related MCP Servers
- FlicenseAqualityBmaintenanceA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.9340,089 npm92,139-
- AlicenseBqualityFmaintenanceA persistent memory implementation using a local knowledge graph that lets Claude remember information about users across conversations.96MIT
- AlicenseAqualityNot gradedmaintenanceAn implementation of persistent memory for Claude using a local knowledge graph, allowing the AI to remember information about users across conversations with customizable storage location.1162JavaScriptMIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude to remember information about users across chats using a persistent local knowledge graph that stores entities, relationships, and observations.MIT