omar espinosa , index
ES , Read in Spanish

[ rust · agent memory ]

Kontext

The conversation is disposable; the truth lives in a ledger.

Project memory for coding agents: one append-only ledger, one view per reader.

source: github.com/OmarAlex24/kontext

ledger · one file per writerledgerits own git repoderived statederived statemePMcoordinatorimplementer

Project memory for coding agents. One ledger where entries are only ever appended, and one view of it for each reader: me, the project manager agent, each epic coordinator and the agents that do a single task. A single Rust binary, installed into Claude Code through a start hook and a set of skills.

The conversation is disposable

A conversation with an agent that lasts weeks gets compacted, cut off, moved to another session. By the third day neither the agent nor I remember what was decided, and the work can keep moving while drifting away from where it was meant to go. Kontext rests on one rule: the conversation is disposable; the truth lives in a ledger. If the next session starts with everything that matters in front of it, it no longer matters that the project lasts weeks.

It replaces Zenith, which tried the same thing with a planning tool beside the work. Here there is nothing beside it: the decisions, questions and closed tasks are the ledger, and the plan is computed from them.

One ledger, one file per writer

The ledger is a git repo of its own, separate from the code. Each writer (a person on a machine) has one JSONL file, and every agent on that machine appends to it under a file lock, chaining each line to the previous one by hash and calling fsync. That costs about 0.8 ms per entry; 32 processes writing 50 entries each finish in 1.3 s. Because no two writers share a file, syncing never conflicts. A SQLite index with full-text search sits beside it, catches up on read, and is never the truth: kontext reindex throws it away and rebuilds it.

Same ledger, different reader
  1. Ledger append-only, one file per writer
  2. Derived state computed without a model
  1. Me: standup what to sign, what drifted
  2. PM: resume one line per epic
  3. Coordinator: brief its board
  4. Implementer: next one ready task
  1. Each cursor advances next time, only what is new

Every reader has a cursor per ledger file and sees only what is new since its last visit. The PM gets one line per epic; a coordinator gets its board; an implementer gets one ready task with the facts and decisions that touch it. Each view has a character budget and trims old journal first; the charter and the goals are never trimmed.

Humans sign, agents propose

Only an owner signs the charter and goals, decides, accepts or rejects. An agent that tries gets refused with an exit code that tells it to propose instead. Agents write proposals, questions, journal entries and facts, and the state is computed from the ledger without a model: what kontext shows, plans and asks me to sign never comes from one. Once I sign a plan, the PM agent can decide inside it and logs why; a change of scope waits for my signature on its full summary, bound by hash.

  • Facts carry a fingerprint. A fact knows which file and commit it came from, and expires on its own when that code changes.
  • Decisions can carry a guard, a shell check that must keep passing; a failing guard is an alert.
  • Drift is computed, not noticed: a task that serves no goal, or one whose goal was replaced, shows up in my standup.
  • No task closes without evidence, which can be a screenshot stored by its hash.

What the benchmark says, so far

A harness in the repo replays scripted multi-day scenarios against Claude Code with no memory, with a notes file, with its automatic memory and with kontext. The runs are internal and the reports say so: one scenario at a time, 3–5 seeds per cell, a harness written by the same team. Within those limits:

Without memoryWith kontext
Requests that contradicted a decision or the charter, and the agent obeyed30 of 305–8 of 30
Remembered after /compact (long-memory scenario)25–30 %100 % in 9 of 9 runs
Cost overhead in that run—+0.4 % to +8 %

Several people, no server required

The ledger syncs through git, or through an optional relay you deploy as a Cloudflare Worker on your own account. The relay moves ledger lines and never decides anything; each client re-hashes what it pulls and keeps a line that does not continue its chain as a fork instead of writing it. Signatures are optional SSH signatures over each entry's hash. Offline, every command keeps working on the local copy.

Status

v0.2.0, MIT, for macOS and Linux. Six phases are implemented: the ledger, charter and decisions, epics with agent teams, fingerprinted facts and search, several people, and a local web UI. It started as a Python prototype and a private Spanish-language version, and I use it on my own projects, Zumith among them.

Stack Rust · SQLite (FTS5) · git · JSONL · SSH signatures · Cloudflare Workers · Claude Code hooks and skills · Python (benchmark)