AI products

Search your own documents before you think about fine-tuning

Why retrieval beats fine-tuning for most business AI features, how it works in plain words, where it fails and when fine-tuning is right.

How retrieval works

The usual name is RAG, short for retrieval-augmented generation. The steps are simple.

  1. Split each document into chunks of a few paragraphs.
  2. Turn each chunk into an embedding, a list of numbers that stands for its meaning, and store it in a database that can search by similarity.
  3. When a user asks a question, turn the question into an embedding too and fetch the closest chunks. Run a keyword search alongside, because embeddings are weak on exact terms such as part numbers and surnames.
  4. Put those chunks into the prompt with the question. Tell the model to answer only from them and to say so when they do not hold the answer.
  5. Show the answer with links to the chunks it used.

The model never learns your documents. It reads a few of them fresh on every question.

Why it beats fine-tuning for most features

Fine-tuning changes how a model behaves. It is a poor way to store facts. A fine-tuned model can still state a wrong figure with full confidence, and you have no passage to check it against.

Retrieval Fine-tuning
Updating knowledge Edit the document and re-index it Build new training data and train again
Sources Each answer links to its passage The model cannot point to where a fact came from
Work before launch An indexing pipeline and a prompt A training set of good examples, then training and evaluation
Access control Filter the search by what this user may see Whatever the model learned, every user can get out of it
Good at Facts that live in documents Tone, format and narrow classification

The access control row can decide a project by itself. If sales staff must not see HR files, retrieval handles that with a filter on the search. A fine-tuned model has no such filter.

Where retrieval fails

Bad chunking

Splitting a document every fixed number of characters cuts tables in half and separates a heading from the paragraph under it. Split along the document's own structure and keep the title and section name attached to every chunk. Before you tune anything else, run twenty real questions and read the chunks that come back. If you would not be able to answer from them, neither can the model.

Stale and duplicate documents

If the shared drive holds three versions of the leave policy, search returns whichever one matches the wording of the question. The fix is dull. Give each document an owner, move old versions out of the index and show the document's date next to every answer.

Questions that need totals

"How many of our contracts renew next quarter?" Retrieval fetches a handful of chunks. It cannot count across every contract you hold. That question needs structured data. Extract the renewal date from each contract into a table once, then answer with a database query. A project sold as AI over documents can turn out to be half a database project, and it is cheaper to learn that at the start.

The rare cases for fine-tuning

Fine-tuning earns its cost in a few situations.

  • You need one fixed output style or format, and a prompt with examples cannot hold it steady.
  • You run a narrow task at high volume, such as sorting support tickets into your own categories. A small fine-tuned model can be cheaper and faster per call than a large general one.
  • You already own a large set of good input and output pairs. Without that, you will spend the budget building the training set.

Even then, try a careful prompt with a few examples first. And fine-tuning does not replace retrieval. A model tuned for your tone still needs the facts handed to it.

Run a manual test before you build anything

You can find out whether retrieval will work on your material without writing code.

  1. Collect twenty questions your staff or customers have asked.
  2. For each one, find by hand the passages that answer it.
  3. Paste the passages and the question into a chat model and read the answer.

If the answers are good, the model can do the job and the remaining work is search. That is worth building. If the answers are bad even with hand-picked passages, your documents do not contain the answers, and no technique fixes that.

Two cases where you should build less than a full pipeline. If the whole document set is small enough to fit in the model's context window, skip the search and put all of it in the prompt. And if only your own team will use the tool, an off-the-shelf assistant with file upload may be enough. A custom build pays off when the feature sits inside your product, has to respect who may see what, or has to cover more material than any one prompt can hold. That is the kind of work we take on under AI products.

Bottom line: Use retrieval for facts and keep fine-tuning for behaviour. Test with twenty hand-answered questions before you pay for either.

Keep those twenty questions. They are the start of the test set you will run each time you change the chunking, the prompt or the model. If the results puzzle you, send them to us.

RAGFine-tuningAI products

Related service

AI products. We build AI agents, search over your own documents and copilots inside the product you already run. Each one ships with LLM evals that run on every change, so you learn that answer quality has dropped before your customers do.

See the service→