Skip to content
FeaturesPricingBlogDownload

← All posts

How to chat with your Markdown notes using a local LLM

To chat with notes locally, run a model with Ollama and send it the notes that matter, by pasting, a short script or a front end that indexes your folder.

Diagram card on a light background showing a notes folder and a local model answering a question with references to two Markdown files

You can chat with your Markdown notes locally by running a language model on your own computer with Ollama and giving it the notes that matter for each question. For a handful of notes, you put the text straight into the prompt. For a whole folder, you add a retrieval step that picks the relevant notes first, either with a short script or with a chat front end such as Open WebUI that indexes the folder. The notes never leave your machine, because both the model and the files are local.

Below are the setup commands, three ways to get notes into the conversation, how much text fits, and the limits to expect. Commands were checked against Ollama's documentation in November 2026.

What do you need to chat with notes locally?

Three pieces: a model runner, a model, and a way to choose which notes the model sees. The first two are the same for everyone. The third is where the options differ.

Approach Good for What it involves
Paste notes into the prompt A few notes, one question Nothing beyond Ollama
A script that searches, then asks A folder you know well, repeatable questions grep plus a call to Ollama's local API
A front end with a knowledge index A large folder, questions across many notes Open WebUI or a note-app plugin with embeddings

A plain folder of .md files suits all three, because every tool can read it without an export step.

How do you install Ollama and run a model?

Download Ollama for macOS, Windows or Linux from ollama.com, open it, then pull and run a model from a terminal. The quickstart uses Gemma 4:

ollama pull gemma4:e2b
ollama run gemma4:e2b

The quickstart puts that download at about 7.2 GB. Other useful commands from the CLI reference:

ollama ls        # models you have downloaded
ollama ps        # models loaded right now
ollama rm gemma4:e2b # remove a model

Ollama also has a desktop chat app. Its announcement says it "supports file drag and drop, making it easier to reason with text or PDFs," so dropping one note into the chat window is the easiest way to start.

How much of your notes fits in one prompt?

Less than you might expect by default. A model reads a limited number of tokens at once, its context length, and Ollama sets that limit from your graphics memory. Its context length page lists the defaults:

GPU memory (VRAM) Default context
Under 24 GiB 4k tokens
24 to 48 GiB 32k tokens
48 GiB or more 256k tokens

On most laptops that means 4k tokens, a few pages of text. Anything past the limit is text the model does not see. You can raise it with the slider in the Ollama app's settings, by starting the server with OLLAMA_CONTEXT_LENGTH=32000 ollama serve, or per request with the num_ctx option shown below. A longer context uses more memory.

To estimate what your notes cost in tokens, see how many tokens is a Markdown file.

How do you ask about a few specific notes?

Put the note text in the prompt. ollama run accepts a prompt as an argument, and the shell can fill it from files:

ollama run gemma4:e2b "Using only the notes below, list the open decisions.

$(cat ~/Notes/Projects/launch-plan.md ~/Notes/Meetings/2026-11-24-weekly.md)"

Two habits make the answers better. Say "using only the notes below," so the model does not fill gaps from its training. And keep the note's heading structure intact, since headings tell the model where one topic ends.

How do you search a folder first, then ask?

When the notes live in a folder of hundreds of files, let a search choose them. This short Python script finds notes containing a word, sends them to Ollama's local chat API with a larger context, and asks for answers that name their source files. It uses only the standard library.

import json, pathlib, sys, urllib.request

folder = pathlib.Path.home() / "Notes"
word, question = sys.argv[1], sys.argv[2]

notes = [p for p in folder.rglob("*.md")
         if word.lower() in p.read_text(errors="ignore").lower()][:8]
context = "\n\n".join(f"FILE: {p.relative_to(folder)}\n{p.read_text()}" for p in notes)

body = {
    "model": "gemma4:e2b",
    "stream": False,
    "options": {"num_ctx": 16000},
    "messages": [
        {"role": "system", "content": "Answer only from the notes. Name the FILE for each point."},
        {"role": "user", "content": f"{context}\n\nQuestion: {question}"},
    ],
}
req = urllib.request.Request("http://localhost:11434/api/chat",
                             data=json.dumps(body).encode(),
                             headers={"Content-Type": "application/json"})
