Skip to content
FeaturesPricingBlogDownload

← All posts

RAG vs plain Markdown files: when a folder is enough

A folder of Markdown files is enough when notes fit in context or an assistant can search them. RAG pays off for huge collections, many users or mixed wording.

Diagram card on a light background showing a retrieval pipeline compared with a folder of Markdown files read directly

The choice between RAG and plain files comes down to size and who is asking. A folder of Markdown files is enough when everything relevant fits comfortably in the model's context, or when the assistant can search the folder itself with file names and text search, as coding agents do. Retrieval-augmented generation (RAG), with chunks, embeddings and a vector index, pays off when the collection is far larger than any context window, when many people query it through one interface, or when the words people search with rarely match the words in the documents.

Most personal and small-team knowledge bases sit on the files side of that line. This post explains the three approaches, how to estimate which one your folder needs, and what RAG costs once you build it.

What is RAG, and what is the alternative?

RAG is a pipeline that runs before the model answers. Documents are split into chunks, each chunk is turned into an embedding (a list of numbers that represents its meaning), and the embeddings are stored in an index. When a question comes in, the system finds the chunks whose embeddings are closest to the question's and puts only those in front of the model.

There are two alternatives that use files directly:

Approach How the model gets the text Setup
Load the files The relevant files, or all of them, go into the request None
Agentic search The assistant lists folders, searches text, then reads the files it picked An agent with file access
RAG A retriever picks chunks by similarity; the model sees only those Chunking, embeddings, an index, re-indexing on change

Agentic search is the approach most people overlook. Anthropic's article on how Claude Code works in large codebases (May 2026) describes it: Claude Code "traverses the file system, reads files, uses grep to find exactly what it needs," and "there's no embedding pipeline or centralized index to maintain." The same method works on a folder of notes.

How do you tell if your notes fit in context?

Estimate tokens from words. OpenAI's token guide gives the rule of thumb that 100 tokens are about 75 words of English, so a token count is roughly the word count times 1.33. On macOS or Linux:

cat notes/**/*.md | wc -w

(In bash, run shopt -s globstar first so ** matches subfolders; zsh does this by default.)

Then compare with the model you use. Anthropic's context window documentation lists windows of up to 1M tokens depending on the model, and other models have smaller ones. The same page warns that "more context isn't automatically better": as the token count grows, "accuracy and recall degrade, a phenomenon known as context rot."

A practical reading of those two facts, as our rule of thumb rather than a benchmark:

Folder size Roughly What tends to work
Up to about 30,000 words 40,000 tokens Load the relevant files, or all of them
30,000 to 500,000 words 40,000 to 670,000 tokens Agentic search, or an index file plus selective loading
Well past 500,000 words Millions of tokens Agentic search for an agent; RAG for a shared Q&A tool

The boundaries are not sharp. A folder of 100,000 words could be loaded whole into a large-window model, but an assistant that reads the six relevant notes will usually answer more precisely than one holding all 300.

When is a folder of files enough?

When at least one of these is true:

  • The material fits. Everything relevant to a question can go in one request with room to spare.
  • One person or a small team asks the questions. They can point the assistant at the right folder, and they know the vocabulary of their own notes.
  • The assistant can search. Claude Code and other coding agents can grep the folder. A chat app connected through a filesystem server can list folders, read an index file and open notes on demand.
  • The notes change often. Files are always current. An index has to be rebuilt after every edit.
  • You need to see why an answer came out wrong. With files, you can read what the assistant read. With RAG, a missed chunk is invisible.

When does RAG pay off?

When the folder approach runs out of room or out of reach:

  • The corpus is huge. Thousands of documents, or several million tokens, where even listing and grepping is slow and noisy.
  • Many people ask through one interface. A support assistant answering customers cannot run an agent per question and wait while it browses.
  • Wording does not match. A customer asks about "getting my money back" and the policy says "refund." Embeddings match on meaning; grep matches on letters.
  • Answers must be fast and cheap per query. Retrieving five chunks costs less than an agent reading twenty files.

Products already make this switch for you. Claude's RAG for projects article says that on paid plans, RAG "automatically activates when your project approaches or exceeds the context window limits," expanding capacity by up to ten times, and that Claude can convert back to loading everything when the content shrinks. That is the same rule as above, applied automatically: load while it fits, retrieve when it does not.

What does RAG cost once you build it?

More than the first demo suggests. The ongoing costs are where the trade-off sits.

  • Chunking loses context. A chunk that says "this does not apply to annual plans" has lost the heading that said what "this" is.
  • Every edit means re-indexing. A pipeline has to notice changed files and re-embed them, or the index answers from old text.
  • Misses are silent. If the right chunk is not retrieved, the model answers from whatever was, and nothing tells you a better passage existed.
  • More moving parts. An embedding model, a vector store, a sync job and their settings, each of which can drift.

None of these is a reason to avoid RAG when you need it. They are reasons not to build it before you do.

Do the files still matter if you use RAG?

Yes. The index is built from documents, and a clean folder of Markdown makes a better index. Headings give chunkers natural split points, one topic per file keeps chunks coherent, and a summary line at the top of each file gives retrieval a strong match. When the index goes wrong, you rebuild it from the folder.

So the work is the same either way: short files, one topic each, clear headings, dates on facts that change. How to build an AI knowledge base from Markdown files covers that structure, and context engineering with plain files covers deciding what a model should see. If you start with files and an assistant that can search them, adding retrieval later changes how text is picked, not where it lives.

Keeping the source folder in Noteline

Noteline, which we make, is an editor for that source folder. It opens a folder of .md files (Cmd+O on a Mac, Ctrl+O on Windows and Linux), shows its subfolders in the sidebar, and searches every file with Find in Folder (Cmd+Shift+F or Ctrl+Shift+F). It has no embeddings, no index and no AI features; the files stay plain Markdown that an agent, an upload or a RAG pipeline can read. When a script or an agent changes a note you have open, the desktop app asks whether to use the disk version or keep yours.

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

  • 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