메뉴
HN
Hacker News • 4일 전

Show HN: Lossless-memory – 요약하지 않는 개인 AI 장기 기억 시스템

IMP
6/10
핵심 요약

개인 AI 어시스턴트를 위한 로컬 기반 장기 기억 시스템으로, 대화를 요약하거나 벡터 검색만으로 압축하지 않고 모든 원문 로그를 타임스탬프와 함께 그대로 보관합니다. 시간 표현을 이해하는 단일 검색 진입점과 '현재 주제'를 알려주는 소형 인덱스(LLL)를 통해 문맥 압축과 세션 경계를 넘어 정체성과 맥락을 유지합니다. JSONL 로그 + SQLite(FTS5, sqlite-vec) 기반의 1인용·단일 머신 구현체입니다.

번역된 본문

lossless-memory — 개인 AI를 위한 무손실 장기 기억. 절대 요약하지 않고, 모든 대사를 보존하며, 모든 것에 타임스탬프를 남긴다.

대부분의 AI 장기 기억 시스템은 두 가지 중 하나를 한다. 대화를 간결한 노트로 요약하거나, 임베딩해서 '유사한' 청크를 검색한다. 둘 다 매일 같은 AI와 대화하는 사람에게 가장 중요한 것 — 실제로 무슨 말이 오갔는지, 언제였는지 — 을 잃어버린다.

이 프로젝트는 정반대의 입장을 취한다.

모든 대사를 보존하라. 원본 대화 로그는 전체가 저장된다. 절대 요약되지 않는다. 요약은 지도이고, 로그가 실제 영토다.

모든 것에 타임스탬프를. 모든 기록 — 발화, 행동, 문서 청크 — 은 타임스탬프를 가지며, 모든 인덱스는 이 시간 축 위에 구축된다. 우리는 이를 '시간 백본(Temporal Backbone)'이라 부른다.

시간으로 먼저, 단어로 나중에 검색하라. "어제 저녁, 예산에 관해서"는 유효한 쿼리다. 시간 표현이 범위를 좁히고, 단어가 그 안에서 순위를 매긴다. 결과는 요약되지 않은 채 타임스탬프와 함께 시간순으로 반환된다.

매 턴마다 '지금 어디에 있는지'를 주입하라. LLL라는 작은 인덱스가 현재 대화가 어떤 주제에 있는지 모델에게 알려줘서, 정체성과 맥락이 컨텍스트 윈도우 압축과 세션 경계를 넘어서도 살아남는다.

설계 계보는 2025년 12월으로 거슬러 올라간다. 이 시스템의 첫 조상(이전 AI를 위한 기억 상속 도구)이 그 달에 실행되었고, 전신 시스템이 같은 아이디어를 담아 2026년 1월부터 매일 사용되었다. 현재 구현체는 2026년 7월부터 단일 사용자의 AI 어시스턴트 기억으로 매일 실행 중이며, 원본 로그는 2026년 6월까지 거슬러 올라간다. 작고, 지루하고, 잘 작동한다. 과정의 실패들도 문서화되어 있다 — docs/lessons.md 참고.

이것이 무엇이고 무엇이 아닌가

그것이다:

  • 로컬, 파일 기반 장기 기억 계층: JSONL 로그 + SQLite(정확 검색용 FTS5, 시맨틱 검색용 sqlite-vec)
  • 시간 표현을 이해하고 순위 매기기 전에 검색 범위를 제한하는 단일 쿼리 진입점
  • 매 턴 모델의 컨텍스트에 주입되도록 설계된 '현재 위치' 인덱스(LLL)
  • 한 사람과 한 AI를 위한, 한 대의 머신에서 실행되는 설계. 서버 없음, 클라우드 없음

그것이 아니다:

  • 벡터 데이터베이스 래퍼. 여기서 시맨틱 검색은 첫 수단이 아니라 최후의 수단이다
  • 요약기. 파이프라인 어디에도 의도적으로 요약 단계가 없다
  • 벤치마크 중심의 연구 시스템. 공개된 벤치마크는 없다. 여기 있는 것은 작동하는 구현체와 그 운영 기록이다

