What it is
Kedalio is the shared memory of my AI agents. A single Go program with an encrypted SQLite database runs on my server and speaks MCP (Model Context Protocol). Claude, Codex and ChatGPT connect to the same address and find the same memory, the same tasks and the same projects, from any computer.
It is a personal tool, not a product: I use it every day to work.
What it does
- Memory of linked pages. Everything is a Markdown page in an area: me, projects, people, notes, diary, inbox. Pages cite each other with
[[links]]and with named relations (part_of,about,blocked_by…), optionally with an end date ("until…"). Every page keeps its history and a revision number: writes declare the revision they read, so two sessions on the same project never silently overwrite each other. - Tasks. Steps, repeats, relations between tasks, saved views. Closing a task leaves a line in the day's diary. The daily brief says what is overdue, what is due today and tomorrow, what waits on someone else.
- Projects and session start. At the start of every conversation the agent sends its folder and git remote: Kedalio answers with the project, its card (150 words at most, the "where were we?"), preferences, today's tasks and urgent ones elsewhere. At the end of the session the card is updated.
- Documents. Collections of PDFs, docx, xlsx and web pages, split into passages and searched together with the pages.
- Nightly upkeep. A job with reduced permissions tidies the memory every night; the core refuses a rewrite that loses sentences.
How it searches
memory_recall answers a question with a package of pages, in a single call:
- Three rankings. By words, with SQLite FTS5 and BM25 (the title weighs 4, the body 1; long words also match as prefixes). By title. By meaning, with the question's embedding computed by bge-m3 (Q8 quantized, multilingual) running next to the service, with no external API: a first pass on int8 vectors with 400 candidates, then the exact float32 score. If the model doesn't answer in time, it goes on with words only, and the answer says so.
- Fusion. The rankings are merged with Reciprocal Rank Fusion (k = 60): no scores to tune by hand.
- Seeds. The pages found become starting points, at most 15; below 40% of the best one they are noise. If no seed covers enough words or meaning, the answer is "nothing relevant", with the three nearest pages flagged as weak.
- The graph. From the seeds a personalized PageRank runs (20 iterations, damping 0.5) on the undirected page graph. Edge weights: named relation 1, link in the text 0.5, diary episode 0.5, closeness in meaning 0.5 × cosine (5 neighbours per page, above a threshold computed on the account). Expired relations don't propagate.
- The package. At most 4 full pages (within 60% of the budget) and 12 related ones with title, first line and the link they were reached through; then passages from documents.
- The budget. The agent asks for a token budget (300 to 12,000; 2,000 if it says nothing). The cut is measured on the real JSON: related pages go first, then documents, then the tail of the pages, and the answer says what was cut.
How search is measured
A dedicated command (kedalio-recall-eval) re-runs 58 exam questions on a frozen copy of the memory and compares two versions of the code question by question: right pages found, position of the first right one (MRR), noise. Another 54 control questions keep the search from being tuned to the exam. A change stays only if no question gets worse. At the last run, on November 8: 56 questions out of 58 (96.6%), MRR 0.819.
The MCP tools
| Tool | What it does |
|---|---|
memory_recall |
What the memory knows about a subject, in one call (or just the list, in search mode) |
memory_read |
A whole page, with revision, links in both directions and history |
memory_list |
What's there: pages by folder, collections, health (orphans, broken links, long pages) |
memory_write |
Creates, replaces, edits, appends to or restores pages |
memory_delete |
Removes a page (history stays), a document or a collection |
memory_sources |
Collections of documents (URLs or files), with their index page |
memory_upkeep |
The nightly upkeep, with a dedicated token |
tasks_brief |
The daily brief |
tasks_list |
Searches tasks by project, dates, labels, words or relations |
tasks_get |
A whole task: notes, steps, log, relations |
tasks_save |
Adds or changes a task |
session_start |
Opens the session: project, card, tasks, inbox |
projects_link |
Links a folder to a project |
settings_get / settings_set |
Account and project settings |
Architecture
- One Go binary. The service, plus two commands: backup restore and search evaluation.
- Storage. Pure-Go SQLite (
ncruces/go-sqlite3, via Wasm, no CGO), with FTS5 for text and encryption at rest (Adiantum VFS). The key derives from an instance key and a recovery code. Vectors live in the same database as blobs: cosine is computed in Go, no extensions. - Access. OAuth 2 with PKCE (S256) and dynamic client registration, for the apps' connectors; the owner signs in with a passkey (WebAuthn), no password. Every write records who made it.
- Transport. MCP Streamable HTTP on
/mcp, stateless. - Deploy. A container image on my server; periodic encrypted backups, copied to S3-compatible storage. Every push with green CI updates the server.
By the numbers
| What | How much |
|---|---|
| Go code (tests excluded) | ≈ 24,000 lines |
| Tests | 524 functions, ≈ 14,000 lines |
| MCP tools | 15 |
| Direct dependencies | 3 (MCP SDK, SQLite, PDF) |
| Pages in my memory | 364 |
What stays private
The content of the memory. Even the evaluation questions name people and projects, so they stay out of the repository.
License
GNU AGPL v3.