The bottom line (TL;DR)
- 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.
The key points โ in depth
1. RAG
Retrieval + generation; fewer hallucinations; sources.
2. Knowledge vs. RAG
Simplicity vs. scope and control.
3. Embeddings
Vectors, cosine, top K, dimensions.
4. Ingestion
Chunks with overlap, a fixed ID, metadata, Credits.
5. Query
A similarity threshold, context with sources, "I didn't find it".
6. RAG as a tool
Scenario inputs/outputs; permissions; updates.
Concept cards (click or press Enter to flip)
RAG
Retrieving relevant knowledge before an AI answer.
Embedding
A vector that represents a text's meaning.
Vector store
A store that searches by vector similarity.
Chunk
A passage of a document stored separately.
Overlap
Overlap between chunks.
Top K
The number of similar passages retrieved.
Metadata
Information attached to a passage: source, department.
Cosine similarity
A similarity measure between vectors.
Spaced repetition โ the session concepts
Mark "I knew it" or "Not yet" โ the cards you did not know come back more often. Cards from all the sessions are in the arcade.
Quick cheat sheet
| What | Details |
|---|---|
| Google Drive โ Watch files / Search files | The document source |
substring(text; (i-1)*700; (i-1)*700+800) | A chunk with overlap |
| OpenAI โ Create embeddings | A vector |
| Pinecone โ Upsert vectors | Storing |
| Pinecone โ Query (topK, filter) | Retrieval |
ID = {{fileId}}-{{i}} | Updating without duplicates |
| score โฅ 0.75 | A threshold |
| "Answer only from the passagesโฆ otherwise: I didn't find it" | The prompt |
Common mistakes to avoid
- A different embeddings model for storing and querying.
- Random IDs โ duplicates on every run.
- No metadata โ no sources.
- Ingesting the whole folder on every run โ Credits.
- Permissions only in the instructions to the LLM.
Self-review questions
- What's the difference between knowledge files and RAG?
- Why overlap?
- What happens when no passage is above the threshold?
- How do you update a document that changed?
- How do you enforce permissions?
Homework and preparing for the next session
- A working knowledge bot with 15 test questions.
- Preparing for session 12: make sure the Telegram bot works, and download WhatsApp Business (optional).