Module 2 · Lesson 4 of 6
Retrieval: answering from your own documents
Chunks, embeddings, search and citations in plain words, a brokerage policy-manual assistant, and when RAG beats fine-tuning.
9 min
Every brokerage has documents that agents ask about all day: the policy and procedures manual, the deposit-handling process, the advertising checklist, the onboarding guide, the CRM how-tos. A model hasn't read any of them. You could paste the whole manual into every question, but Module 1 showed why that is slow, costly and easy for the model to get lost in. Retrieval solves this: for each question, a search step finds the few passages that matter and hands only those to the model, which then answers with citations.
This pattern is called retrieval-augmented generation, or RAG. It is the most common way businesses build assistants that answer from their own documents, and you can understand every step without writing code.
- Key term
- Retrieval-augmented generation (RAG)
A setup where, before the model answers, a search step retrieves relevant passages from your documents and adds them to the prompt. The model answers from those passages and cites them.
Step 1: Split documents into chunks
A search can't usefully return a whole 80-page manual. So the documents are split into chunks: passages small enough to be specific and large enough to make sense on their own. For a policy manual, the natural chunk is usually one section or subsection.
Good chunking habits:
- Split on headings, not every 500 words, so a chunk doesn't start mid-rule.
- Keep labels with each chunk: document name, section number and title, effective date. These become the citations.
- Overlap a little when sections are long, so a rule that spans a page break isn't cut in half.
- Remove old versions before indexing, or tag each chunk with its version and effective date so the system can prefer the current one.
Step 2: Turn chunks into embeddings
- Key term
- Embedding
A list of numbers that represents the meaning of a piece of text, produced by an embedding model. Texts with similar meanings get similar numbers.
Picture a map where every chunk of your manual is a pin, placed by meaning rather than by words. "Deposits received after hours" and "handling trust money on weekends" land near each other even though they share few words. "Social media profile requirements" lands far away. That map is what an embedding gives you.
Embedding models are separate from chat models. OpenAI and Cohere both sell them, for example; Anthropic doesn't make one and points developers to Voyage AI in its documentation. The embeddings are saved in a vector index (a database built to find the nearest pins quickly). Many RAG systems also keep an ordinary keyword index alongside it, because exact terms such as form numbers or "FINTRAC" are better found by keyword.
Step 3: Search when a question arrives
When an agent asks a question, the question is turned into an embedding too, and the search finds the chunks whose pins sit closest to it. Often the system then reranks the top results with a second model that reads each candidate more carefully (Cohere's Rerank models are one example), and keeps the best three to eight chunks.
Step 4: Answer with citations
The selected chunks go into the prompt, labelled with their section numbers, and the model is told to answer only from them:
<excerpts>
[Section 4.2 Deposits, effective 2026-03-01] ...
[Section 4.3 Deposits received outside business hours, effective 2026-03-01] ...
[Section 9.1 Advertising review, effective 2025-11-15] ...
</excerpts>
Answer the agent's question using only the excerpts above.
Cite the section number for every statement, like (Section 4.3).
If the excerpts don't answer the question, say "The manual doesn't
cover this. Please ask the broker of record." Do not use outside
knowledge. If two excerpts conflict, quote both and say so.
Question: A buyer wants to drop off a deposit cheque on Saturday.
What do I do?
The citation is what makes RAG trustworthy at a brokerage: the agent can open Section 4.3 and read the rule in the manual's own words.
- 1. DataPolicy manual, current version only
- 2. ToolSplit into labelled chunks
- 3. ToolEmbed chunks into a vector index
- 4. TriggerAn agent asks a question
- 5. ToolSearch and rerank the closest chunks
- 6. AIAnswer only from the chunks, with citations
- 7. HumanAgent opens the cited section to confirm
Try it
Step through the pipeline below. It follows one agent's question ("Can I hold a buyer's deposit cheque in the office over the weekend?") from embedding, to search scores for each passage of a fictional manual, to the prompt the model receives and its cited answer.
Follow a question through retrieval
Try itStep through how a brokerage policy assistant answers from its own manual instead of from memory.
1. A question comes in
An agent asks the brokerage assistant a policy question in plain words.
Question
“Can I hold a buyer's deposit cheque in the office over the weekend?”
The policy manual and the similarity scores are fictional and for illustration.
Three things are worth noticing. First, the search matched "over the weekend" to a passage about deposits "received on a Friday after 3 p.m. or on a weekend", even though the wording differs; that is embeddings at work. Second, only the passages above the cut-off reached the model. The passages about office keys, listing photos and commission advances never did, so the model couldn't be distracted by them, but it also means the answer can only be as good as what the search returned. If the weekend-deposit passage had scored below the cut-off, the model would have had nothing to answer from. Most RAG problems are search problems, not model problems. Third, the answer cites passage ids, so the agent can trace every sentence back to the manual, which is exactly the habit Module 1's hallucination lesson asked for.
When RAG beats fine-tuning
- Key term
- Fine-tuning
Training an existing model further on your own examples so its behaviour changes, such as always writing in a particular format.
People often assume they need to "train a model on our documents". For a brokerage, that is rarely the right tool.
| Question | Retrieval (RAG) | Fine-tuning | Whole document in the prompt |
|---|---|---|---|
| What it changes | What the model reads for each question | The model's own behaviour, through extra training | What the model reads, all of it, every time |
| When content changes | Re-index the changed section | Train again | Paste the new version |
| Citations | Natural; each answer points to a section | Hard; the knowledge is blended into the model | Possible, if the model finds the passage |
| Set-up effort | Moderate | Highest, with ongoing retraining | Lowest |
| Cost per question | Low; only relevant chunks are sent | Low | High for long documents |
| Best for | Manuals, FAQs, document libraries | A fixed style or format at very high volume | One-off questions about one document |
Choose RAG when the content changes (policies, rates, procedures), when people need to see the source, and when you don't have a team to retrain models. Fine-tuning suits narrow, stable behaviour at large volume, and even then a good system prompt with examples (Lesson 2) often gets you most of the way.
Building one without code
You don't need to write code to try RAG:
- Many chat apps let you add files to a project and answer from them. As of October 2026, Claude's free plan includes up to five projects. For an internal manual, use a business plan with agreed data terms rather than a personal free account.
- Workflow tools covered in Module 4 offer document search steps that connect to model APIs.
- For a production assistant, a technology partner will choose an embedding model, a vector index and a chat model, and you will own the decisions about which documents go in, how they are labelled, and how answers are checked.
In practice
Lakeshore Homes Brokerage, a fictional 30-agent office, builds a policy-manual assistant for its agents. In the first week, testing shows a problem: asked about deposits received on weekends, the assistant sometimes describes a drop-box process the brokerage stopped using a year ago. The cause is the index, not the model. Both the 2025 and 2026 manuals were loaded, and the old section ranked higher for some phrasings.
The fix takes an afternoon: remove the 2025 manual, add effective dates to every chunk, and add an instruction to flag conflicting excerpts. The operations lead adds the weekend-deposit question to the brokerage's test set (Lesson 6) so the problem can't quietly return.
Common mistakes
- Indexing every version of a document and getting blended answers.
- Chunking by fixed word counts so rules are split mid-sentence.
- Dropping section numbers and dates, so answers can't be cited.
- Blaming the model when the search returned the wrong chunks.
- Training (fine-tuning) a model on content that changes every quarter.
Key takeaways
- RAG finds the relevant passages for each question and has the model answer only from them, with citations.
- Embeddings place text by meaning, so a question finds related passages even with different wording.
- Chunk by section, keep labels and effective dates, and index only current versions.
- Most RAG failures are search failures; test what the search returns, not just the final answer.
- For changing brokerage documents, RAG usually beats fine-tuning.
Finished reading? Move on when you're ready.