Skip to main content
Glama

YourMemory

LoCoMo에서 Mem0보다 16pp 더 나은 회상 성능. 100%의 오래된 메모리 정밀도. AI 에이전트를 위한 생물학적 영감을 받은 메모리 감쇠.

Claude 및 모든 MCP 호환 AI를 위한 지속적 메모리 — 인간의 기억처럼 작동합니다. 중요한 것은 남고, 잊혀진 것은 희미해지며, 오래된 사실은 자동으로 정리됩니다. 관련 메모리는 그들 사이의 연결을 이해하는 그래프 계층을 통해 더 오래 유지됩니다.

초기 단계 — 피드백과 아이디어를 환영합니다.


벤치마크

공개 LoCoMo 데이터셋(Snap Research)에서 Mem0(무료 티어)과 비교 평가 — 총 10개의 대화 쌍, 200개의 QA 쌍.

지표

YourMemory

Mem0

차이

LoCoMo Recall@5 (200 QA 쌍)

34%

18%

+16pp

오래된 메모리 정밀도 (5개의 모순 쌍)

100%

0%

+100pp

정리된 메모리 (노이즈 감소)

20%

0%

전체 방법론 및 샘플별 결과는 BENCHMARKS.md에서 확인하세요. 작성 글 읽기: I built memory decay for AI agents using the Ebbinghaus forgetting curve


작동 원리

에빙하우스 망각 곡선

base_λ      = DECAY_RATES[category]
effective_λ = base_λ × (1 - importance × 0.8)
strength    = importance × e^(-effective_λ × days) × (1 + recall_count × 0.2)
score       = cosine_similarity × strength

감쇠율은 카테고리에 따라 다릅니다 — 실패 메모리는 빠르게 사라지고, 전략은 더 오래 지속됩니다:

카테고리

기본 λ

회상 없이 생존

사용 사례

strategy

0.10

~38일

효과적인 방법 — 성공적인 패턴

fact

0.16

~24일

사용자 선호도, 정체성

assumption

0.20

~19일

추론된 컨텍스트

failure

0.35

~11일

잘못된 점 — 환경별 오류

중요도는 각 카테고리 내에서 감쇠율을 추가로 조절합니다. 자주 회상되는 메모리는 감쇠를 상쇄하는 recall_count 부스트를 얻습니다. 강도가 0.05 미만인 메모리는 자동으로 정리됩니다.

하이브리드 벡터 + 그래프 엔진 (v1.3.0)

검색은 두 단계로 실행됩니다:

1단계 — 벡터 검색: 모든 메모리에 대한 코사인 유사도. 유사도 임계값 이상의 상위 k개를 반환합니다.

2단계 — 그래프 확장: 1단계 시드로부터 BFS 탐색. 유사도 컷오프 미만이지만 상위 결과와 관련된 메모리를 표면화합니다 — 어휘는 다르지만 컨텍스트를 공유하는 메모리들입니다.

recall("Python backend")
  Round 1 → [1] Python/MongoDB (sim=0.61), [2] DuckDB/spaCy (sim=0.19)
  Round 2 → [5] Docker/Kubernetes (sim=0.29, below cut-off but graph neighbour of [1])
            surfaced via graph even though vector search missed it

체인 인식 정리: 그래프 이웃 중 하나라도 정리 임계값 이상이면 메모리가 유지됩니다. 관련 메모리는 함께 노화됩니다 — 하나의 강력한 메모리가 연결된 클러스터 전체를 삭제로부터 보호합니다.

회상 전파: 메모리를 회상하면 자동으로 그래프 이웃의 recall_count가 증가합니다. 자주 액세스되는 메모리는 관련 컨텍스트를 신선하게 유지합니다.

의미론적 에지: 그래프 에지는 삽입 순서가 아닌 코사인 유사도(임계값 ≥ 0.4)를 기반으로 생성됩니다. 에지 가중치 = spaCy로 추출된 SVO 술어의 similarity × verb_weight입니다.


설정

인프라 불필요 — DuckDB를 즉시 사용합니다. 두 가지 명령어로 완료됩니다.

