메뉴
HN
Hacker News • 43일 전

AI 에이전트 맞춤형 초고속 메모리 서버 'MCP-Memory'

IMP
7/10
핵심 요약

해커뉴스에 구글의 OKF(Open Knowledge Format) 표준과 SQLite FTS5를 활용한 'MCP-Memory'가 공개되었습니다. 이 도구는 Claude, Cursor 등 AI 코딩 에이전트에 세션 간 유지되는 장기 기억 능력을 부여하여 작업의 연속성을 돕습니다. 개발자가 직관적으로 읽을 수 있는 마크다운 형식과 20ms 미만의 빠른 검색 속도를 결합한 것이 핵심 특징입니다.

번역된 본문

MCP-Memory: OKF 기반 에이전트 메모리 서버

MCP-Memory는 AI 에이전트(Claude Desktop, Cursor, Antigravity, Windsurf, Codex 등)에 영구적이고 장기적인 기억(Memory) 능력을 부여하는 MCP(Model Context Protocol) 서버입니다. 메모리 기록은 구글의 OKF(Open Knowledge Format) v0.2 표준을 사용해 포맷팅되며, 빠른 키-값 조회, 태그 필터링 및 콘텐츠 검색을 위해 로컬 SQLite 인스턴스(FTS5 전문 검색 지원)로 인덱싱됩니다.

핵심 기능 세션 간 상태 유지: AI 에이전트가 채팅 턴과 세션에 걸쳐 지속되는 상태 저장 메모리 조각을 읽고, 저장하고, 검색하고, 삭제할 수 있게 합니다. OKF 표준 준수: 모든 메모리 항목을 YAML 프론트매터(type, key, namespace, tags, generated, sources, verified, status, stale_after)가 포함된 OKF v0.2 마크다운 문서 형식으로 저장하며, 엄격하게 SPEC.md 및 OKF_RULES.md를 따릅니다. 이중 계층 아키텍처:

  1. 사람이 볼 수 있는 OKF 디렉토리: 모든 메모리를 memory/ 번들 디렉토리 내의 순수 .md 파일로 자동 덤프 및 동기화합니다. 계층적 index.md 점진적 공개 파일(okf_version: "0.2"가 포함된 루트 index.md)과 log.md 업데이트 기록 추적을 지원합니다.
  2. 고성능 SQLite 인덱싱: SQLite FTS5(전문 검색)와 자동 트리거를 사용하여 20ms 미만의 키 조회 및 즉각적인 키워드 검색을 구현합니다. 네임스페이스 격리: 컨텍스트 분할을 지원합니다 (예: user/preferences, project/architecture, default). 제로 보일러플레이트 설정: 빠른 설정 마법사(python3 setup.py)가 설치된 MCP 도구(Antigravity, Claude, Cursor, Windsurf, Codex)를 자동으로 구성합니다.

MCP 도구 이 서버는 상호 작용하는 에이전트에 4가지 주요 MCP 도구를 노출합니다:

  1. memory_store OKF v0.2 형식으로 메모리 기록을 저장하거나 업데이트합니다. 매개변수: key (문자열, 필수): 메모리의 고유 식별자 또는 경로 (예: user/preferences/coding_style 또는 project/architecture). content (문자열 또는 객체, 필수): 저장할 핵심 정보. project_root (문자열, 필수): 활성 프로젝트 루트 디렉토리의 절대 경로 (예: /Users/user/Projects/my-app). tags (문자열 배열, 선택): 필터링을 위한 분류 태그. namespace (문자열, 선택, 기본값: "default"): 범위/네임스페이스. concept_type (문자열, 선택, 기본값: "Agent Memory"): OKF 개념 유형 (예: Metric, Playbook, Attested Computation). title (문자열, 선택): 표시 이름. description (문자열, 선택): 한 줄 요약. resource (문자열, 선택): 기본 에셋의 정규화된 URI. status (문자열, 선택, 기본값: "stable"): 수명 주기 상태 (draft | stable | deprecated). stale_after (문자열, 선택): ISO 날짜 (YYYY-MM-DD). sources (객체 배열, 선택): 출처 [{resource, id, title, author, usage_count, last_modified}]. verified (객체 배열 또는 객체, 선택): 검증 이벤트 [{by, at}]. generated_by (문자열, 선택): 액터 규칙을 따르는 액터 식별자 (/, human:, process:).

  2. memory_retrieve 키와 네임스페이스를 통해 특정 메모리를 검색합니다. 매개변수: key (문자열, 필수): 조회할 메모리 키. project_root (문자열, 필수): 활성 프로젝트 루트 디렉토리의 절대 경로. namespace (문자열, 선택, 기본값: "default"): 범위/네임스페이스.

  3. memory_search 키워드, 태그 또는 네임스페이스 필터와 일치하는 메모리를 찾습니다. 매개변수: project_root (문자열, 필수): 활성 프로젝트 루트 디렉토리의 절대 경로. query (문자열, 선택): 키, 프론트매터 및 콘텐츠 전체에 걸친 키워드 검색 쿼리. tags (문자열 배열, 선택): 특정 태그로 필터링. namespace (문자열, 선택): 네임스페이스 내로 검색 범위 제한. limit (정수, 선택, 기본값: 10): 최대 결과 수.

  4. memory_get_last 에이전트 지시문 (세션 시작): AI 에이전트가 프로젝트를 열거나 세션을 시작할 때 이전 작업의 진행 상황을 즉시 파악할 수 있도록 마지막으로 기록된 세션 체크포인트(system/last_memory)를 검색합니다. 매개변수: proj(ect_root)

