Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Memorizer v1 MCP 서버는 LLM(대규모 언어 모델)이 컨텍스트와 메모리를 재사용하고 기억할 수 있도록 돕는 컨텍스트/메모리 서버입니다[3]. 이 서버는 에이전트가 서버 전송 이벤트를 통해 통신하며, 인간 운영자는 UI를 통해 메모리를 확인하고 관리할 수 있습니다[6].

Memorizer는 Postgres와 PG vector, 그리고 임베딩 생성을 위한 작은 Llama 인스턴스에 의존하며, 이 모든 것은 Docker Compose 파일을 통해 자동으로 설정될 수 있습니다[51]. GPU 없이도 Raspberry Pi와 같은 저사양 컴퓨터에서도 실행 가능합니다

 mcp.webnori.com

다음 오픈소스를 통해 이러한 컨셉을 로컬에서 수행또는 팀지식 장기메모리를 위한 용도로 구축해 활용할수 있습니다.

git :

...

    • Graph탐색지원


위 오픈소스를 Pull한후 다음 명령을 수행해 로컬에 셋업

로컬 인프라 구동 - 팀메모리

Code Block
themeEmacs

docker compose up -d
  • 로컬구동
    • - Start PostgreSQL with pgvector (port 5432)
      - Start PgAdmin (port 5050)
      - Start Ollama (port 11434)
      - Start Memorizer API (port 5000) 

...

Code Block
themeEmacs
titleappsettings.json

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ConnectionStrings": {
    "Storage": "Host=localhost;Port=5432;Database=postgmem;Username=postgres;Password=postgres"
  },
  "Embeddings": {
    "ApiUrl": "http://localhost:11434",
    "Model": "all-minilm:33m-l12-v2-fp16"
  },
  "LLM": {
    "ApiUrl": "http://localhost:11434",
    "Model": "qwen2:0.5b",
    "Timeout": "00:02:00"
  },
  "Server": {
    "CanonicalUrl": "http://memorizer-test.local:5012"
  }
} 
  • 샘플은 CPU로 작동하는 저성능버전으로 , 임베딩및 학습품질을 더 높이려면 고급모델로 교체할수 있습니다. 여기서의 샘플은 저성능 버전이용

 


로컬 어플리케이션구동 - 로컬MCP

Code Block
themeEmacs

dotnet publish -c Release /t:PublishContainer
  • dotnet 미설치시 리눅스 dot net sdk 9 설치법 GPT에 문의...

 

MCP설정 - VS CODE용

Code Block
themeEmacs

{
	"servers": {
		"microsoft.docs.mcp": {
			"type": "http",
			"url": "https://learn.microsoft.com/api/mcp"
		},
		"memorizer": {
			"type": "sse",
			"url": "http://localhost:5000/sse"
    	}
	},
	"inputs": []
}
  • memorizer가 장기기억(학습)용
  • ms learn-mcp는 ms의 거대한 msdn 문서

...


메모리(지식)를 중앙 DB관리함으로 팀지식을 만들어 갈수 있습니다. ( 응용방법은 다양)

관리툴을 먼저 살펴본후 MCP이용도 확인해보겠습니다.

메모리 검색및 생성

 


메모리생성(지식)

 


RAG화

  • 실시간으로 업데이트가 되지만 다양한 옵션으로 메모리(지식)를 재 업데이트 하는 기능

...


Graph RAG

Image Added

  • Graph Rag를 추가지원 -확장버전


테스트

팀의 장기기억메모리를 활용하는 컨셉을 알기위해 수행

...

  • llm과 연계해 mcp를 이용해 저장도 가능하지만, 수동으로 메모리를 생성및 편집기능을 지원

 


Vector검색

  • 메모리추가후 기본적인 벡터검색이 되나 확인....

...


LLM(+MCP) 과 연계해 잘작동하는지 확인

 


LLM이용하면서 좋은내용이면 학습시키기

  • 시키지도 안했는데~ 저장해준다고함 ..저장시킴
  • LLM이용하다 좋은내용이 히스토리 어딘가에 있지만 찾기가 힘듬... 장기메모리에 베스트케이스면 지속저장해 메모리를 보강 - 좋은 컨텐츠로 지식업+
  • 구축된 DB에 업데이트되어 함께이용시 팀공유된 지식으로 확장해 나갈수 있습니다.

 


관리툴에서 메모리 추가되었나 확인

  • LLM이용해 저장한 메모리 잘 저장되어있음

...


샘플은 코드이지만 꼭 코드로 한정지을 필요없이 다양한 팀생산활동의 지식을 관리

 


LLM에서 다시확인 

  • LLM이 생성한 결과를 잘 검색 ( 실시간은 아니지만 학습이 수초내 수행될것으로 예상 - 임베딩및,LLM성능)

...


핵심코드 살펴보기

Image Modified

 

    • 이 코드를 분석해 새로운 버전을 다른언어로 만들고자할때 참고할수 있겠습니다.


MCP의 기본개념과 MCP를 이용한 장기기억메모리 파트와 관련한 컨셉은 다음 영상및 영상분석에서 더 자세한 컨셉및 기초개념을 알수 있습니다.

