Kedalio: I cut 88% of the code and kept only memory and tasks
Kedalio is where I keep the memory, tasks and projects I share with my AI assistants: Claude, Codex and ChatGPT all reach it through the same MCP connector. On 5 November I decided to cut 88% of it. The short version is on the project page; here I tell how I got there and what changed in the way I design it.
The problem
AI assistants remember nothing. Every session starts from zero and every app has its own memory: what I explain to Claude Code in the morning, ChatGPT doesn't know in the evening. I wanted one place for decisions, tasks and the state of my projects, which every assistant reads and writes the same way through MCP, the protocol assistants use to call outside tools.
I had been circling the idea since June with Agents Multi. On 16 October I rethought the project from scratch, named it Kedalio and started writing it in TypeScript, on Deno.
How it grew
The starting idea was wide. The vision document put memory and tasks for every session at the centre, with a lot around them: a personal assistant; hosts running agents in containers while I'm away; a program on my computer, Orion, with a terminal UI, credentials and hooks; an Android app; the cost of every run. Later on, a service to offer to other people too.
Every piece had its ADR, a written decision with the options it turned down, and on its own every ADR held up. By 2 November I had about forty of them, and I archived them all to start the decisions over. On the 3rd I chose to rewrite the core in Go. On the 5th the service moved to the new core, and the repository held 333,700 lines in 2,057 files, across TypeScript, Go and Kotlin.
That evening I asked myself what I actually used. Every day, from every computer, I used the memory, the tasks and the projects, always through the connector. Everything else had to be built, tested and kept up to date, and on its own it made up more than half of the lines. The task I opened that evening starts like this: Kedalio has become too complicated, I'm tired of developing it, it's for me and it isn't a product.
The decision
I kept the memory, the tasks, the projects and sign-in, behind a single connector. Out went the web app and the phone app, the hosts, the assistant, the integrations and Orion. The MCP servers for other services and the session tools moved to a separate repository, my workbench, and the secrets left Kedalio.
Before removing anything I put a tag on it, archive/full-2026-11-05, which keeps everything. Then I removed one part per commit: the Android app, Orion, the Deno server, the web app and so on. If I ever need a piece back, I know where it is and what was around it.
Why Go
I had picked Go for the wide system: one binary per platform, hooks that start instantly on the computer, the core running inside Orion. The cut took Orion and the hooks away, and the reason for the choice with them. Go stayed the right choice for other reasons.
The core is one program, built without C into a static binary, with the database and the key in one volume. Every green push to dev makes CI build the image and update the server; since 8 November there are no version numbers.
The database is SQLite, with a pure Go driver I picked after a speed test of search on 250,000 chunks of text. The alternative was a little faster on words and a little slower on vectors; I took this one for encryption at rest, which the other one doesn't have.
The standard library does the rest: the HTTP server, OAuth for the clients, passkeys (WebAuthn written on top of crypto), backups to S3 with the request signing written by hand. There are three direct dependencies: the SQLite driver, the MCP SDK and a PDF reader for documents, and four files import them. Before the cut there were eight, and the extra ones were nearly all for the terminal UI.
The rewrite had two conditions: the old system stayed my everyday tool until the new one did the same things, and the new search had to reach the old one's scores before replacing it.
The shape, before and after
Before, there were ten parts spread across my computer, the server, the phone and the hosts, linked by a protocol of their own, and each one was built and updated its own way. After, there is a single line. The assistant connects with OAuth and I confirm with a passkey; the connector exposes 15 tools; the Go program reads and writes one encrypted SQLite file and sends encrypted copies to S3 storage. Next to it run a local model that computes the embeddings for search by meaning, and a nightly job that tidies the memory.
The rules that came out of it
With fewer parts, the rules got sharper.
The first is that the service enforces the rules. Agents write to the memory without asking me, so the writing rules live in the core, not in a prompt the agent can forget: a page has a title, one sentence saying what it is and at most 800 words, and a new page whose title is nearly the same as an existing one is refused. The refusal comes with the reasons and the similar pages, so the agent fixes it on its own. The nightly job, which is a model, has one more constraint: a sentence can leave a page only if it already stands, word for word, on the pages the job says it moved it to.
The second is that search gets measured. kedalio-recall-eval asks a frozen copy of my memory 58 questions, plus 54 control questions on other pages, and two runs give the same result byte for byte. A change to search stays only if no question gets worse, in either of the two modes and in either set. On 7 and 8 November, one fix at a time, the share of right pages found went from 91.4% to 96.6%, and the first right page now comes higher in the answer (MRR from 0.712 to 0.819). Along the way I fixed the evaluation itself, which counted documents wrong: one search number dropped from 0.789 to 0.740, and I kept it, because it was the correct count.
The third is that code goes and data stays. No migration drops or alters a table: my existing database starts under the new code, and the tables of the removed parts stay there, unused.
The fourth I wrote down on 8 November: Kedalio is memory and tasks, working, complete and well made, and nothing else. Work that doesn't serve memory or tasks stays out, and when in doubt it stays out.
The numbers
| 5 November | 11 November | |
|---|---|---|
| Lines in the repository | 333,700 | 40,585 |
| Files | 2,057 | 207 |
| Product languages | TypeScript, Go, Kotlin | Go, plus 87 lines of JavaScript for the passkey |
| Direct Go dependencies | 8 | 3 |
| Go tests | 993 | 497, all green |
The peak needs reading with care: on 5 November the TypeScript system, running until that day, sat next to the Go core replacing it. The cut holds up anyway. On 2 November, before any Go, the repository had 225,380 lines, and against that day the cut is 82%. The Go code went from 93,633 to 30,462 lines: two thirds of what I had just rewritten were parts I then removed.
What I would do differently
I'd ask "what do I use every day?" on the first day; I asked it after three weeks. Every part had a well-argued ADR, but no ADR asked whether I would use it. I work with agents that write code under my direction, and with them adding a part is cheap. Keeping it running, testing it and remembering how it works costs what it always did.
I'd cut before rewriting. I ported Orion, the assistant and device management to Go too, and removed them right after: I could have rewritten a third of the Go code.
I'd measure search from the start, on a frozen copy. The first evaluation, at the end of October, queried the live server, and two runs a few days apart couldn't be compared because the memory had changed in between.
The next change is already written: the diary's weekly pages will be able to mark the days they cover as summed up. It touches search, so it stays behind a switch that is off until the evaluation says no answer gets worse.