Offline Kit
← Blog

Can Local AI Search My Notes When I Forget the Exact Words?

· Field guide

Yes. You can search notes on your Mac by meaning, even offline, once you’ve downloaded a local embedding model. If you remember writing about a place to fill your water bottle, a search for “drinking water” can lead you back to a sentence about a tap behind the visitor center.

This is called semantic search. The model gives each passage a list of numbers called an embedding. It does the same for your question, then you can rank the passages by how closely their embeddings match. The result is a passage you can open and read. You don’t need a chat model to rewrite it for you. How Ollama embeddings work

Start with three notes you can check by eye

For a first search, use a collection small enough that you know exactly what’s in it. Make an empty folder on your Mac and save these three plain-text files inside. In TextEdit, choose Format → Make Plain Text before saving.

Filename Text to save
water.txt We refilled our bottles at the tap behind the visitor center.
parking.txt We left the van in the gravel lot beside the footbridge.
keys.txt The spare cabin key hangs on a blue hook inside the shed.

Open the water note and use Command-F to find “visitor center.” Now try “drinking water.” The first search finds the phrase. The second leaves you looking at a sentence you recognize, even though none of the words you searched for appear in it. That’s a good test case for searching by meaning.

Try the same search with Wi-Fi off

While online, open Ollama on your Mac and run ollama pull all-minilm in Terminal to download the embedding model. Check that python3 --version prints a version number. The small script below uses Python 3 and its standard library. Model listing

Save this as search_notes.py alongside the three notes. It reads the text files in that folder, sends their contents and your question to Ollama on this Mac, and prints the closest passages first. For this small collection it recalculates the embeddings each time you search.

import json
import sys
from pathlib import Path
from urllib.request import Request, urlopen

files = sorted(Path(__file__).parent.glob("*.txt"))
question = " ".join(sys.argv[1:]).strip()
if not files or not question:
    sys.exit('Keep the .txt notes beside this script and supply a search phrase.')

passages = [file.read_text(encoding="utf-8").strip() for file in files]
payload = {"model": "all-minilm", "input": [question, *passages]}
request = Request("http://127.0.0.1:11434/api/embed",
                  data=json.dumps(payload).encode(),
                  headers={"Content-Type": "application/json"})
with urlopen(request) as response:
    query_vector, *note_vectors = json.load(response)["embeddings"]

def similarity(vector):
    return sum(a * b for a, b in zip(query_vector, vector))

for file, passage, vector in sorted(zip(files, passages, note_vectors),
                                    key=lambda item: similarity(item[2]), reverse=True):
    print(f"{file.name} — {passage}")

Leave Ollama running. Disconnect Wi-Fi and any other internet connection. In Terminal, type cd followed by a space, drag the notes folder from Finder into the window, and press Return. Then run:

python3 search_notes.py "Where can I get drinking water?"

Look for water.txt and read the sentence beside it. If it ranks first, the model found the passage through a paraphrase. If another note comes first, try “Where did we fill our bottles?” and compare the order. If Terminal reports a connection error, reopen Ollama. If Ollama reports a missing model, check for all-minilm with ollama ls. Ollama embedding API

Ask one question the notes can’t answer

Run the script again with “What time does the visitor center close?” The water note mentions the right building, so it might appear first. Read it again. It gives you the location of the tap and says nothing about opening hours. Even when every file is irrelevant, one file still ranks first.

Use this approach on your own notes when you remember the subject and want the original wording back. Start with a few short entries. For a longer journal, search individual entries or paragraphs and keep the date and filename with each passage. When you do remember an exact detail, such as a booking number, a plain-text search is a good first move. Either way, finish by opening the note and checking the line you came for.

← Back to the blog