For most businesses adding AI to an internal tool, retrieval-augmented generation (RAG) is the right place to start: the model answers from your own documents, which you can update at any time and filter by user permissions. Fine-tuning is useful in narrower cases, mainly to teach a model a consistent format, tone or classification, not to give it new facts. Start with plain prompting, add RAG when answers depend on your data, and consider fine-tuning or agents once you can measure what is missing.
The key terms in plain language
A large language model generates text, prompting tells it what to do, RAG feeds it your documents at question time, fine-tuning retrains it on examples, and an agent lets it take actions through tools.
Large language model (LLM)
An LLM is a model trained on very large amounts of text to predict likely continuations. In practice, it reads, summarizes, drafts, translates and extracts information well. It does not know your internal documents, and it can state wrong things with confidence, which is usually called a hallucination.
Prompting
Prompting means putting instructions and context directly in the request. It is often enough for tasks where you supply all the input: summarizing a call note, drafting a reply, pulling fields out of an invoice you paste in.
Retrieval-augmented generation (RAG)
RAG works in two steps. First, the system searches your documents for the passages most relevant to the question, usually with semantic search over “embeddings” (numerical representations of meaning), often combined with keyword search. Second, it sends those passages to the model with the question and instructions to answer only from them and to cite its sources. The model itself does not change; your knowledge lives in a search index you control.
Fine-tuning
Fine-tuning continues the training of an existing model on hundreds or thousands of example inputs and expected outputs. It changes how the model behaves: its format, its style, the way it classifies. It is a poor way to add facts that change, because every update means retraining, the model cannot cite where an answer came from, and it cannot apply per-user permissions.
Agents
An agent is an LLM that can call tools in a loop to finish a multi-step task: search documents, read a record in your CRM, create a ticket, draft an email. Agents can do more, and they can fail in more ways, so they need limited permissions, logs and human confirmation before any consequential action.
RAG, fine-tuning, prompting or an agent: which to choose
Choose based on what is missing: if the model lacks instructions, improve the prompt; if it lacks your knowledge, use RAG; if it lacks a consistent behavior that examples can teach, fine-tune; if it needs to act in other systems, build an agent.
| Approach | Use it when | Typical examples | Main limits |
|---|---|---|---|
| Prompting | The task needs only the input you provide plus clear instructions | Summarize a meeting note, draft a reply, extract fields from a pasted invoice | No access to company knowledge beyond what you paste in |
| RAG | Answers depend on your documents or data, and those change over time | Assistant over internal procedures, support answers from a knowledge base, questions about contracts | Only as good as your documents and your search; the index must be maintained |
| Fine-tuning | You need a consistent format, tone or narrow classification at volume, and you have many good examples | Sorting tickets into your 40 internal categories, writing reports in a strict house format | Data preparation effort; retraining for every change; does not reliably add facts |
| Agent | The task spans several steps and systems and requires actions, not only answers | Read an incoming request, look up the customer, draft a reply and open a ticket | Harder to test; needs permissions, guardrails and human approval for risky actions |
These approaches combine. An agent usually has RAG as one of its tools, and a fine-tuned model can sit behind a RAG pipeline. Most first projects need only good prompts and RAG.
Data privacy and GDPR
Treat an LLM provider like any other subprocessor: know where data is processed, what it is used for and who can see it, and send only what each task needs.
- Where data goes. Check the provider’s processing regions, retention periods and whether your data can be used to train their models. Many business API offerings exclude training on customer data by default, but confirm it in the contract and sign a data processing agreement, as GDPR requires for processors. If data cannot leave your infrastructure, self-hosted open-weight models are an option, with trade-offs in answer quality and operating effort.
- Data minimization. Do not send sensitive data blindly. Remove or pseudonymize what the task does not need, for example by replacing names and bank details with placeholders before classifying a document.
- Access control on retrieved documents. This is the main RAG-specific risk. If the index holds HR, finance and management documents, the system must filter results by the user’s permissions at search time, before the model sees anything. An instruction such as “do not reveal salaries” in the prompt is not access control.
- Logs. Questions and answers are data too. Decide what you log, who can read the logs and how long you keep them.
- Untrusted content. Documents and emails can contain text written to manipulate the model, known as prompt injection. This matters most for agents that can take actions, so limit what an agent may do without approval.
- Regulation. In the EU, also check how the AI Act applies to your use case. An internal documentation assistant is unlikely to be classed as high-risk, but transparency obligations, such as making clear that users are interacting with an AI system, can still apply.
Cost and latency trade-offs
Cost and response time grow with the size of the model and the amount of text you send it, so the main levers are using the smallest model that passes your tests and sending only the passages that matter.
- Usage is billed by volume. Hosted models typically charge per token (a fragment of a word) for both input and output. RAG adds retrieved passages to every request, so a 20-word question can become a prompt of several thousand tokens.
- Model size. Larger models handle complex reasoning better but are slower and cost more per request. Smaller models are often good enough for classification, extraction and routing.
- Retrieval. The search step adds time, usually far less than generating the answer. Retrieving too many passages costs more and can make answers worse.
- Agents multiply calls. One agent task can involve many model calls, each adding cost and seconds.
- Fine-tuning. It has an upfront cost (preparing examples, training runs, evaluation) and may require hosting a dedicated model. It can lower the cost per request if it lets you use a smaller model or shorter prompts.
Practical levers include caching answers to frequent questions, streaming responses so users start reading immediately, routing simple requests to smaller models and capping the number of retrieved passages. Track the cost per answered question, not only the monthly bill.
How to evaluate an AI feature
Build a test set of real questions with expected answers before you build the feature, run it on every change, and combine it with regular human review of real conversations.
- Collect 50 to 200 real questions from the future users: support tickets, internal emails, chat history. Include questions the documents cannot answer.
- Write the expected answer and its source for each one, with help from a domain expert.
- Measure search separately. Did the right document appear in the top results? Many bad RAG answers are search failures, not model failures.
- Grade the answers as correct, partly correct, wrong or correctly declined. Check that the cited sources actually support the answer.
- Automate, then spot-check. A model can grade answers against the expected ones at scale, but review a sample by hand to make sure the grading is reliable.
- Re-run the test set on every change: a new model version, a new prompt, new documents, new search settings.
- Keep humans in the loop after launch: feedback buttons, a weekly review of sampled conversations by a domain expert, and a list of unanswered questions that shows which documents are missing.
Agree on a threshold before the pilot, for example a target share of correct answers on the test set and zero invented answers on questions the documents do not cover.
A realistic first project: an assistant over internal documentation
A good first AI project is an assistant that answers employees’ questions from a limited set of internal documents, cites its sources and says when it does not know.
It is a sensible start for three reasons. The risk is contained: users are internal, the assistant only reads, and people can check the sources. The value is measurable: time spent searching, questions sent to experts, time to onboard new staff. And the foundation is reusable: the document pipeline, permission filtering and test set serve later features. Typical corpora include HR policies, quality procedures, product documentation for support teams and technical manuals. The assistant works best inside a tool people already use, such as a back-office or an intranet, rather than as one more application. The AI integration page describes the kinds of assistants and automations this can lead to.
Rollout steps
- Pick one team and one corpus, for example the support team and its product documentation.
- Clean the corpus. Remove outdated versions and duplicates, and name an owner for each document set. This is often the largest part of the work.
- Build the test set described above, before writing code.
- Build a prototype with document ingestion, permission-aware search, cited answers and a clear “I don’t know” behavior.
- Run a pilot with 5 to 10 users for two to four weeks, with a feedback button on every answer.
- Fix what the data shows: missing documents, long documents split badly, unclear instructions.
- Roll out to the whole team, then add a second corpus or a first action, such as opening a ticket when the assistant cannot answer. That is the first step toward an agent.
Scope it like any other software project, with clear users, flows and success metrics; the guide on how to scope a software project applies here too. If the assistant will live inside an internal tool, see custom web applications.
Start with retrieval, measure, then decide
Start with good prompts and RAG on one well-defined set of documents, measure with a test set, and move to fine-tuning or agents only when the results show a gap they would close.
Most of the effort in a useful AI feature goes into the parts that are not the model: clean documents, correct permissions, a test set and a feedback loop. Get those right on a small scope, and the choice between RAG, fine-tuning and agents becomes a decision based on evidence rather than on trends.