Lossless-Memory: A Personal AI Long-Term Memory Layer Without Summarization
TL;DR
Lossless-Memory stores every AI‑human utterance verbatim with timestamps, indexes them by time first, and injects a tiny "where are we now" index into the model’s context, providing lossless recall for a single user on a single machine.
What the project is
Lossless-Memory is a local, file‑based long‑term memory layer for a personal AI assistant. It consists of:
- Raw JSONL logs (one per day) that contain a seven‑field record for each turn, never summarized.
- SQLite indexes – an exact‑match FTS5 index that stores timestamps alongside words, and a fallback vector index (sqlite‑vec) for semantic search.
- Temporal Backbone – a query parser that extracts time expressions (relative Japanese phrases or absolute dates) and restricts the search range before any ranking occurs.
- LLL index – a tiny, human‑written list of topic markers that is injected into the model’s context on every turn, preserving the current conversational thread.
The system is deliberately single‑user, single‑machine and does not act as a generic vector‑database wrapper or a summarizer.
Core design pillars
1. Lossless raw log
Every turn is appended to a per‑day JSONL file with the fields:
ts ISO‑8601 UTC timestamp
actor speaker identifier
role user | assistant | system
type text | action | meta
text verbatim content
model model identifier (optional)
session session ID
These logs are the source of truth; all indexes can be rebuilt from them.
2. Temporal Backbone
Time is the primary axis, not just metadata:
- The FTS5 index stores timestamps with each row.
- The parser understands Japanese relative phrases (e.g., "昨日", "先週") and any absolute ISO date, converting them into a concrete time range before ranking.
- If a time phrase is present, results are limited to that range and returned in chronological order. Semantic search is only used when the exact index returns too few results, and its use is explicitly reported.
This enables queries like "What did we decide last Tuesday night?" to return the exact lines spoken on that night, in order.
3. LLL – "where are we now" index
LLL is a lightweight index of topic markers—short, timestamped lines that a human writes whenever the conversation shifts topics. The model reads this index but never edits it, ensuring the AI always knows the current thread even after context‑window compaction.
Architecture diagram
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 daemon re‑indexes incrementally every 10 minutes; only modified daily files are processed, so full rebuilds are unnecessary.
Real‑world performance numbers
| Metric | Value |
|---|---|
| Daily operation | Running since July 2026 (logs from June 2026) |
| Exact‑search index rebuild (pre‑ vs post‑redesign) | 40 s → 1.24 s |
| Vector index rows (worst case) | 865,588 rows (Sept 4 2026) → 124,174 rows after fix |
| Vector store size | 2.54 GB → 337 MB |
| Re‑index interval | 10 minutes |
These figures come from the author’s single‑user deployment and illustrate the practical impact of the redesign.
Why a lossless approach?
The author built this system for a person who talks to an AI assistant daily and has experienced the gradual forgetting caused by summarization. Summaries discard the exact wording, tone, and timestamp—elements that make a memory feel personal. By refusing to summarize, the system preserves the full conversational texture at the cost of additional disk space and the need for a robust temporal index. The goal is a companion that remembers you as a human would, running entirely on hardware you own.
Limitations and open issues
- Single‑user, single‑machine – no multi‑tenant support.
- Japanese‑first time parsing – relative time phrases work only in Japanese; English users must supply absolute ISO dates.
- Log format – optimized for Claude Code’s JSONL; a generic
{ts, role, text}importer exists but is less battle‑tested. - No published benchmarks – the numbers provided are operational measurements, not comparative performance data.
- Semantic search relies on a local embedding model (sentence‑transformers); GPU acceleration is optional.
Community feedback (Hacker News comments)
"Looks like a nifty information retrieval approach. Temporal/versioned chronology is absolutely useful." – alansaber
"How is this different than https://github.com/obra/episodic-memory ?" – schainks
"Relative time parser is hard‑coded for Japanese; English sessions are stuck with manual ISO dates. Wiring up dateparser or duckling would take an evening, so leaving that on the roadmap is an odd choice." – TimByte
"It may seem useful at first, but eventually you'll hit a wall where this doesn't work, and you have to add another memory technique. Eventually you end up with a complex multi‑layered system, because what people want by 'memory' is actually 10 different things which all need their own solution." – 0xbadcafebee
"Seems like this would break the cache often. That would increase billing rates with certain providers and, for local models, take a while to generate responses, especially with long‑running agentic sessions." – theresLand
These comments highlight both enthusiasm for the temporal focus and concerns about language support, scalability, and integration with existing caching or memory frameworks.
Getting started
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 as needed
Follow the examples/quickstart.md guide to ingest a sample conversation, build the indexes, and run a time‑scoped query (≈5 minutes). A pytest round‑trip test validates the full pipeline.
Documentation and further reading
| Document | Scope |
|---|---|
docs/memory-system.md |
Concept and specification |
docs/temporal-backbone.md |
Time‑first indexing and phrase parsing |
docs/lll.md |
Topic‑marker index and human/AI responsibilities |
docs/philosophy.md |
Rationale for avoiding summarization |
docs/lessons.md |
Failures, fixes, and performance numbers |
docs/ja/ |
Original Japanese texts |
License
MIT License (c) 2026 Aru & Cece.
Sources
Related
- Project
- Project
- Project
- Project
- Project