print(json.loads(urllib.request.urlopen(req).read())["message"]["content"])

Run it as python3 ask.py pricing "What did we decide about the annual plan?". The cap of eight files keeps the prompt inside the context you set. Naming the file in each answer lets you open the note and check.

Keyword search misses notes that use different words for the same idea. That is the problem embeddings solve.

When do you need embeddings?

When questions cross many notes and you cannot guess the right search word. An embedding model turns each note, or each section, into a list of numbers that places similar meanings close together. A tool stores those for every note, finds the closest ones to your question, and hands only those to the chat model. This is retrieval, often called RAG.

Ollama runs embedding models too. Its embeddings page uses embeddinggemma:

curl -X POST http://localhost:11434/api/embed \
  -H "Content-Type: application/json" \
  -d '{"model": "embeddinggemma", "input": "Annual plan pricing decision"}'

You rarely need to build the index yourself. Two ready options:

  • Open WebUI. It is built to run entirely offline and supports Ollama. Install with pip install open-webui, start it with open-webui serve and open http://localhost:8080. Under Workspace, Knowledge, a knowledge base can Sync directory, which mirrors a local folder and updates only new, changed and deleted files. In a chat, type # to attach it, as its Knowledge page describes.
  • A plugin inside your note app. If your notes are an Obsidian vault, plugins such as Smart Connections index the vault with a local embedding model. Using an Obsidian vault as an AI knowledge base covers those.

How should notes be written so a local model answers well?

Small local models are less forgiving than large hosted ones, so the notes carry more of the weight.

  • One topic per file with a title that says what it is. Retrieval picks whole notes or sections, and a note about three things pulls in two you did not ask about.
  • Headings every few paragraphs. They mark where one topic ends, for the model and for tools that split notes into sections.
  • Dates and names written out. "Next Tuesday" means nothing six months later. 2026-12-01 does.
  • Decisions stated plainly. "We chose the annual plan at $40 because..." retrieves and quotes well. A bulleted fragment does not.

Using Markdown notes as AI context has more on shaping notes for a model, including a project context file.

What are the limits?

  • Accuracy. Smaller models misread and invent more than large hosted ones. Ask for file names in every answer and check the ones that matter.
  • Retrieval misses. If the right note is not retrieved, the model answers from what it got, and the answer can still sound confident.
  • Speed and memory. Both depend on your hardware and the model size, so try two or three models before settling.
  • Stale indexes. An embedding index reflects the notes when it was built. Use a tool that re-syncs the folder, or rebuild after big edits.

Keeping the notes in Noteline

Noteline, which we make, has no AI features and runs no model. It is the editor for the folder that Ollama, your script or Open WebUI reads. Open the folder with File > Open Folder… (Cmd+O on a Mac, Ctrl+O on Windows and Linux) and every note is a plain .md file the local tools can read as is. Find in Folder (Cmd+Shift+F or Ctrl+Shift+F) is a quick way to see which notes a keyword will pull in before you ask. If a script saves an answer as a new note, the desktop app picks it up, and pasting a chat answer into an empty note turns it into clean Markdown.

Start with one note. Keep the file.

Open a folder and write. Every note is a plain .md file, with no account to create.

Try desktop free for 14 days ↓Free on iPhone, iPad and Android →

Desktop: 14-day trial, then $9.99 once. Mobile apps: free. No account.

Keep reading

  • Local Markdown files
  • How to keep AI meeting notes as Markdown files you own
  • AI memory files: what your assistant should remember, kept in Markdown
  • An AI research workflow in Markdown: sources, summaries and claims

A Markdown note editor with everything you need

We’re listening

Tell us what you need or what gets in your way. If something isn’t working, write to us any time.

contact@noteline.io→

Product

  • Download
  • Pricing
  • Features
  • Changelog

Learn

  • Markdown syntax
  • Use cases
  • Blog

Compare

  • vs Obsidian
  • vs Notion

Support

  • Help
  • Support
  • Privacy
  • Terms

© 2026 Notelinecontact@noteline.io