Home/Blog/Labs 02
What we learn in the labs · Part 02

RAG: answers grounded in your documents.

In the second workshop, each person builds a bot that answers from their own documents, cites which one it used, and admits when something is not there. No database to install. We ran the notebook end to end, and this is what happened.

Technical content supported byNVIDIA
AuthorCarlos Lara, Chief Product Officer
PublishedNovember 1, 2026
Reading time7 minutes
ModelsNemotron 3.5 Lightning and Nemotron 3 Embed 1B
Run10.31.2026, build.nvidia.com
Step 2

The model does not know your documents.

The question is about Café La Espiga, a coffee shop invented for the workshop. The model never read anything about it. Sometimes it makes up an answer with full confidence. This time it admitted it did not know and suggested checking Google Maps.

The model says it has no access to Café La Espiga's opening hours
Without documents, the model only knows what it saw in training.
Steps 3 and 4

Four documents, eleven chunks.

The corpus is four documents from the coffee shop: menu, payments and invoicing, FAQ, branches and hours. Each one is cut into chunks of up to 500 characters, without splitting paragraphs. Every chunk keeps the name of its document. That name is the citation.

11 chunks from 4 documents and a sample chunk from sucursales-horarios.md
Eleven chunks. Each one knows which document it came from.
Step 5

Search by meaning, not by words.

An embedding turns a sentence into a list of numbers, a vector. This model uses 2,048 numbers per sentence. Sentences that say the same thing land close together, even with different words.

"Can I bring my dog?" landed close to the sentence about pets, at 0.37. It landed far from the price of a latte, at 0.06, and from the Coyoacán hours, at 0.04. No sentence says "dog".

Cosine similarity: 0.37 with the pets sentence, 0.06 and 0.04 with the others
Cosine similarity measures closeness. Near 1 means the same thing. Near 0, unrelated.
What we learned

This model tells questions apart from documents. The question is embedded as query and the chunks as passage. The score ranks results; it is not an absolute grade.

Steps 6 and 7

Your vector database is a list.

The index keeps three things per chunk: its text, its source and its vector. It is computed once. Searching means comparing the question's vector against every chunk and keeping the three closest.

Index ready: 11 chunks from 4 documents, each with a 2048-number vector
For a few hundred chunks, a list in memory is enough.
Search for the Coyoacán question: three chunks from sucursales-horarios.md
All three chunks come from the right document. The first one starts with Roma, but it holds Roma and Coyoacán together.
Step 8

Answer with a citation.

The three chunks are placed in front of the model, each with its source. It is an open-book exam. The rules go in the system prompt: answer only from the context, cite in brackets and, if it is not there, say so.

The same question the model could not answer in step 2 now comes out right, with its citation.

Answer: the Coyoacán branch closes on Mondays. [sucursales-horarios.md]
"The Coyoacán branch closes on Mondays. [sucursales-horarios.md]"
Step 9

What is not there does not get invented.

"Do you sell pizza?" is in no document. The search still returns three chunks, with low scores: 0.19, 0.18 and 0.17. The model reads them and answers "I cannot find that in the documents."

Question Do you sell pizza?: low scores and the answer I cannot find that in the documents
It refused correctly. It still added a citation to menu-precios.md, because the rule tells it to always cite.
What we learned

No score threshold separates what is there from what is not. The model decides, by reading. And prompt rules are followed to the letter: ask it to always cite, and it cites even when it found nothing.

Step 10

Your own document.

You paste your own text or upload a .txt file. It joins the documents and the index is rebuilt. No other step changes. The example uses the description of this workshop series.

Index with 14 chunks from 5 documents and an answer about the program citing mi-documento
Fourteen chunks from five documents. The answer cites [mi-documento].
Step 11

Chat with your documents.

The chat combines the memory from part one with this part's search. On each turn it finds three chunks and answers from them. Both answers were right: Roma opens at 8:00 and Coyoacán is the one closed on Mondays.

Chat over the coffee shop documents with two questions and their cited answers
The first answer arrived twice, with stray code marks. That is the free tier: it sometimes garbles the output.
What we learned

The search only reads your last message. If you write "And on Sundays?", it does not know which branch you mean. Solving that properly means rewriting the question with the history, and that is already an agent's job.

In short

Four ideas to take with you.

  1. The model only knows what it saw in training. Your documents were not there.
  2. An embedding places texts that mean the same thing close together.
  3. Your vector database is a list of chunks with their vectors. Searching is comparing vectors.
  4. RAG: your code searches, the model writes from what it receives and cites the source.