Python 3.11, 3.12, 3.13, 3.14를 지원합니다.

1. 설치

pip install yourmemory

모든 종속성이 자동으로 설치됩니다. 클론, Docker, 데이터베이스 설정이 필요 없습니다.

2. 설정 실행 (1회)

yourmemory-setup

spaCy 언어 모델을 다운로드하고 데이터베이스를 초기화합니다. 설치 후 한 번만 실행하세요.

3. 구성 가져오기

yourmemory-path

전체 실행 파일 경로와 모든 MCP 클라이언트에 붙여넣을 수 있는 구성을 출력합니다. 복사하세요.

4. AI 클라이언트에 연결

데이터베이스는 처음 사용할 때 ~/.yourmemory/memories.duckdb에 자동으로 생성됩니다.

Claude Code

~/.claude/settings.json에 추가:

{
  "mcpServers": {
    "yourmemory": {
      "command": "yourmemory"
    }
  }
}

Claude Code를 다시 로드하세요 (Cmd+Shift+PDeveloper: Reload Window).

Cline (VS Code)

VS Code는 셸 PATH를 상속하지 않습니다. 터미널에서 다음을 실행하여 붙여넣을 정확한 구성을 얻으세요:

yourmemory-path

그런 다음 Cline → MCP ServersEdit MCP Settings에 출력을 붙여넣으세요. 다음과 같습니다:

{
  "mcpServers": {
    "yourmemory": {
      "command": "/full/path/to/yourmemory",
      "args": [],
      "env": {
        "YOURMEMORY_USER": "your_name",
        "DATABASE_URL": ""
      }
    }
  }
}

저장 후 Cline을 다시 시작하세요.

Cursor

~/.cursor/mcp.json에 추가:

{
  "mcpServers": {
    "yourmemory": {
      "command": "/full/path/to/yourmemory",
      "args": [],
      "env": {
        "YOURMEMORY_USER": "your_name",
        "DATABASE_URL": ""
      }
    }
  }
}

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json(macOS) 또는 %APPDATA%\Claude\claude_desktop_config.json(Windows)에 추가:

{
  "mcpServers": {
    "yourmemory": {
      "command": "yourmemory"
    }
  }
}

Claude Desktop을 다시 시작하세요.

모든 MCP 호환 클라이언트

YourMemory는 표준 stdio MCP 서버입니다. Claude Code, Claude Desktop, Cline, Cursor, Windsurf, Continue, Zed와 작동합니다. 클라이언트가 셸 PATH를 상속하지 않는 경우 yourmemory-path의 전체 경로를 사용하세요.

5. 프로젝트에 메모리 지침 추가

sample_CLAUDE.md를 프로젝트 루트에 CLAUDE.md로 복사하고 다음을 교체하세요:

  • YOUR_NAME — 귀하의 이름 (예: Alice)

  • YOUR_USER_ID — 메모리 네임스페이스 지정에 사용 (예: alice)

이제 Claude는 모든 작업에서 회상 → 저장 → 업데이트 워크플로우를 자동으로 따릅니다.


멀티 에이전트 공유 및 개인 메모리

여러 AI 에이전트가 동일한 YourMemory 인스턴스를 공유할 수 있습니다. 각 에이전트는 고유한 정체성, 격리된 개인 메모리, 공유 컨텍스트에 대한 제어된 액세스 권한을 가집니다.

작동 방식

모든 메모리에는 가시성을 제어하는 두 개의 필드가 있습니다:

필드

의미

visibility

shared (기본값)

모든 에이전트(또는 사용자)가 이 메모리를 회상할 수 있음

visibility

private

저장한 에이전트만 회상할 수 있음

agent_id

예: "coding-agent"

이 메모리를 소유한 에이전트

에이전트는 API 키(접두사 ym_)로 인증합니다. 키가 없으면 호출자는 사용자로 간주되며 shared 메모리만 읽고 쓸 수 있습니다.

에이전트 등록

from src.services.api_keys import register_agent

result = register_agent(
    agent_id="coding-agent",
    user_id="sachit",
    description="Handles code review and refactoring tasks",
    can_read=["shared", "private"],   # what this agent can read
    can_write=["shared", "private"],  # what it can write
)

