OpenSource-Hub

agentmemory

라이브러리

rohitg00/agentmemory

AI 코딩 에이전트를 위한 영구 메모리.

개요

Claude Code, Cursor, Gemini CLI 등 AI 코딩 에이전트에 영구 메모리를 제공합니다. hooks, MCP 또는 REST API 통합을 통해 95%의 재현율을 달성하고 토큰을 92% 절약합니다.

README 미리보기

\n  \n\n\n\n  \n    Your coding agent remembers everything. No more re-explaining.\n    Built on iii engine\n  \n  Persistent memory for Claude Code, Cursor, Gemini CLI, Codex CLI, pi, OpenCode, and any MCP client.\n\n\n\n  \n\n\n\n  The gist extends Karpathy's LLM Wiki pattern with confidence scoring, lifecycle, knowledge graphs, and hybrid search. agentmemory is the implementation.\n\n\n\n  \n  \n  \n  \n\n\n\n  \n  \n  \n  \n  \n  \n\n\n\n  \n\n\n\n  Quick Start •\n  Benchmarks •\n  vs Competitors •\n  Agents •\n  How It Works •\n  MCP •\n  Viewer •\n  iii Console •\n  Powered by iii •\n  Config •\n  API\n\n\n---\n\n\n\nagentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server.\n\n\n\n\n\nClaude Code\n12 hooks + MCP + skills\n\n\n\nOpenClaw\nMCP + plugin\n\n\n\nHermes\nMCP + plugin\n\n\n\nCursor\nMCP server\n\n\n\nGemini CLI\nMCP server\n\n\n\nOpenCode\nMCP server\n\n\n\nCodex CLI\nMCP server\n\n\n\nCline\nMCP server\n\n\n\n\n\nGoose\nMCP server\n\n\n\nKilo Code\nMCP server\n\n\n\nAider\nREST API\n\n\n\nClaude Desktop\nMCP server\n\n\n\nWindsurf\nMCP server\n\n\n\nRoo Code\nMCP server\n\n\n\nClaude SDK\nAgentSDKProvider\n\n\n\nAny agent\nREST API\n\n\n\n\n\n  Works with any agent that speaks MCP or HTTP. One server, memories shared across all of them.\n\n\n---\n\nYou explain the same architecture every session. You re-discover the same bugs. You re-teach the same preferences. Built-in memory (CLAUDE.md, .cursorrules) caps out at 200 lines and goes stale. agentmemory fixes this. It silently captures what your agent does, compresses it into searchable memory, and injects the right context when the next session starts. One command. Works across agents.\n\n**What changes:** Session 1 you set up JWT auth. Session 2 you ask for rate limiting. The agent already knows your auth uses jose middleware in `src/middleware/auth.ts`, your tests cover token validation, and you

FAQ (5)

문제 해결
첫 실행 시 AgentMemory 'Failed to load persisted index: Cannot read properties of undefined (reading v)' 오류를 해결하는 방법

AgentMemory를 v0.9.26 이상으로 업그레이드하세요. 이 버전에서는 누락된 키에 대해 undefined를 반환하는 어댑터의 샤딩된 인덱스 매니페스트 로딩 문제가 수정되었습니다:

npm install -g @agentmemory/agentmemory@0.9.26

그런 다음 AgentMemory를 다시 실행하세요. v0.9.25에서는 이 오류가 첫 실행 시 표면적인 문제에 불과합니다. 시작 직후 디바운스된 저장 프로세스에 의해 인덱스가 자동으로 다시 빌드되므로, 즉시 업그레이드할 수 없는 경우 안전하게 무시해도 됩니다.

원본 Issue #797
문제 해결
iii-engine v0.16.1이 설치되어 있는데 v0.11.2가 hard-pinned되어 있어 agentmemory가 부팅을 거부하는 문제는 어떻게 해결하나요?

agentmemory v0.9.24를 전역으로 새로 설치한 경우, 런타임 버전 확인을 재정의하여 이미 설치된 일관된 v0.16.1 엔진 및 워커 세트를 사용하세요:

AGENTMEMORY_III_VERSION=0.16.1 agentmemory

npx의 경우 다음을 실행합니다:

AGENTMEMORY_III_VERSION=0.16.1 npx @agentmemory/agentmemory@latest

현재 셸에서 이를 계속 적용하려면:

export AGENTMEMORY_III_VERSION=0.16.1
agentmemory

Ubuntu 24.04 aarch64에서는 이 방법으로 iii-engine v0.16.1이 정상적으로 부팅되고 정상 상태의 워커/REST 서비스가 보고됩니다. 권장되는 v0.11.2 다운그레이드 tarball을 무조건 따르지는 마세요. 해당 iii-aarch64-unknown-linux-gnu.tar.gz에는 iii 바이너리만 포함되어 있어 v0.11.2 iii가 v0.16.1 iii-worker와 짝을 이루게 되어 또 다른 버전 불일치가 발생합니다. 근본적인 해결책은 설치 프로그램이 고정된(pinned) 엔진 버전을 가져오도록 하거나 agentmemory가 자체 고정 버전을 v0.16.1으로 업데이트하는 것입니다.

