Keepfold is one memory for all your AI apps: Claude, Cursor, Codex and the rest read the same notes, kept as plain Markdown on your own computer. Search is the core of it. If search returns the wrong page, every app gets the wrong context.

For 0.8.0 I rebuilt search, and before changing anything I built a benchmark. This post is what it showed me, including the parts where I was wrong.

The benchmark

  • 312 made-up documents: notes, excerpts of saved AI chats, and YouTube visits, from June 2025 to November 2026.
  • 116 questions with graded answers (2 = the answer, 1 = related). They are in English, Hindi and Malayalam, in their own script and typed in English letters, plus two in Arabic. Some ask for lists, some use a different spelling, and a few have no answer at all, so a search that always returns something is punished.
  • The score is nDCG@10: 1 means the right pages are at the top of the first 10 results, 0 means none of them are there.
  • Questions with an even id were used to choose settings, odd ones were held out, so I could see when I was fitting the test.
  • Each model runs in its own process, so its peak memory is its own.

The documents and questions are made up and I wrote them myself, so real data will score differently. The script is in the repo: scripts/bench_search.py.

Mistake 1: SQLite was splitting Hindi words

SQLite's FTS5 tokenizer, unicode61, treats combining marks as separators. In Hindi and Malayalam, vowel signs are combining marks. So "भारत" was indexed as "भ" and "रत", and "काल" matched "कुल केला", because all three reduce to the same consonant fragments.

The fix was one tokenizer option: tokenchars with every combining mark in the Basic Multilingual Plane except Latin's, and the same word rule on the query side. Whole-word search now works in every script.

Mistake 2: my hybrid search lost to keyword search

Keepfold combines full text search with search by meaning (a small local embedding model, BAAI/bge-small-en-v1.5). In the first run the hybrid scored 0.683 and plain keyword search scored 0.725. Adding a model made search worse.

Two settings did most of the damage:

  1. The model is English-only. For a question in Devanagari or Malayalam script, its similarity scores are noise, and that noise was pushing the right pages down. Now an English-only model sits out questions in those scripts and leaves them to word and sound matching. That alone moved Hindi from 0.703 to 0.744 and Malayalam from 0.673 to 0.719, with English unchanged.
  2. Saved AI chats were ranked down too hard. I had multiplied their score by 0.6 so chats would not crowd out notes. In the benchmark the chat is often the answer. 0.8 scored better.

Each model now has its own settings (a similarity floor, the weights, the chat weight), measured on the benchmark.

I also tried normalising similarity per question (a floor relative to the question's median score). It helped one model on held-out English, but it needed a different constant for another model and a guard for small vaults. Several other parts of Keepfold read the same floor without a whole query's scores to normalise against. So I kept one floor per model, read the same way everywhere.

The English reranker added 0.002 to 0.005 and about half a second to the slowest questions, so it is now off by default.

Typed in English letters

Many people type Hindi and Malayalam in English letters. "veedu" should find "വീട്" (house). Keepfold now stores a sound skeleton of each word in a second full text table, so "veedu" and "വീട്" meet, and "kya hai" finds "क्या है". In 0.8.0, longer words also meet across spellings: "biriyani" finds "biryani", and "video" finds "वीडियो". Shorter words keep their spelling, because "क्या", "किया" and "की" would otherwise collide.

That change made the index slower to build, and the benchmark of the prime path caught it: about 0.4 seconds more per call on a 5,000-note vault when the app switches between AI apps. Reusing each unchanged page's skeletons on a switch brought it back under where it was before.

Reading the question first

The other big change is not ranking at all. Questions like "what did I watch on YouTube last week?" or "how many videos did I watch in November?" are not search problems. Keepfold now reads the question once, before any search: the date range (in English, Hindi and Malayalam, in both scripts), the site, and whether you want a list, a count, or the first or latest time. Lists and counts are answered by code from your data. A language model guessing a count gives you a wrong answer that sounds right.

The numbers

Search All 116 English (53) Hindi (30) Malayalam (31) Time per question
Keepfold 0.7.0 0.638 0.743 0.548 0.524 17 ms
0.8.0, Fast (the default) 0.743 0.752 0.720 0.732 18 ms
0.8.0, Best for meaning 0.855 0.869 0.856 0.821 58 ms
0.8.0, words only (no model) 0.735 0.749 0.686 0.742 1 ms

This table measures ranking alone. The 15 questions about a date, or the first or latest time, are scored without the date filter that reads them first in real use, so they pull every row down a little.

Best for meaning uses EmbeddingGemma 2. It is a bigger download (about 200 MB against 65 MB) and used about 2.2 GB of memory at peak in the benchmark, so it is a choice in Setup, not the default. Search keeps using the old model until the new one's index is built.

Two things I did not expect: words only, with no model at all, comes within 0.01 of the default, and it beats it in Malayalam. The default is still worth having for questions that share no words with the answer, but most of the gain in 0.8.0 came from the word side (tokenizing, sound matching, the chat weight), not from the model.

Not right yet

  • Some spelling pairs still miss: "radio" does not find "रेडियो".
  • Thai, Lao, Khmer and Burmese words are not split.
  • Best for meaning has been checked on Windows only so far.

Keepfold is free and open source (MIT), for Windows, macOS and Ubuntu: github.com/alenissacsam-2/keepfold. If you try the benchmark on your own machine, I would like to see your numbers.

I built Keepfold with Claude Code as my pair programmer. Claude Code also wrote this post from our benchmark notes.