메모리 커스텀
이 프로젝트는 MCP 팀이 제공하는 메모리 서버에 새로운 기능을 추가합니다. 언어 모델(LLM)을 통해 상호작용을 포착하는 지식 그래프를 생성하고 관리할 수 있도록 합니다.
새로운 기능
1. 사용자 정의 메모리 경로
- 이제 사용자는 다양한 프로젝트에 대해 서로 다른 메모리 파일 경로를 지정할 수 있습니다.
- 이유 : 이 기능은 메모리 데이터의 구성 및 관리를 향상시켜 프로젝트별 메모리 저장을 가능하게 합니다.
2. 타임스탬핑
- 이제 서버는 상호작용에 대한 타임스탬프를 생성합니다.
- 이유 : 타임스탬프를 사용하면 각 메모리가 생성되거나 수정된 시점을 추적하여 저장된 데이터에 대한 더 나은 맥락과 내역을 제공할 수 있습니다.
시작하기
필수 조건
Smithery를 통해 설치
Smithery 를 통해 Claude Desktop용 Knowledge Graph Memory Server를 자동으로 설치하려면:
지엑스피1
설치
- 저장소를 복제합니다.
git clone git@github.com:BRO3886/mcp-memory-custom.git
cd mcp-memory-custom
- 종속성을 설치합니다.
구성
서버를 실행하기 전에 MEMORY_FILE_PATH
환경 변수를 설정하여 메모리 파일의 경로를 지정할 수 있습니다. 설정하지 않으면 서버는 기본적으로 스크립트와 같은 디렉터리에 있는 memory.json
을 사용합니다.
서버 실행
mcp 서버 json 파일 업데이트
claude_desktop_config.json
/ .cursor/mcp.json
파일에 다음을 추가하세요.
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/mcp-memory-custom/dist/index.js"]
}
}
}
시스템 프롬프트 변경 사항:
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).
로컬에서 서버 실행
지식 그래프 메모리 서버를 시작하려면 다음을 실행하세요.
npm run build
node dist/index.js
서버는 표준 입출력을 통해 요청을 수신합니다.
API 엔드포인트
서버는 특정 매개변수로 호출할 수 있는 여러 도구를 제공합니다.
- 현재 시간 가져오기
- 메모리 파일 경로 설정
- 엔터티 생성
- 관계 만들기
- 관찰 추가
- 엔터티 삭제
- 관찰 삭제
- 관계 삭제
- 그래프 읽기
- 노드 검색
- 오픈 노드
감사의 말
- Anthropic의 메모리 서버에서 영감을 받았습니다.