๐ฌWhat we learn today โ a short video
โก By the end of the session you will know
- RAG = retrieving relevant passages โ the AI answers from them with sources.
- Knowledge files for a few fixed documents; a full RAG for scope and updates.
- Embeddings = meaning as numbers; the same model for storing and querying.
- Ingestion: Drive โ chunks โ embeddings โ upsert with an ID and metadata.
- We built a knowledge bot that cites sources, and connected it to Noa.
A silent video of about half a minute: the session topic, the learning goals (also listed in the next section) and the scenario we build today.
๐The story of Etz va'Or (Wood & Light) โ Chapter 11: Noa learns the policies
Customers ask about warranty, types of wood and oil, delivery times. The answers are in 30 documents in Drive. We'll teach Noa to search them (RAG) and answer with the source cited โ without making things up.
๐งต One story across the whole course: every session solves a real problem for the business. At the end โ a complete system.
๐ฏSession goals
- Explain what RAG is and why it reduces hallucinations.
- Tell an agent's knowledge files apart from a full RAG โ and when to use each.
- Understand embeddings and semantic similarity (cosine similarity).
- Split documents into chunks with overlap and keep metadata.
- Build an ingestion scenario from Google Drive into a vector store.
- Build a query scenario: a question โ retrieval โ an answer with sources.
- Connect the store as a tool for the agent and update it when documents change.
๐๏ธSession agenda (3 hours)
- 00:00โ00:15 Review: Noa
- 00:15โ00:40 What RAG is and why
- 00:40โ01:05 Embeddings and vector stores
- 01:05โ01:20 โ Break
- 01:20โ01:50 Ingestion: Drive โ chunks โ vectors
- 01:50โ02:15 Query + citing sources
- 02:15โ02:50 Building together: an organizational knowledge bot
- 02:50โ03:00 Summary and practice
1What is RAG?
RAG (Retrieval-Augmented Generation) = before the AI answers, you retrieve the relevant document passages and put them into the prompt. The model answers from the text it received, and not from its general memory.
โ Without RAG- The model answers with general information from the internet
- Makes up "plausible" procedures
- Doesn't know what changed yesterday
- No source to check
โ
With RAG- Answers from your documents
- "I didn't find it" when there is no information
- Updates when you update a document
- Every answer cites a source
2An agent's knowledge or a full RAG?
| Knowledge files (Make AI Agent) | A full RAG (vector store) |
|---|
| Setup | Uploading files to the agent โ minutes | An ingestion scenario + a store โ hours |
| Scope | Fixed, few documents (a policy, a glossary) | Hundreds to thousands of documents |
| Updating | Re-upload manually | Automatic when a file changes in Drive |
| Control | Make manages the search | You control the chunks, metadata, filtering, permissions |
| Sources | Depends on the display | Full metadata for every passage |
| When | An agent with a few fixed documents | Large, changing organizational knowledge, permissions by department |
๐ก Start simpleDo you have 5 fixed documents? Knowledge files and you're done. Build a full RAG when there are many documents, they change, or you need to filter by department/client.
3Embeddings โ meaning as numbers
An embedding is a vector โ a list of hundreds or thousands of numbers โ that represents the meaning of a text. Texts with similar meaning get close vectors, even if the words are different.
"Product return policy" โ [0.021, -0.113, 0.087, โฆ] โ
"How do I return a product?" โ [0.019, -0.108, 0.091, โฆ] โ close (0.89)
"Branch opening hours" โ [-0.140, 0.052, -0.033, โฆ] far (0.21)
| Concept | Explanation |
|---|
| Dimensions | The number of numbers in the vector (for example 1536). Must match the store |
| Cosine similarity | A 0โ1 similarity measure between vectors |
| Top K | How many of the most similar passages to retrieve (usually 3โ6) |
| Metadata | Information about the passage: file, page, department, date โ for filtering and citing |
โ ๏ธ Always the same embeddings modelVectors from different models aren't comparable. If you changed the model โ you need to rebuild the store.
4Ingestion โ putting documents into the store
| Decision | Recommendation |
|---|
| Chunk size | 500โ1,000 characters (or by paragraphs/headings) |
| Overlap | 10โ20% โ so a sentence isn't cut in the middle |
| ID | Fixed: fileId + chunk number โ so an update overwrites and doesn't duplicate |
| Metadata | source, page/section, department, updatedAt, url |
| The original text | Also keep the text in the metadata โ so you can put it in the prompt |
โน๏ธ Chunking in MakeThere isn't a dedicated chunking module on every plan: you can use Make Code (a short JS snippet), a Repeater + substring, or split by split(text; "\n\n") and merge small paragraphs. In the solution we show all three ways.
5Query โ retrieval and an answer with sources
Answer the question only according to the passages below.
If the answer isn't in the passages โ write "I didn't find information about this in the documents" and don't guess.
At the end of the answer write "Sources:" and the names of the files you used.
Passages:
{{context}}
Question: {{1.q}}
๐ก A similarity thresholdFilter out passages with a low score (for example < 0.75). If nothing is left โ answer "I didn't find it" without calling the LLM at all. That also saves Credits.
6RAG as a tool for the agent
The most elegant way: the query scenario becomes a tool of the agent (search_knowledge(question, department)). The agent decides when to search, and can combine it with other tools (get_order + the returns procedure).
| Topic | Solution |
|---|
| Permissions | department in the metadata + a filter in the query by the user |
| A document was deleted | Drive Watch (deleted) โ delete by ID prefix |
| A document was updated | The same IDs โ upsert overwrites; if there are fewer chunks โ delete the extras |
| Quality | Fixed test questions with an expected answer; check after every change |
๐งชLab: simulations and examples
Three ways to see today's material in action: the scenario canvas runs the session's scenario like Make does (with a Credits count), the race compares manual work with automation, and the function playground shows real mapping examples.
๐ก Why in this order?You can't embed before chunking, and you can't store a vector that doesn't exist yet.
๐ขA real-world case study
"Blue Sea Hotel" โ 120 employees in shifts. New employees asked the same questions about procedures (late check-out, a lost key, allergens) and the managers answered again and again. A knowledge bot on Telegram with RAG over 40 procedure documents, with metadata by department (reception, housekeeping, kitchen). Every answer names the procedure. Result: about 300 questions a month were answered without a manager, and the onboarding time of a new employee got shorter. When a procedure is updated in Drive โ the bot knows within an hour.
โFrequently asked questions
Pinecone or Supabase pgvector?
Pinecone โ the fastest to start with an app in Make. Supabase โ if you already have Postgres (session 8) and want everything in one place.
How much does it cost?
Embeddings are very cheap. Most of the cost is in the answer's LLM and in Make Credits for every chunk in ingestion (the Iterator!).
Scanned documents?
You need OCR first (Google Drive converts a scanned PDF to Docs, or an OCR service / an AI model that reads images).
Does Hebrew/other languages work?
Yes, modern embeddings models support many languages. Test with real questions.
โ๏ธQuick understanding check
โก๏ธWhat now?
You finished the lecture! Go to the practice page โ multiple-choice questions and tasks that build An organizational knowledge bot: Drive โ chunks โ embeddings โ vector store โ an agent that cites sources. Stuck? The help guide breaks every task into steps. Only after you have tried, peek at the full solution.