print(result["api_key"])  # ym_xxxx — save this, shown once only

키는 저장 전에 SHA-256으로 해싱됩니다. 일반 텍스트는 절대 저장되지 않으므로 분실 시 취소하고 다시 등록하세요.

MCP 호출에서 API 키 사용

모든 MCP 도구 호출에 api_key를 전달하세요:

# Store a private memory — only this agent can recall it
store_memory(
    content="The auth service on staging uses a self-signed cert — skip SSL verify",
    importance=0.7,
    category="failure",
    api_key="ym_xxxx",
    visibility="private"
)

# Store shared context — any agent can recall it
store_memory(
    content="Production database is on PostgreSQL 16, us-east-1",
    importance=0.8,
    category="fact",
    api_key="ym_xxxx",
    visibility="shared"
)

# Recall — returns shared memories + this agent's private memories
recall_memory(
    query="database production",
    api_key="ym_xxxx"
)

api_key가 없으면 회상은 공유 메모리만 반환합니다.

액세스 제어

에이전트를 등록할 때 can_read는 에이전트가 액세스할 수 있는 가시성 계층을 제어합니다:

# Read-only agent — can see shared context but cannot store private memories
register_agent(
    agent_id="readonly-summarizer",
    user_id="sachit",
    can_read=["shared"],
    can_write=["shared"],
)

# Isolated agent — private memory only, cannot read shared context
register_agent(
    agent_id="isolated-agent",
    user_id="sachit",
    can_read=["private"],
    can_write=["private"],
)

예시: 컨텍스트를 공유하는 두 에이전트

coding-agent stores:
  → "Sachit uses pytest for all Python tests"  (shared, importance=0.8)
  → "Staging API key is sk-staging-xxx"         (private, importance=0.9)

review-agent recalls "Python testing":
  ← "Sachit uses pytest for all Python tests"   ✓ (shared — visible)
  ← "Staging API key is sk-staging-xxx"          ✗ (private — hidden)

coding-agent recalls "Python testing":
  ← "Sachit uses pytest for all Python tests"   ✓ (shared)
  ← "Staging API key is sk-staging-xxx"          ✓ (private — owns it)

에이전트 취소

from src.services.api_keys import revoke_agent

revoke_agent(agent_id="coding-agent", user_id="sachit")
# Key is invalidated immediately — all future calls with it return 401

MCP 도구

도구

호출 시기

recall_memory

모든 작업 시작 시 — 관련 컨텍스트 표면화

store_memory

새로운 선호도, 사실, 실패 또는 전략을 학습한 후

update_memory

회상된 메모리가 오래되었거나 병합이 필요할 때

store_memory는 감쇠율을 제어하기 위해 선택적 category 매개변수를 허용합니다:

# Failure — decays in ~11 days (environment changes fast)
store_memory(
    content="OAuth for client X fails — redirect URI must be app.example.com",
    importance=0.6,
    category="failure"
)

# Strategy — decays in ~38 days (successful patterns stay relevant)
store_memory(
    content="Cursor pagination fixed the 30s timeout on large user queries",
    importance=0.7,
    category="strategy"
)

세션 예시

User: "I prefer tabs over spaces in all my Python projects"

Claude:
  → recall_memory("tabs spaces Python preferences")   # nothing found
  → store_memory("Sachit prefers tabs over spaces in Python", importance=0.9, category="fact")

Next session:
  → recall_memory("Python formatting")
  ← {"content": "Sachit prefers tabs over spaces in Python", "strength": 0.87}
  → Claude now knows without being told again

감쇠 작업

시작 시 24시간마다 자동으로 실행됩니다 — cron이 필요 없습니다. 강도가 0.05 미만인 메모리는 정리됩니다.

체인 인식 정리 (v1.3.0): 감쇠된 메모리를 삭제하기 전에 감쇠 작업은 그래프 이웃을 확인합니다. 이웃 중 하나라도 정리 임계값 이상이면 메모리가 유지됩니다. 이는 관련 클러스터의 일부인 사실이 격리되어 삭제되는 것을 방지합니다.


