What I measured
My AI system saves a note after every working session. I search the archive of roughly 600 notes three ways.
- By words: counts how many words of the query a note contains, weights rare words more (IDF), ignores diacritics and trims word endings. It is simpler than BM25, which also accounts for term frequency and document length.
- By meaning: the model multilingual-e5-large turns the query and the note chapters into vectors and ranks them by similarity.
- Combined: the two rankings are merged with reciprocal rank fusion, where each record receives the sum of 1/(60 + rank) across all lists.
The test set has 32 questions about random lines of the notes. I asked the same 32 again without diacritics, because I often type queries without them. I count whether the correct session lands in the top 1, 3 and 10.
Results
Number of questions out of 32 where the correct note is in the top 1 / top 3 / top 10:
| Query | By meaning | By words | Combined |
|---|---|---|---|
| with diacritics | 15 / 19 / 24 | 16 / 23 / 27 | 21 / 24 / 28 |
| without diacritics | 12 / 15 / 24 | 16 / 23 / 27 | 19 / 24 / 26 |
What follows
The methods catch different cases. In the top 10, only the keyword search found the right note for 7 questions and only the semantic search for 4. Together the two lists contained it for 31 of 32 questions; the merged top 10 for 28.
Combining is somewhat better at rank 1, but the difference is small and inconclusive. The right note ranked first for 21 questions against 16 for keywords alone. In a paired comparison (8 questions in favour of the combination, 3 against) the difference is statistically inconclusive (p = 0.23), so it does not show that the combination is better. Against semantic search alone, without diacritics, the difference is most visible: in the top three only the combination found the note for 9 questions and the reverse happened for none (p = 0.004).
Without diacritics the model got worse. It dropped from 19 to 15 questions in the top three. Keyword search stayed the same because it strips diacritics itself.
Cutting the text up helped for the second half of the notes. Each note used to have one vector. The model reads at most 512 tokens, while 94% of the notes are longer, so on average it did not see 52% of the text. On 32 queries (half asked about a line beyond the 650th token), the top-3 hit rate for lines in the second half of the text rose from 5 to 9 of 16 after I split the notes into chapters of up to 400 tokens with a header. At this sample size the difference is inconclusive.
What the test does not show
The AI wrote the questions with the target note in front of it, which favours keyword search. There are 32 distinct questions, and one question is 3 percentage points. I tuned on the same set, so the final numbers are optimistic. On another 13 questions I wrote from memory, the right note ranked first for 5 in my own wording and for 9 in a short one-topic query with diacritics. I tuned on that set too, so it is not an independent check.
I dropped one change under a rule written beforehand: accept it only if it gains at least 3 of 32 questions and worsens no part. Adding context to each text piece (Contextual Retrieval) gained 1 question and lost 1 in the part without diacritics.
The rule I keep from this: write the query short, about one topic, with diacritics, and search two ways at once, because each found notes the other missed.
Sources
- Robertson, Zaragoza, The Probabilistic Relevance Framework: BM25 and Beyond (2009): defines BM25, which I compare my simpler keyword search to.
- Cormack, Clarke, Büttcher, Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods (2009): the rank-merging method with constant 60.
- Thakur et al., BEIR: A Heterogenous Benchmark for Zero-shot Evaluation of Information Retrieval Models (2021): BM25 remains a robust baseline against semantic models.
- Wang et al., Multilingual E5 Text Embeddings: A Technical Report (2024): the model used for semantic search.
- intfloat, multilingual-e5-large, model card (Hugging Face): longer text is truncated to 512 tokens.
- Anthropic, Introducing Contextual Retrieval (2024): combining embeddings with BM25 and adding context to text pieces.