Home / Workflows & MCP / Does knowledge base search need vectors? Start with full-text, don't rush to embeddings
Does knowledge base search need vectors? Start with full-text, don't rush to embeddings
From a dozen notes to a few thousand, full-text search is enough. A real knowledge base MCP setup, and when to switch to vector search.
When you hook a model up to your own note collection, the first instinct is usually "bring in a vector database." That was my thinking too, and then I dropped it: below ten thousand notes, full-text search is far better value.
The real advantages of full-text search
- Zero dependencies: no embedding service to run, no vector index to maintain, no model version changes to track.
- Literal precision: search for a proper noun like "finalmask" and full-text search will always hit it; vector search may hand you a pile of "semantically similar" passages that are simply wrong.
- Explainable: the reason for a hit is those exact words. When it goes wrong, you know what to fix.
The cost: search for "how do I fix a NIC that won't saturate," and if the note actually says "e1000 has no RSS," full-text search may miss it. Synonymous phrasing is its weak spot.
What I actually do
One MCP server, two or three tools, all built around full-text search:
{
"tools": [
{ "name": "search_notes", "description": "Search note titles and bodies by keyword" },
{ "name": "read_note", "description": "Read the full text of the specified note" },
{ "name": "list_tree", "description": "List the directory structure" }
]
}
search_notes does three things:
- Scans every
.md, skipping designated directories (a clippings library, for instance) - Weighs title, path and body separately, with title hits weighted highest
- Returns the top N results with matched snippets and line numbers
Returning line numbers matters — with a line number the model can read_note just that passage instead of pulling the whole note into context.
Choosing Server over the high-level wrapper
When using the SDK, the low-level Server class gives you more control than the high-level McpServer: tool descriptions, return shapes, error messages are all yours to define. The high-level wrapper stuffs return values into a fixed format, which actually costs the model more tokens to read.
The price is writing the schema and handlers yourself. For a knowledge base search service that's about two hundred lines, written once and never touched again.
When to switch to vectors
Three signals — consider it once any two show up:
- Note count past ten thousand, and keyword search often fails to find notes you know exist
- Users' questions lean heavily on synonyms ("stuttering" vs. "frame drops")
- You need cross-language search (Chinese query, English notes)
Even then, the cheaper approach is usually hybrid: full-text search recalls first, vectors only rerank. Pure vector search's miss rate on proper nouns is worse than many people expect.
One implementation detail
The easiest trap in full-text search is encoding and case: Chinese notes mixed with English terms, where Finalmask / finalmask / FINALMASK should be equivalent. Lowercase everything, normalize Unicode — skip those two lines and recall drops for no apparent reason.
Another detail: excluded directories must be configurable. My clippings library holds five hundred-plus external articles; the moment they go into the index, every query drowns in them.
Index quality matters more than the model
Same model, poor retrieval, and the answer "looks right but cites the wrong passage." Three things that help:
- Chunks carry their heading: prepend the section name to each chunk so the model knows the context once it hits.
- Keep the source path: return the file and section with each result so a human can check it.
- Cap the number of results: 3–5 is enough; more dilutes attention.
In one sentence
The bottleneck of a knowledge base MCP is the index, not the model. Get recall right and an ordinary model answers like an expert.
One more detail: include an "updated at" in the results. Knowledge bases change, and a model citing an outdated passage without knowing it is the most insidious failure mode of this kind of tool.