스택

  • DuckDB — 기본 백엔드, 설정 불필요, 네이티브 벡터 유사도 (pgvector와 동일한 품질)

  • NetworkX — 기본 그래프 백엔드, 설정 불필요, ~/.yourmemory/graph.pkl에 지속

  • Neo4j — 확장을 위한 선택적 그래프 백엔드: pip install 'yourmemory[neo4j]', GRAPH_BACKEND=neo4j 설정

  • sentence-transformers — 로컬 임베딩 (all-mpnet-base-v2, 768 차원, 외부 서비스 불필요)

  • spaCy 3.8.13+ — 중복 제거, 분류 및 SVO 삼중 추출을 위한 로컬 NLP (Python 3.11–3.14 호환)

  • APScheduler — 자동 24시간 감쇠 작업

  • MCP — Model Context Protocol을 통한 Claude 통합

  • PostgreSQL + pgvector — 선택 사항, 팀/대규모 데이터셋용


아키텍처

Claude / Cline / Cursor / Any MCP client
    │
    ├── recall_memory(query, api_key?)
    │       └── embed → cosine similarity (Round 1)
    │           → graph BFS expansion (Round 2)
    │           → score = sim × strength → top-k
    │           → recall propagation → boost graph neighbours
    │
    ├── store_memory(content, importance, category?, api_key?, visibility?)
    │       └── is_question? → reject
    │           contradiction check → update existing if conflict
    │           embed() → INSERT memories
    │           → index_memory() → upsert graph node + semantic edges
    │
    └── update_memory(id, new_content, importance)
            └── embed(new_content) → UPDATE memories
                → update graph node strength

Vector DB (Round 1)          Graph DB (Round 2)
DuckDB (default)             NetworkX (default)
  memories.duckdb              graph.pkl
  ├── embedding FLOAT[768]     ├── nodes: memory_id, strength
  ├── importance FLOAT         └── edges: sim × verb_weight ≥ 0.4
  ├── recall_count INTEGER
  ├── visibility VARCHAR     Neo4j (opt-in, GRAPH_BACKEND=neo4j)
  └── agent_id VARCHAR         └── bolt://localhost:7687

Agent Registry
  agent_registrations
  ├── agent_id VARCHAR
  ├── api_key_hash VARCHAR   ← SHA-256, plaintext never stored
  ├── can_read  []           ← ["shared"] | ["private"] | both
  ├── can_write []
  └── revoked_at TIMESTAMP

PostgreSQL (선택 사항 — 팀 또는 대규모 데이터셋용)

Postgres 지원과 함께 설치:

pip install yourmemory[postgres]

그런 다음 .env 파일을 생성하세요:

DATABASE_URL=postgresql://YOUR_USER@localhost:5432/yourmemory

백엔드는 자동으로 선택됩니다 — DATABASE_URLpostgresql://이 있으면 Postgres + pgvector, 그 외에는 DuckDB.

macOS

brew install postgresql@16 pgvector && brew services start postgresql@16
createdb yourmemory

Ubuntu / Debian

sudo apt install postgresql postgresql-contrib postgresql-16-pgvector
createdb yourmemory

데이터셋 참조

벤치마크는 Snap Research의 LoCoMo 데이터셋을 사용합니다 — 다중 세션 대화를 위한 공개 장기 컨텍스트 메모리 벤치마크.

Maharana et al. (2024). LoCoMo: Long Context Multimodal Benchmark for Dialogue. Snap Research.


라이선스

Copyright 2026 Sachit Misra

CC-BY-NC-4.0 (Creative Commons Attribution-NonCommercial 4.0)에 따라 라이선스가 부여됩니다.

무료 사용: 개인적 용도, 교육, 학술 연구, 오픈 소스 프로젝트.

허용되지 않음: 별도의 서면 계약 없이는 SaaS, 영리 기업의 내부 도구 또는 유료 서비스를 포함한 모든 종류의 상업적 사용.

상업적 라이선스 문의: mishrasachit1@gmail.com

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sachitrafa/cognitive-ai-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server