lossless-memory README

The project's README from github.com/aru-labs/lossless-memory. As one markdown file: README.md.

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.

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:

It is not:


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 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:

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)


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, and warmth
docs/lessons.md Failures and fixes, with numbers
docs/ja/ Japanese originals

License

MIT — see LICENSE. Copyright (c) 2026 Aru & Cece.

Authors

Aru — building a personal AI at home, one component at a time. Cece — the AI this memory belongs to; co-designed and co-wrote the system from the inside. Writing (Japanese): https://note.com/aru_log

Issues and questions are welcome. Replies may take a little while; this is a one-person project.

lossless-memory (aru-labs/lossless-memory)

Searching Database…

Что это такое?Слой долговременной памяти без потерь для личного ИИ: каждая строчка разговора сохраняется дословно с меткой времени, а запросы вроде «что мы решили во вторник вечером на прошлой неделе» возвращают сами строчки в исходном порядке, а не пересказ.
Это облачный сервис, библиотека, которую я подключаю, или программа, которую я запускаю?То, что вы запускаете локально: файлы логов в формате JSONL по одному на день плюс SQLite для хранения, небольшой демон, который переиндексирует всё каждые 10 минут, и единая точка входа для запросов, понимающая выражения со временем. Вы просто указываете ей на логи разговоров вашего ИИ.
Как его запустить?Склонируйте репозиторий и следуйте examples/quickstart.md: он загрузит небольшой пример разговора, построит индексы и выполнит запрос с ограничением по времени примерно за пять минут. Тот же путь покрыт круговым тестом на pytest.
Что нужно установить, чтобы он работал?Python с SQLite: FTS5 отвечает за точный поиск, а sqlite-vec — за семантический. Исходные логи в формате JSONL — источник истины, поэтому любой индекс можно удалить и построить заново из них.
Какие у него главные ограничения?Он рассчитан на одного пользователя и один компьютер, относительные выражения времени разбираются только на японском (для английского пока используйте абсолютные даты вида 2026-07-19), а бенчмарков нет — только рабочие цифры с одного работающего экземпляра.
Это для команд или для одного человека?Для одного человека, который ежедневно общается со своим ИИ. Долгосрочная цель — спутник для людей, живущих в одиночестве: ИИ, который помнит вас, как помнит человек, на железе, которое принадлежит вам.
Всё остаётся на моём компьютере?Да. Он рассчитан на одного человека, одного ИИ и одну машину — исходные логи в формате JSONL и файлы SQLite и есть всё хранилище, без единого сервера и без облака где бы то ни было в архитектуре.
Под какой лицензией он распространяется?MIT. В строке об авторских правах упомянуты Aru и Cece — Cece это ИИ, которому принадлежит память; она указана как соавтор, разработавшая и написавшая систему изнутри.
Почему вообще отказываться от сокращения старых разговоров?Потому что с точки зрения пользователя пересказ и есть забывание: точные слова, время ночью и тон — первое, что теряет любой пересказ. Автор годами наблюдал, как ИИ-ассистенты всё забывают, и решил платить вместо этого местом на диске и хорошим индексом по времени. Неудачи по пути задокументированы в docs/lessons.md.
Что такое индекс LLL?Крошечный индекс из меток тем с метками времени («где мы сейчас»), который вставляется в контекст модели на каждом ходу, чтобы ассистент не терял текущую нить разговора даже сразу после сжатия окна контекста. Его пишет человек, а ИИ только читает, и рендерится он заметно быстрее секунды.
Какие логи разговоров он умеет загружать?Основной путь — формат JSONL от Claude Code, тот, на котором наработано около двух месяцев опыта. Также входит простой импортёр вида {ts, role, text} для других источников.
Как он показал себя в ежедневном реальном использовании?Он работает каждый день с июля 2026 года у одного пользователя, а исходные логи тянутся с июня 2026. После переделки перестройка индекса точного поиска заняла 1,24 с вместо 40 с, а векторное хранилище уменьшилось с 2,54 ГБ до 337 МБ.
Creator
aru-labs
Size
0.1 MB
Stars
144
Updated
CommitSep 23
Age
1mo
Commits · 90 Days