Labeled SetGet the app
Menu

Concept · filed under Prompts and chat apps

Prompt engineering vs RAG vs fine-tuning

Prompt engineering changes what you send the model. RAG (retrieval-augmented generation) fetches your own data at question time and adds it to the prompt. Fine-tuning trains the model further so its weights change. An AI-901 scenario tells you which part of the system needs to change, and only one of the three touches the model itself.

  • ExamAI-901 (replaced AI-900 on June 30, 2026)
  • Questions here6
  • UpdatedOct 19, 2026

Rule of thumb

Ask what is wrong with the answers. The shape, tone or rules: work on the prompt. The facts about your own content, or how current they are: add retrieval. A pattern you need at large volume that a prompt can only hold by repeating it every time: that is when fine-tuning enters the conversation.

Table 1

What each one changes

Three ways to get better answers, compared on what they touch
PointPrompt engineeringRAGFine-tuning
What changesThe input: system message, instructions, examplesThe input, filled at question time with passages from your dataThe model’s weights
What you needText, and a few tries in a playgroundAn index of your content, for example in Azure AI SearchTraining examples and a training run
Fresh factsOnly what you paste inAs fresh as the indexNo; what training adds ages like the rest
Good forTone, length, format, rulesAnswers about your documents, with sourcesA consistent style or narrow task at scale
To change it laterEdit and rerunUpdate the indexPrepare data and train again
Model retrained?NoNoYes

Fig. 1

RAG, step by step

IndexcontentSearch indexUser asksRetrievepassagesAdd topromptModelanswersNext question
Fig. 1 Indexing happens ahead of time. At question time the app retrieves, adds the passages to the prompt, and only then calls the model.

Three cases, three fixes

A recipe assistant keeps giving oven temperatures in Celsius to cooks in Ohio. Nothing is wrong with the model; nobody told it. One line in the system message fixes it. That is why prompt engineering comes first: it is the cheapest change and the quickest to undo.

A hardware chain wants its assistant to say which aisle the hinges are in at a given store and whether any are left. The model cannot know that, and the stock moves by the hour. Retrieval fits: index the store data, fetch the matching entries for each question, and let the model phrase the answer from them. Microsoft’s Learn module Introduction to retrieval-augmented generation concepts calls the result a grounded response (as of October 2026).

A logistics firm turns free-text driver notes into its own shorthand codes millions of times a day. A long prompt full of examples works, but it sends those examples with every single call, and each one is billed in tokens (tokens, embeddings and transformers explains the meter). Training a model on the examples builds the pattern in so the prompt can shrink. The price is a training run and a model you now have to maintain.

Agents combine these. An agent’s instructions are prompt engineering, and a knowledge tool that searches your content is retrieval; Microsoft’s module Get started with Microsoft Foundry IQ covers that agent route to grounded, cited answers. The agent side is on AI agents vs chatbots.

Before you pick an answer

  • Is the problem the form of the answer, or its facts?
  • Are the facts somewhere public the model could have learned, or only in your own content?
  • Do those facts change after the model was trained?
  • Has the prompt really been tried, with instructions and examples?
  • Does the option change the weights? Then it is fine-tuning, whatever it is called.

Worksheet

Prompt, retrieve or train

Each scenario has one change that fits better than the rest. Evaluate a batch to read why the other options fall short.

Questions come in batches of five. Pick an answer for each, then evaluate the batch: notes on all four options open under every question.

Accuracy by batch

0 evaluated · 0 right · 6 to go

Batch 1 questions 1–5

  1. 01

    Before indexing a set of 300-page product manuals for a RAG assistant, a team splits each manual into short passages. Why?

    Your label —The notes on all four options open when this batch is evaluated.

  2. 02

    An insurer's assistant must answer from policy documents that change every day. Which approach keeps answers current with the least effort?

    Your label —The notes on all four options open when this batch is evaluated.

  3. 03

    A company wants thousands of support replies to follow its exact house format and tone. Detailed instructions and examples in the prompt still give inconsistent results, and it has a large set of approved past replies. What should it consider next?

    Your label —The notes on all four options open when this batch is evaluated.

  4. 04

    A team's new chat assistant gives answers that are too long and too formal. Which option should it try first?

    Your label —The notes on all four options open when this batch is evaluated.

  5. 05

    In a RAG solution on Azure, what is Azure AI Search mainly responsible for?

    Your label —The notes on all four options open when this batch is evaluated.

0 of 5 labeled

Batch 2 question 6

  1. 06

    Which statement about retrieval-augmented generation (RAG) is accurate?

    Your label —The notes on all four options open when this batch is evaluated.

0 of 1 labeled

Also asked

Where does grounding end and RAG begin?

Grounding is the goal: answers based on data you supply. RAG is the usual way to get there, by retrieving that data for each question. Pasting a document into the prompt by hand also grounds the answer, just without the retrieval step.

Does few-shot prompting train the model?

No. Examples inside the prompt shape that one request and the weights stay as they were. It is still prompt engineering.

Why keep your data in a search index instead of in the model?

Because an index changes the moment your content does and you can see exactly what it holds, while facts baked into weights can be neither updated quickly nor inspected. The parent topic, prompts and chat apps, shows where the retrieved text lands in the prompt.