agentmem
agentmem
Claude Code, Cursor 및 Codex를 위한 공유 메모리로, 무엇이 여전히 유효한지 파악합니다. 세션을 저장하고, 노후화되거나 충돌하는 규칙을 포착하며, 에이전트가 과거의 실수를 반복하지 않도록 방지합니다.
문제점
AI 코딩 어시스턴트는 세션 간의 모든 것을 잊어버립니다. 과거의 실수를 반복합니다. 현재 규칙과 오래된 규칙을 구분하지 못합니다. 컨텍스트는 압축되고 복구는 고통스럽습니다.
대부분의 메모리 도구는 저장 문제를 해결합니다. agentmem은 신뢰 문제를 해결합니다.
시작하기 (Claude Code / Cursor / Codex)
pip install quilmem[mcp]
agentmem init --tool claude --project myapp이것으로 끝입니다. 에디터를 재시작하세요. 이제 에이전트가 13개의 메모리 도구를 갖게 됩니다. memory_health를 실행하여 확인하세요.
Python 전용인가요?
pip install quilmem은 MCP 추가 기능 없이도 작동합니다. 아래의 Python API를 참조하세요.
60초 데모
from agentmem import Memory
mem = Memory()
# Store typed memories
mem.add(type="bug", title="loudnorm undoes SFX levels",
content="Never apply loudnorm to final mix. It re-normalizes everything.",
status="validated")
mem.add(type="decision", title="Use per-line atempo",
content="Bake speed into per-line TTS. No global pass.",
status="active")
# Something you're not sure about yet
hypothesis = mem.add(type="decision", title="Maybe try 2-second gaps before CTA",
content="Hypothesis from last session. Needs testing.",
status="hypothesis")
# Search — validated and active memories rank highest.
# Deprecated and superseded memories are excluded automatically.
results = mem.search("audio mixing")
# Context-budgeted recall — fits the best memories into your token limit
context = mem.recall("building a narration track", max_tokens=2000)
# Lifecycle — promote what's proven, deprecate what's not
mem.promote(hypothesis.id) # hypothesis -> active -> validated
mem.deprecate(hypothesis.id, reason="Disproven by data")
# Supersede: replace an outdated memory with a newer one
replacement = mem.add(type="decision", title="Use 1-second gaps before CTA",
content="Confirmed by A/B test.", status="active")
mem.supersede(hypothesis.id, replacement.id) # old points to replacement
# Health check — is your memory system trustworthy?
from agentmem import health_check
report = health_check(mem._conn)
# Health: 85/100 | Conflicts: 0 | Stale: 2 | Validated: 14차별점
다른 메모리 도구는 단순히 저장만 합니다. agentmem은 무엇이 여전히 유효한지 알고 있습니다.
Mem0 | Letta | Mengram | agentmem | |
메모리 저장 | 예 | 예 | 예 | 예 |
전문 검색 | 벡터 | 에이전트 주도 | 지식 그래프 | FTS5 |
메모리 수명 주기 상태 | 아니요 | 부분적 | 아니요 | 가설 -> 활성 -> 검증됨 -> 폐기됨 -> 대체됨 |
충돌 감지 | 아니요 | 아니요 | 부분적 | 내장 |
노후화 감지 | 아니요 | 아니요 | 아니요 | 내장 |
상태 점수 | 아니요 | 아니요 | 아니요 | 내장 |
출처 추적 | 아니요 | 아니요 | 아니요 | source_path + source_hash |
신뢰도 기반 호출 | 아니요 | 아니요 | 아니요 | 검증됨 > 활성 > 가설 |
사람이 읽을 수 있는 소스 파일 | 아니요 | 아니요 | 아니요 | 표준 마크다운 |
로컬 우선, 인프라 제로 | 아니요 | 자체 호스팅 옵션 | 자체 호스팅 옵션 | 예, 항상 |
MCP 서버 | 별도 | 별도 | 예 | 내장 |
진실 거버넌스
핵심 아이디어: 모든 메모리에는 신뢰 수준을 추적하는 상태가 있습니다.
hypothesis New observation. Not yet confirmed. Lowest trust in recall.
|
active Default. Currently believed true. Normal trust.
|
validated Explicitly confirmed. Highest trust in recall.
deprecated Was true, no longer. Excluded from recall. Kept for history.
superseded Replaced by a newer memory. Points to replacement.이것이 중요한 이유: 거버넌스가 없으면 에이전트의 메모리에는 노후화된 규칙, 모순, 오래된 결정이 쌓입니다. 1월의 음성 설정이 3월에 재정의되었다는 사실을 알지 못합니다. 두 가지를 모두 검색하고 LLM은 무작위로 선택합니다. 관리형 메모리는 이 문제를 해결합니다.
충돌 감지
from agentmem import detect_conflicts
conflicts = detect_conflicts(mem._conn)
# Found 2 conflict(s):
# !! [decision] "Always apply loudnorm to voice"
# vs [decision] "NEVER apply loudnorm to voice"
# Contradiction on shared topic (voice, loudnorm, audio)agentmem은 서로 모순되는 메모리를 찾아냅니다:
주제 중복 감지 (Jaccard 유사도)
중복과 모순을 분리
문장 수준의 부정 매칭 (단순 키워드 스캔이 아님)
심각도:
critical(둘 다 활성) vswarning(하나가 폐기됨)
노후화 감지
from agentmem import detect_stale
stale = detect_stale(mem._conn, stale_days=30)
# [decision] "Use atempo 0.90" — Source changed since import (hash mismatch)
# [bug] "Firewall blocks port" — Not updated in 45 days다음과 같은 방식으로 오래된 메모리를 찾습니다:
기간 (N일 동안 업데이트되지 않음)
소스 파일 누락 (참조된 파일이 삭제됨)
해시 드리프트 (소스 파일 내용은 변경되었으나 메모리가 업데이트되지 않음)
상태 확인
from agentmem import health_check
report = health_check(mem._conn)
print(f"Health: {report.health_score}/100")
print(f"Conflicts: {len(report.conflicts)}")
print(f"Stale: {len(report.stale)}")충돌, 노후화 비율, 고아 참조, 폐기된 가중치, 검증된 메모리 보유 여부를 기반으로 메모리 시스템의 점수를 0-100으로 매깁니다.
출처 인식 동기화
표준 마크다운 파일을 소스 추적과 함께 DB로 동기화합니다:
# Each memory tracks where it came from
mem.add(type="bug", title="loudnorm lifts noise",
content="...",
source_path="/docs/errors.md",
source_section="Audio Bugs",
source_hash="a1b2c3d4e5f6")동기화 엔진:
동일한 해시 = 건너뛰기 (멱등성, 재실행해도 변경 없음)
다른 해시 = 업데이트 (소스 파일 변경됨)
섹션 제거 = 폐기 (사유 포함)
섹션 복원 = 부활 (폐기된 메모리 재활성화)
세 가지 인터페이스
Python API
from agentmem import Memory
mem = Memory("./my-agent.db", project="frontend")
# CRUD
record = mem.add(type="decision", title="Use TypeScript", content="...")
mem.get(record.id)
mem.update(record.id, content="Updated reasoning.")
mem.delete(record.id)
mem.list(type="bug", limit=20)
# Search + recall
results = mem.search("typescript migration", type="decision")
context = mem.recall("setting up the build", max_tokens=3000)
# Governance
mem.promote(record.id) # hypothesis -> active -> validated
mem.deprecate(record.id, reason="No longer relevant")
replacement = mem.add(type="decision", title="Use v2 approach", content="...")
mem.supersede(record.id, replacement.id) # links old to replacement
# Session persistence
mem.save_session("Working on auth refactor. Blocked on token refresh.")
mem.load_session() # picks up where last instance left off
# Health
mem.stats()CLI
# Get started in 30 seconds
agentmem init --tool claude --project myapp
# Check if everything's working
agentmem doctor
# Core
agentmem add --type bug --title "CSS grid issue" "Flexbox fallback needed"
agentmem search "grid layout"
agentmem recall "frontend styling" --tokens 2000
# Governance
agentmem promote <id>
agentmem deprecate <id> --reason "Fixed in v2.3"
agentmem health
agentmem conflicts
agentmem stale --days 14
# Import + sessions
agentmem import ./errors.md --type bug
agentmem save-session "Finished auth module, starting tests"
agentmem load-session
# MCP server
agentmem serveMCP 서버
Claude Code, Cursor 및 모든 MCP 클라이언트를 위한 내장 Model Context Protocol 서버입니다.
pip install quilmem[mcp]Claude Code 설정 (.claude/settings.json):
{
"mcpServers": {
"agentmem": {
"command": "agentmem",
"args": ["--db", "./memory.db", "--project", "myproject", "serve"],
"type": "stdio"
}
}
}MCP 도구: add_memory, search_memory, recall_memory, update_memory, delete_memory, list_memories, save_session, load_session, promote_memory, deprecate_memory, supersede_memory, memory_health, memory_conflicts
에이전트에게 메모리 사용법 알리기: 에이전트 지침을 CLAUDE.md, .cursorrules 또는 AGENTS.md에 복사하세요. 이는 에이전트에게 세션 프로토콜, 신뢰 계층 구조, 검색 시점과 추가 시점을 가르칩니다.
타입 지정 메모리
실제 에이전트 워크플로우를 다루는 7가지 유형:
유형 | 저장 내용 | 예시 |
| 구성, 매개변수 | "음성 속도: atempo 1.08" |
| 오류 및 수정 사항 | "loudnorm이 노이즈 플로어를 높임" |
| 규칙, 정책, 선택 | "3인칭 서술 금지" |
| 워크플로우, 파이프라인 | "TTS -> 속도 -> 48kHz -> 믹스" |
| 배경 지식 | "프로젝트는 FFmpeg + Python 3.11 사용" |
| 사용자 수정 사항 | "항상 선택하고 묻지 마" |
| 현재 작업 상태 | "인증 작업 중. 토큰 문제로 차단됨." |
신뢰도 기반 호출
recall()은 단순히 관련 메모리를 찾는 것이 아닙니다. 가장 신뢰할 수 있는 관련 메모리를 찾습니다:
FTS5 검색이 후보를 반환
각 항목 점수 산정:
관련성 (25%) + 신뢰 상태 (20%) + 출처 (20%) + 최신성 (15%) + 빈도 (10%) + 신뢰도 (10%)검증된 표준 메모리가 출처가 없는 가설 메모리보다 우선순위가 높음
폐기되거나 대체된 메모리는 완전히 제외됨
토큰 예산에 맞춰 탐욕적으로 채움
프로젝트 범위 지정
frontend = Memory("./shared.db", project="frontend")
backend = Memory("./shared.db", project="backend")
frontend.search("bug") # Only frontend bugs
backend.search("bug") # Only backend bugs실전 검증
이것은 이론이 아닙니다. agentmem은 2개월 이상의 일상적인 사용을 통해 프로덕션 환경에서 구축되었습니다:
65개 이상의 YouTube Shorts 제작, 반복되는 프로덕션 버그 제로
음성 생성, FFmpeg 조립, 이미지 프롬프트, 업로드 워크플로우를 관리하는 330개 이상의 메모리
모든 버그는 한 번 포착되고, 한 번 수정되며, 다시 반복되지 않음
거버넌스 엔진을 통해 1,848개의 오탐지를 11개의 실제 발견 사항으로 줄임
작동 원리
저장: WAL 모드의 SQLite (동시 읽기, 스레드 안전)
검색: Porter 스테밍 및 unicode61 토크나이저를 사용하는 FTS5
순위 지정: 복합 점수: 텍스트 관련성 + 신뢰 상태 + 출처 + 최신성 + 빈도 + 신뢰도
거버넌스: 상태 수명 주기, 충돌 감지, 노후화 감지, 상태 점수
동기화: 소스 해싱 및 부활 기능을 갖춘 출처 인식
인프라 제로: API 키, 클라우드, 벡터 DB 없음. 오직
.db파일뿐.
라이선스
MIT
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/Thezenmonster/agentmem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server