원문 보기
원문 보기 (영어)
MCP-Memory: OKF-Backed Agent Memory Server MCP-Memory is a Model Context Protocol (MCP) server that equips AI agents (such as Claude Desktop, Cursor, Antigravity, Windsurf, or Codex) with persistent, long-term memory capabilities. Memory records are formatted using the Open Knowledge Format (OKF v0.2) standard and indexed with a local SQLite instance (supporting FTS5 full-text search) for fast key-value lookups, tag filtering, and content search. Fast Track: Jump directly to Quick Start Key Features Persistent State Across Sessions: Enables AI agents to read, store, search, and delete stateful memory snippets that persist across chat turns and sessions. OKF Standard Compliance: Stores every memory item formatted as an OKF v0.2 Markdown document with YAML frontmatter ( type , key , namespace , tags , generated , sources , verified , status , stale_after ), adhering strictly to SPEC.md and OKF_RULES.md . Dual-Layer Architecture: Human-Browseable OKF Directory : Automatically dumps and syncs every memory to disk as a raw .md file inside the memory/ bundle directory with hierarchical index.md progressive disclosure files (root index.md versioned with okf_version: "0.2" ) and log.md update history tracking. High-Performance SQLite Indexing : SQLite FTS5 (Full-Text Search) and automatic triggers for sub-20ms key lookups and instant keyword searches. Namespace Isolation: Supports contextual separation (e.g. user/preferences , project/architecture , default ). Zero Boilerplate Setup: Quick setup wizard ( python3 setup.py ) auto-configures installed MCP tools (Antigravity, Claude, Cursor, Windsurf, Codex). MCP Tools The server exposes four primary MCP tools to interacting agents: 1. memory_store Stores or updates a memory record in OKF v0.2 format. Parameters: key (string, required) : Unique identifier or path for the memory (e.g. user/preferences/coding_style or project/architecture ). content (string or object, required) : Core information to store. project_root (string, required) : Absolute path to the active project root directory (e.g. /Users/user/Projects/my-app ). tags (array of strings, optional) : Classification tags for filtering. namespace (string, optional, default: "default" ) : Scope/namespace. concept_type (string, optional, default: "Agent Memory" ) : OKF concept type (e.g. Metric , Playbook , Attested Computation ). title (string, optional) : Display name. description (string, optional) : One-line summary. resource (string, optional) : Canonical URI of underlying asset. status (string, optional, default: "stable" ) : Lifecycle state ( draft | stable | deprecated ). stale_after (string, optional) : ISO date ( YYYY-MM-DD ). sources (array of objects, optional) : Provenance sources [{resource, id, title, author, usage_count, last_modified}] . verified (array of objects or object, optional) : Verification events [{by, at}] . generated_by (string, optional) : Actor identifier following actor convention ( <producer>/<version> , human:<id> , process:<id> ). 2. memory_retrieve Retrieves a specific memory by its key and namespace. Parameters: key (string, required) : The memory key to look up. project_root (string, required) : Absolute path to the active project root directory. namespace (string, optional, default: "default" ) : Scope/namespace. 3. memory_search Finds memories matching keywords, tags, or namespace filters. Parameters: project_root (string, required) : Absolute path to the active project root directory. query (string, optional) : Keyword search query across keys, frontmatter, and content. tags (array of strings, optional) : Filter by specific tags. namespace (string, optional) : Scope search to a namespace. limit (integer, optional, default: 10) : Maximum number of results. 5. memory_get_last AGENT DIRECTIVE (Session Start): Retrieves the last recorded session checkpoint ( system/last_memory ) so the AI agent immediately knows where work was left off when opening a project or starting a session. Parameters: project_root (string, required) : Absolute path to active project root directory. namespace (string, optional, default: "default" ) : Scope/namespace. 6. memory_update_last AGENT DIRECTIVE (Milestones & Progress): Updates the canonical session checkpoint ( system/last_memory ) whenever completing a milestone, making key changes, or pausing work. Parameters: content (string or object, required) : Brief note or structured dictionary summarizing progress and referencing key memory files. project_root (string, required) : Absolute path to active project root directory. namespace (string, optional, default: "default" ) : Scope/namespace. summary (string, optional) : One-sentence description of the milestone achieved. OKF (Open Knowledge Format) Structure Every stored memory strictly adheres to the OKF v0.2 specification ( SPEC.md & OKF_RULES.md ): --- type : Agent Memory title : Coding Style key : user/preferences/coding_style namespace : default tags : - preferences - style status : stable generated : by : mcp-memory/0.2.0 at : ' 2026-08-12T19:23:35Z ' created_at : ' 2026-08-12T19:23:35Z ' updated_at : ' 2026-08-12T19:23:35Z ' --- User prefers functional programming style with explicit type annotations. Quick Start 1. Clone the Repository git clone https://github.com/fellowgeek/mcp-memory cd mcp-memory 2. Interactive Setup Wizard Run setup.py to auto-detect and register mcp-memory with your AI tools: python3 setup.py Note: Once setup.py finishes configuring your tools, your AI client will launch mcp-memory automatically in the background whenever needed. You do not need to manually start or keep a server process running in your terminal. 3. Run Manually via CLI (Optional / Debugging) If you want to manually verify startup, inspect stdio output, or pre-initialize the virtual environment ( .venv ), you can run run.sh directly: ./run.sh Manual Client Configuration If you prefer to configure your MCP client manually, add the "memory" server entry pointing to run.sh : JSON Configuration (Antigravity, Claude Desktop, Cursor, Windsurf) Add to your client's mcp_config.json or claude_desktop_config.json : { "mcpServers" : { "memory" : { "command" : " /ABSOLUTE/PATH/TO/run.sh " } } } TOML Configuration (Codex Desktop) Add to ~/.codex/config.toml : [ mcp_servers . memory ] command = " /ABSOLUTE/PATH/TO/run.sh " CLI Configuration Claude Code CLI: claude mcp add --scope user memory -- /ABSOLUTE/PATH/TO/run.sh Codex CLI: codex mcp add memory -- /ABSOLUTE/PATH/TO/run.sh Testing Run the automated test suite to verify OKF serialization, SQLite database operations, and FastMCP tool execution: python3 test_memory.py Storage & Environment Variables By default, mcp-memory creates project-isolated memory stores inside each project's root directory: OKF Markdown Files (Human-readable) : memory/ folder in project root. SQLite Database (Hidden index) : .mcp_memory/memories.db in project root. You can customize this behavior using environment variables: MCP_MEMORY_PROJECT_ROOT : Project root directory (default: process current working directory cwd ). MCP_MEMORY_DB_PATH : SQLite database file path (default: .mcp_memory/memories.db relative to project root). MCP_MEMORY_DIR : Directory for Open Knowledge Format (OKF) .md files (default: memory relative to project root). Tip: If you prefer a single global memory store shared across all projects, set MCP_MEMORY_DB_PATH=~/.mcp_memory/memories.db and MCP_MEMORY_DIR=~/.mcp_memory/memory in your client's MCP configuration.