세 개의 기둥

  1. 무손실 원본 로그 모든 대화 턴은 고정된 7개 필드 기록으로 변환되어 일별 JSONL 파일에 추가된다:
  • ts: ISO-8601 타임스탬프(UTC)
  • actor: 발화자(설정 가능한 이름)
  • role: user | assistant | system
  • type: text | action | meta
  • text: 내용 그대로(verbatim)
  • model: 알려진 경우 모델 식별자
  • session: 세션 식별자

원본 로그가 진실의 원천(source of truth)이다. 아래의 모든 인덱스는 삭제 후 로그에서 재구축할 수 있다. 살아남기 위해 다른 것은 필요 없다.

  1. 시간 백본(Temporal Backbone) 여기서 시간은 메타데이터가 아니라 주요 축이다. 정확 일치 인덱스(SQLite FTS5, 일본어와 영어를 위한 바이그램 토큰화)는 모든 행에 타임스탬프를 함께 저장한다. 쿼리 파서는 시간 표현을 이해한다 — yesterday, last week, 3 days ago 같은 상대 표현(현재 일본어만)과 2026-07-19 같은 절대 날짜(모든 언어) — 그리고 순위 매기기 전에 범위로 변환한다. 시간 표현이 있으면 결과는 해당 범위로 제한되고 시간순으로 반환된다. 시맨틱 검색은 정확 인덱스가 범위 내에서 너무 적은 결과를 반환할 때만 사용되며, 폴백은 출력 헤더에 정직하게 표시된다.

실질적 효과: AI가 "지난 화요일 밤에 우리가 무엇을 결정했지?"라는 질문에, 3주 전의 비슷한 내용을 재구성한 것이 아니라 실제 지난 화요일 밤의 대사들을 순서대로 답할 수 있다.

  1. LLL — '지금 우리는 어디에 있나' 인덱스 LLL은 주제 마커의 소형 인덱스다. 대화가 새 주제로 넘어간 시점을 기록하는, 짧고 타임스탬프가 붙은 라인들이다. 매 턴 주입된다.
