Session 11 / 15๐Ÿ”Žืขื‘

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

  1. Explain what RAG is and why it reduces hallucinations.
  2. Tell an agent's knowledge files apart from a full RAG โ€” and when to use each.
  3. Understand embeddings and semantic similarity (cosine similarity).
  4. Split documents into chunks with overlap and keep metadata.
  5. Build an ingestion scenario from Google Drive into a vector store.
  6. Build a query scenario: a question โ†’ retrieval โ†’ an answer with sources.
  7. Connect the store as a tool for the agent and update it when documents change.

Session agenda (3 hours)

  1. 00:00โ€“00:15 Review: Noa
  2. 00:15โ€“00:40 What RAG is and why
  3. 00:40โ€“01:05 Embeddings and vector stores
  4. 01:05โ€“01:20 โ˜• Break
  5. 01:20โ€“01:50 Ingestion: Drive โ†’ chunks โ†’ vectors
  6. 01:50โ€“02:15 Query + citing sources
  7. 02:15โ€“02:50 Building together: an organizational knowledge bot
  8. 02:50โ€“03:00 Summary and practice

What to prepare for this session

A Drive folder with documents

5โ€“10 procedure / FAQ / price-list documents.

Pinecone (free)

https://www.pinecone.io (opens in a new window)
A managed vector store with an app in Make. (Or Supabase pgvector.)

An embeddings provider

https://platform.openai.com (opens in a new window)
OpenAI โ†’ Create embeddings, or another provider.

The agent from session 10

We will connect the knowledge base to it.

What 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

An agent's knowledge or a full RAG?

Knowledge files (Make AI Agent)A full RAG (vector store)
SetupUploading files to the agent โ€” minutesAn ingestion scenario + a store โ€” hours
ScopeFixed, few documents (a policy, a glossary)Hundreds to thousands of documents
UpdatingRe-upload manuallyAutomatic when a file changes in Drive
ControlMake manages the searchYou control the chunks, metadata, filtering, permissions
SourcesDepends on the displayFull metadata for every passage
WhenAn agent with a few fixed documentsLarge, 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.

Embeddings โ€” 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)
ConceptExplanation
DimensionsThe number of numbers in the vector (for example 1536). Must match the store
Cosine similarityA 0โ€“1 similarity measure between vectors
Top KHow many of the most similar passages to retrieve (usually 3โ€“6)
MetadataInformation 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.

Ingestion โ€” putting documents into the store

DecisionRecommendation
Chunk size500โ€“1,000 characters (or by paragraphs/headings)
Overlap10โ€“20% โ€” so a sentence isn't cut in the middle
IDFixed: fileId + chunk number โ€” so an update overwrites and doesn't duplicate
Metadatasource, page/section, department, updatedAt, url
The original textAlso 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.

Query โ€” 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.

RAG 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).

TopicSolution
Permissionsdepartment in the metadata + a filter in the query by the user
A document was deletedDrive Watch (deleted) โ†’ delete by ID prefix
A document was updatedThe same IDs โ†’ upsert overwrites; if there are fewer chunks โ€” delete the extras
QualityFixed 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.