...

 

PlayGround

모두의 MCP 메모리 :  Playground 데모로 임시 운행합니다.

...

  • 다양한 CQRS 액터모델 양산하는 개인 연구저장소입니다.

Rule for MCP

🧠 Example System Prompt for LLMs

Important

⚡ Pro Tip: Add this system prompt to your AGENT.md, Cursor Rules files, or any AI agent configuration! This will dramatically improve how often and effectively your LLM uses the Memorizer service for persistent memory management.

You have access to a long-term memory system via the Model Context Protocol (MCP) at the endpoint memorizer. Use the following tools:

  • store: Store a new memory. Parameters: type, content (markdown), source, tags, confidence, relatedTo (optional, memory ID), relationshipType (optional).
  • search: Search for similar memories. Parameters: query, limit, minSimilarity, filterTags.
  • get: Retrieve a memory by ID. Parameter: id.
  • getMany: Retrieve multiple memories by their IDs. Parameter: ids (list of IDs).
  • delete: Delete a memory by ID. Parameter: id.
  • createRelationship: Create a relationship between two memories. Parameters: fromId, toId, type.

Use these tools to remember, recall, relate, and manage information as needed to assist the user. You can also manually retrieve or relate memories by their IDs when necessary.

Expand
title프롬프트 for LLMs

🧠 LLM용 예시 시스템 프롬프트
중요

Pro Tip:
이 시스템 프롬프트를 AGENT.md, Cursor Rules 파일 또는 AI 에이전트 설정에 추가하세요.
그러면 LLM이 Memorizer 서비스를 장기 메모리 관리에 훨씬 더 자주, 효과적으로 활용하게 됩니다.


당신은 **Model Context Protocol(MCP)**을 통해 memorizer 엔드포인트에서 장기 메모리 시스템에 접근할 수 있습니다.
다음 도구들을 사용할 수 있습니다:

  • store: 새 메모리를 저장
    매개변수:

    • type

    • content (markdown)

    • source

    • tags

    • confidence

    • relatedTo (선택, 메모리 ID)

    • relationshipType (선택)

  • search: 유사한 메모리 검색
    매개변수:

    • query

    • limit

    • minSimilarity

    • filterTags

  • get: ID로 메모리 가져오기
    매개변수:

    • id

  • getMany: 여러 메모리를 ID 목록으로 가져오기
    매개변수:

    • ids (ID 리스트)

  • delete: ID로 메모리 삭제
    매개변수:

    • id

  • createRelationship: 두 메모리 간 관계 생성
    매개변수:

    • fromId

    • toId

    • type



프로젝트지침 : 사용자

Code Block
themeEmacs

{
	"servers": {
		"memorizer": {
			"type": "sse",
			"url": "https://mcp.webnori.com/sse"
    	}
	},
	"inputs": []
}

 

...

MCP 기능을 참고  다음 Rule을 준수할것

Rule:

- 요청내용에 대해 메모리 먼저 검색해 활용할것, 연관자료 없을시 너의 자체 지식활용
- 메모리 저장 여부는 물어보고 저장할것 - 자동저장 금지
- 요약한후 메모리 저장이란 요청이 있을시, 메모리검색 없이 신규정보로 저장


## 📌 MCP를 통한 장기 메모리 접근
당신은 **Model Context Protocol(MCP)**을 통해 `memorizer` 엔드포인트에서 장기 메모리 시스템에 접근할 수 있습니다.  
다음 도구들을 사용할 수 있습니다:

---

### 1. **store** — 새 메모리를 저장
**매개변수:**
- `type`  
- `content` (markdown)  
- `source`  
- `tags`  
- `confidence`  
- `relatedTo` (선택, 메모리 ID)  
- `relationshipType` (선택)

---

### 2. **search** — 유사한 메모리 검색
**매개변수:**
- `query`  
- `limit`  
- `minSimilarity`  
- `filterTags`

---

### 3. **get** — ID로 메모리 가져오기
**매개변수:**
- `id`

---

### 4. **getMany** — 여러 메모리를 ID 목록으로 가져오기
**매개변수:**
- `ids` (ID 리스트)

---

### 5. **delete** — ID로 메모리 삭제
**매개변수:**
- `id`

---

### 6. **createRelationship** — 두 메모리 간 관계 생성
**매개변수:**
- `fromId`  
- `toId`  
- `type`



MCP Nginx PROXY를 위한추가팁

Code Block
themeEmacs
# location 컨텍스트에서 유효
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# SSE는 스트림을 즉시 흘려보내야 함
proxy_buffering off;
proxy_request_buffering off;
proxy_cache off;

# 압축/청크가 스트림을 묶지 않도록
gzip off;
proxy_set_header Accept-Encoding "";

# 커넥션/타임아웃
proxy_http_version 1.1;
proxy_read_timeout 1h;
proxy_send_timeout 1h;

# Nginx가 헤더를 재작성하지 않도록(일부 환경에서 유용)
proxy_set_header Connection "";
  • SSE를 SSL Proxy시 모드로 작동시 참고 - http 1.1버전