원문 보기
원문 보기 (영어)
lossless-memory Lossless long-term memory for a personal AI — never summarize, keep every line, and put a timestamp on everything. Most long-term memory systems for AI do one of two things: they summarize conversations into compact notes, or they embed them and retrieve "similar" chunks. Both lose the thing that matters most to a person who talks to the same AI every day: what was actually said, and when. This project takes the opposite position. Keep every line. Raw conversation logs are stored in full. Nothing is summarized, ever. Summaries are a map; the log is the territory. Timestamp everything. Every record — utterance, action, document chunk — carries a timestamp, and every index is built on top of that time axis. We call this the Temporal Backbone . Search by time first, words second. "Yesterday evening, about the budget" is a valid query. The time phrase narrows the range; the words rank within it. Results come back in chronological order, unsummarized, with their timestamps. Inject "where we are" every turn. A small index called LLL tells the model which topic the conversation is in right now, so identity and context survive context-window compaction and session boundaries. The design lineage goes back to December 2025 — the first ancestor of this system (a memory-inheritance tool for an earlier AI) ran that month, and a predecessor system carried the same ideas in daily use from January 2026. This implementation has been running every day since July 2026 for a single user, as the memory of one AI assistant, with raw logs reaching back to June 2026. It is small, boring, and it works. The failures along the way are documented too — see docs/lessons.md . What this is / what it is not It is: A local, file-based long-term memory layer: JSONL logs + SQLite (FTS5 for exact search, sqlite-vec for semantic search). A single query entry point that understands time expressions and restricts the search range before ranking. A "current position" index (LLL) designed to be injected into the model's context on every turn. Designed for one person and one AI, running on one machine. No server, no cloud. It is not: A vector database wrapper. Semantic search is the last resort here, not the first. A summarizer. There is deliberately no summarization step anywhere in the pipeline. A benchmark-driven research system. There are no published benchmarks. What is here is a working implementation and its operating record. The three pillars 1. Lossless raw log Every conversation turn is converted into a fixed seven-field record and appended to a per-day JSONL file: ts ISO-8601 timestamp (UTC) actor who spoke (configurable names) role user | assistant | system type text | action | meta text the content, verbatim model model identifier, if known session session identifier The raw logs are the source of truth. Every index below can be deleted and rebuilt from them. Nothing else is required to survive. 2. Temporal Backbone Time is not metadata here; it is the primary axis. The exact-match index (SQLite FTS5, bigram tokenized for Japanese and English) stores the timestamp alongside every row. The query parser understands time phrases — relative ones such as yesterday , last week , 3 days ago (currently Japanese only), and absolute dates such as 2026-07-19 (any language) — and converts them into a range before any ranking happens. If a time phrase is present, results are restricted to that range and returned in chronological order. Semantic search is only used when the exact index returns too little inside the range, and the fallback is reported honestly in the output header. The practical effect: the AI can answer "what did we decide last Tuesday night?" with the actual lines from last Tuesday night, in order, rather than a paraphrase of something similar from three weeks ago. 3. LLL — the "where are we now" index LLL is a tiny index of topic markers : short, timestamped lines that record when the conversation moved to a new subject. It is injected into the model's context every turn. Two rules make it work: The AI reads it; the human writes it. Priority colors and completion marks are set by the person, not by the model. The model never edits its own sense of "what matters." It is cheap enough to inject every turn (well under a second to render), so the model always knows what the current thread is, even immediately after its context window was compacted. LLL is what lets a long-running assistant come back from a compaction and continue the conversation instead of starting over. Architecture raw conversation logs (JSONL, per day) ← source of truth, never summarized │ ▼ ingest ──► 7-field records │ ├──► index_exact SQLite FTS5 + timestamps (words + time) ├──► index_vector sqlite-vec embeddings (meaning, last resort) └──► state_index LLL topic markers (where are we now) │ ▼ recall ── one entry point: parse time phrase → restrict range → rank → return verbatim lines │ ▼ injected into the model's context (on demand, or every turn for LLL) A small daemon re-indexes incrementally on a fixed interval (default: every 10 minutes). Rebuilding from scratch is never required; indexes detect rewritten source files and re-index only those days. Quickstart git clone https://github.com/aru-labs/lossless-memory cd lossless-memory pip install -e . cp config.example.json config.json # edit names and paths if you like Then follow examples/quickstart.md : it ingests a small sample conversation, builds the indexes, and runs a time-scoped query in about five minutes. A pytest round-trip test covers the same path. Numbers from real operation These are measurements from the running instance, not projections. What Value Daily operation this implementation since 2026-07 (raw logs from 2026-06); design lineage since 2025-12 Exact-search index rebuild, before → after redesign 40 s → 1.24 s Vector index size, before → after removing library-contamination 447,013 rows (2026-08-31) → 865,588 rows (2026-09-04, at its worst) → 124,174 rows (after the fix) Vector store on disk, before → after 2.54 GB → 337 MB Re-index interval 10 minutes The "before" numbers are failures. They are kept on purpose. See docs/lessons.md . Why This was built for one person who has talked to AI assistants every day for years and watched each of them forget. Not degrade gracefully — forget. The fix that the industry keeps reaching for is better summarization. From the user's seat, summarization is the forgetting: the exact words, the time of night, the way something was said — the parts that make a memory feel like it belongs to someone — are the first things a summary drops. So this system refuses to summarize. It costs disk space and it requires a good time index to stay usable. That trade was made deliberately, and the operating record says it holds up. The longer-term goal is a companion for people who live alone — an AI that remembers you the way a person would, on hardware you own. This repository is the memory layer of that. Limitations (please read) Single-user, single-machine. It has only ever run for one person. There is no multi-tenant story. Japanese-first. Relative time phrases ( yesterday , last week , 3 days ago ) are parsed in Japanese only. In English, use absolute dates ( 2026-07-19 ) for now; English relative phrases are on the roadmap. Primary log format is Claude Code's JSONL. A plain {ts, role, text} importer is included, but the Claude Code path is the one with two months of mileage. No benchmarks. Numbers above are operational measurements, not comparisons against other systems. Semantic search depends on a local embedding model (sentence-transformers). CPU works; GPU is optional. Documentation Document What it covers docs/memory-system.md Concept and specification of the memory system docs/temporal-backbone.md Why time is the primary axis, and how time phrases are parsed docs/lll.md The "where are we now" index and the human/AI division of labor docs/philosophy.md Why no summarization; memory, time,