원본 Issue #752
문제 해결
~/.agentmemory/.env에 설정된 AGENTMEMORY_TOOLS=core가 무시되는 이유는 무엇이며, 어떻게 해결할 수 있나요?

@agentmemory/agentmemory@0.9.27에서 src/mcp/tools-registry.ts의 getVisibleTools()는 병합된 환경 변수(loadEnvFile() + process.env) 대신 process.env.AGENTMEMORY_TOOLS를 직접 읽으므로, ~/.agentmemory/.env에만 설정된 값은 아무런 경고 없이 무시되고 8개의 핵심 도구 대신 53개의 모든 도구가 노출됩니다. 패치가 적용되기 전까지의 임시 해결 방법: (1) CLI 플래그 agentmemory --tools core로 실행하거나, (2) 실행 셸에서 변수를 export하세요(예: AGENTMEMORY_TOOLS=core agentmemory). 또는 pm2 ecosystem 파일의 env 블록에 설정한 후 pm2 restart agentmemory를 실행하세요. (Invoke-RestMethod 'http://127.0.0.1:3111/agentmemory/mcp/tools').tools.Count로 확인하세요 — 8이 반환되어야 합니다. 영구적인 수정 방법은 getVisibleTools() 및 src/mcp/standalone.ts에서 process.env["AGENTMEMORY_TOOLS"]를 getEnvVar("AGENTMEMORY_TOOLS")로 변경하는 것입니다.

원본 Issue #1060
문제 해결
agent-sdk 프로바이더를 사용해 대규모 AgentMemory 세션을 요약할 때 발생하는 'too_many_chunks_skipped: chunks failed to parse after retry' 오류를 어떻게 해결하나요?

이 문제는 AGENTMEMORY_ALLOW_AGENT_SDK=true일 때 @agentmemory/agentmemory 0.9.22부터 0.9.24까지에 영향을 미칩니다. agent-sdk 재귀 가드가 전역 process.env.AGENTMEMORY_SDK_CHILD를 설정하므로, 동시에 실행되는 summarize 청크들이 이 플래그를 보고 빈 응답을 반환하며, 이는 파싱 실패로 집계됩니다. 해결 방법으로, ~/.agentmemory/.env에 SUMMARIZE_CHUNK_CONCURRENCY=1을 추가하여 청크 요약이 직렬로 실행되도록 강제한 다음 워커를 재시작하세요:

echo 'SUMMARIZE_CHUNK_CONCURRENCY=1' >> ~/.agentmemory/.env

임시로 셸에서 실행하려면:

SUMMARIZE_CHUNK_CONCURRENCY=1 AGENTMEMORY_ALLOW_AGENT_SDK=true node your-worker.js

그런 다음 요약을 다시 시도하세요. 영구적인 코드 수정은 프로세스 전역 env 재귀 가드를 AsyncLocalStorage 또는 호출별 플래그와 같은 인프로세스 메커니즘으로 대체하고, env 가드는 실제 자식 프로세스 경계에서만 유지하는 것입니다.

원본 Issue #781
문제 해결
왜 제 agentmemory coding-agent-life-v1 재현 결과에서 P@5가 공개된 벤치마크 점수 대신 0.240밖에 나오지 않나요?

재현하신 수치는 정확하며, 공개된 스코어카드가 잘못되었습니다. eval/runner/score.ts에서 Precision@5는 쿼리별로 다음과 같이 계산됩니다:

const topK = ranked.slice(0, k).map((r) => r.sessionId);
const gold = new Set(q.goldSessionIds);
const hits = topK.filter((id) => gold.has(id)).length;
const precisionAtK = k > 0 ? hits / k : 0;
const recallAtK = gold.size === 0 ? 0 : hits / gold.size;

어댑터 점수는 15개 질문 전체에 대한 산술 평균입니다.

coding-agent-life-v1 데이터셋에는 골드 세션이 하나인 질문 12개와 골드 세션이 두 개인 질문 3개가 포함되어 있습니다. 따라서 가능한 최대 P@5는 다음과 같습니다:

(12 × (1/5) + 3 × (2/5)) / 15 = 18/75 = 0.240

따라서:
- agentmemory-hybrid P@5=0.240, R@5=1.000은 모든 골드 세션이 상위 5개 안에 검색되었음을 의미합니다.
- grep P@5=0.227, R@5=0.967은 가능한 최대 18개의 top-5 히트 중 17개의 성공적인 히트에 해당합니다. 골드가 두 개인 질문 하나에서 관련 세션이 하나만 반환되었습니다. 매크로 평균 리콜은 (14 + 0.5) / 15 = 0.9667입니다.

해결 방법: 현재 공식을 사용하여 벤치마크 보고서를 다시 계산하거나 재생성하고, 잘못 게시된 P@5 값을 교체하세요. 이 메트릭 정의 하에서는 이 데이터셋에서 0.240을 초과하는 점수는 불가능합니다.

원본 Issue #796