Show HN: Rekal – 단일 SQLite 파일의 LLM용 장기 메모리

hackernews | | 📦 오픈소스
#ai #ai 모델 #claude #llm #mcp #sqlite #장기 기억
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

대화 세션이 바뀔 때마다 기존 문맥을 잃어버리는 대형 언어 모델(LLM)의 한계를 극복하기 위해 단일 SQLite 파일 기반으로 장기 기억을 제공하는 'rekal'이라는 새로운 MCP 서버가 공개되었습니다. 이 시스템은 BM25 키워드 일치(40%), 벡터 의미 유사도(40%), 시간 경과에 따른 최신성(20%) 가중치를 결합한 하이브리드 검색 방식을 사용하여 사용자의 선호도나 과거 작업 등을 정확하게 기억해 냅니다. 클라우드나 API 키 없이 오로지 하나의 로컬 데이터베이스 파일로만 작동하여 보안을 유지하며, 대화 내용 자동 저장, 충돌하는 기록 관리 및 16가지 세부 메모리 도구를 통해 체계적으로 문맥을 유지할 수 있습니다.

본문

Long-term memory for LLMs. An MCP server backed by a single SQLite file. pip install rekal LLMs forget everything between sessions. You tell it you prefer Ruff, that you deploy with tags, that the auth service lives in services/auth . Next conversation, blank slate. rekal fixes this. It stores memories in SQLite with hybrid search (keywords + vectors + recency) so your LLM can recall things you've told it before. One file, no cloud, no API keys. Add rekal to your MCP client config (Claude Desktop, Cursor, Claude Code, etc.): { "mcpServers": { "rekal": { "command": "rekal" } } } On first run, rekal creates ~/.rekal/memory.db . That single file holds everything. Copy it to back up, drop it to start fresh. Requires Python 3.14+. Your LLM stores things worth remembering: User: "I prefer Ruff over Black for formatting" LLM: → memory_store("User prefers Ruff over Black", type="preference") Weeks later, different conversation: User: "Set up linting for my new project" LLM: → memory_search("formatting linting preferences") ← "User prefers Ruff over Black" (score: 0.92) When facts change, old versions stay linked: LLM: → memory_supersede(old_id="mem_abc", new_content="API moved from v2 to v3") When things contradict each other: LLM: → memory_conflicts(project="backend") ← "use PostgreSQL for everything" contradicts "migrate analytics to ClickHouse" Three signals, blended into one score: score = 0.4 · BM25(keyword match) + 0.4 · cosine(semantic similarity) + 0.2 · exp(-t/half_life) "deploy auth" and "shipping the login system to pre-prod" both find the same memory. Recent stuff ranks higher, but old memories still show up when relevant. Embeddings run locally via fastembed. Nothing leaves your machine. If you use Claude Code, rekal ships as a plugin with two skills: | Skill | Trigger | What it does | |---|---|---| rekal-save | Auto on session end, or /rekal-save | Reviews the conversation, deduplicates against existing memories, stores what's worth keeping | rekal-hygiene | /rekal-hygiene | Finds conflicts, duplicates, and stale data. Proposes fixes for your approval, never deletes on its own | Install in Claude Code: /plugin marketplace add janbjorge/rekal /plugin install rekal-skills@rekal Requires rekal to be running as an MCP server (see Quick start). 16 tools over MCP: | Tool | Description | |---|---| memory_store | Store a memory with type, project, tags, and conversation scope | memory_search | Hybrid search: BM25 + vector + recency in one query | memory_update | Update content, tags, or type (re-embeds automatically) | memory_delete | Delete a memory by ID | | Tool | Description | |---|---| memory_supersede | Replace a memory while keeping the old one as history | memory_link | Link memories: supersedes , contradicts , related_to | memory_build_context | Relevant memories + conflicts + timeline for a query, in one call | | Tool | Description | |---|---| memory_similar | Find memories similar to a given one | memory_topics | Topic summary grouped by type | memory_timeline | Chronological view with optional date range filters | memory_related | All links to and from a memory | memory_health | Database stats: counts by type, project, date range | memory_conflicts | Find memories that contradict each other | | Tool | Description | |---|---| conversation_start | Start a conversation, optionally linked to a previous one | conversation_tree | Get the full conversation DAG | conversation_threads | List recent conversations with memory counts | conversation_stale | Find inactive conversations | | Type | For | Example | |---|---|---| fact | Things that are true | "The API rate limit is 1000 req/min" | preference | How you like things | "Prefers dataclasses over hand-written __init__" | procedure | Steps to do something | "Deploy: git tag vX.Y.Z && git push --tags" | context | Current state | "Currently rewriting the payment service" | episode | Things that happened | "Debugged the OOM, root cause was unbounded cache" | One SQLite file, four components: rekal │ SQLite ──┬── FTS5 index ──── keyword relevance (BM25) ├── sqlite-vec ──── semantic similarity (384d vectors) ├── recency ─────── exponential decay (30-day half-life) └── memory links ── supersedes / contradicts / related_to Conversations form a DAG (follow-ups, branches, merges), navigable like a git log. rekal serve # Run as MCP server (default) rekal health # Database health report rekal export # Export all memories as JSON MIT

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →