Skip to main content

Learn RAG

Learn RAG is Scrimba's Pro course on Retrieval-Augmented Generation: fetching text from your data and feeding it to a language model before it answers. Guil Hernandez teaches it in about 94 minutes and 22 scrims, from embeddings to a movie-recommendation chatbot on Supabase, the fastest route to retrieval if you already call the OpenAI API from JavaScript.

Reviewed inside the course with a Pro account, September 2026: every scrim's transcript read and its code opened.

This page is part of our Scrimba AI courses catalog. Scrimba lists it under the AI Engineer Path.

Quick answer​

Take it if you already call the OpenAI chat API from JavaScript: it is the most direct route to the retrieval half of that job. The course is Pro-only, in one flat list, with three AI-checked challenges and a Pro solo project called PopChoice at the end. If you have never sent a chat completion from code, start with Intro to AI Engineering.

The course has no chapter title cards; every scrim opens straight into a slide or the editor. The two slides below are the closest thing to course artwork.

Learn RAG, What are embeddings lesson: a slide showing a 2D scatter graph of word points.
Lesson 2 at 3:12: words with similar meanings land close together in vector space. The whole idea of the course on one slide.
Learn RAG, PopChoice solo project brief: a slide of requirements next to a phone app mockup.
The PopChoice solo project brief at 1:35, with the Figma design on the right.Slides from scrimba.com.

Is it worth your time?​

Yes, if you fit the prerequisites, and they are real. Guil says it in the intro: he assumes you know JavaScript and asynchronous code and have already used the OpenAI chat completions API. By the fifth scrim you are writing an async callback inside map and wrapping it in Promise.all. Nobody explains what a promise is.

What I liked is how little theory sits between you and a working pipeline. One six-minute slide lesson covers embeddings; after that, everything is code you run in the scrim. When cosine similarity comes up (the math that scores how close two embeddings are), Guil shows the formula, says "I don't know about you, but this makes my head spin," and pastes a SQL function from the Supabase docs instead. That is the right call for a 94-minute course.

The code is old. The scrims pin [email protected] and [email protected], and the models are text-embedding-ada-002 and gpt-4. A 44-second scrim after "Vector databases" has a Scrimba staffer "popping in from the future" because the Supabase package "has been superseded and deprecated." The fix is a right-click and "upgrade package," and he warns you will need to do that in each scrim. The RAG pattern itself is unchanged.

What you'll learn​

Scrimba presents this course as one flat list of 22 scrims with no modules. The groupings below are mine, made from the titles and transcripts; durations are the sum of the scrims in each group.

Course curriculum

5 modules · 22 lessons

  1. Embeddings (intro to first challenge)21 min5 lessons
  2. Vector database with Supabase13 min4 lessons
  3. Semantic search and chat completions23 min3 lessons
  4. Chunking, error handling, and the ReelRecs chatbot31 min5 lessons
  5. Solo project and wrap-up10 min5 lessons

I counted 22 scrims plus a certificate entry in September 2026. Scrimba's header says 94 minutes and its structured data says 23 lessons; the listed durations add up to about 98 minutes. When other pages on this site say 1.6 hours or 23 lessons, that is Scrimba's number.

Inside the course, section by section​

1. Embeddings (21 min, 5 scrims)​

The intro is a three-minute video. It opens with Spotify in 2014 turning songs and listening history into vectors, then promises "an AI tool that replies to you based on custom data stored with vector embeddings."

"What are embeddings?" is slides, and it is good. Guil defines an embedding as "placing one object into a different space": a piece of text becomes a long list of numbers, and texts with similar meaning get similar numbers. He spends most of the six minutes on the 2D graph: cat at (4.5, 12.2), feline at (4.7, 12.6), dog off in its own region, "building" far from all of them.

"Set up environment variables" is 94 seconds of housekeeping. You see three ways to open Scrimba's environment-variable modal, then add OPENAI_API_KEY so config.js can read it with process.env. The client is created with dangerouslyAllowBrowser: true, which tells you the code runs in the scrim's browser sandbox, not on a server.

"Create an embedding" is the first real code scrim. Guil pastes the Node example from OpenAI's docs, sends "hello world" to openai.embeddings.create(), and reads the response: four tokens used and an array of 1,536 floating-point numbers. Then he swaps the string for five podcast descriptions and gets five vectors back in one request.

The first challenge follows. It is the first of three scrims with Scrimba's "Challenge with Instant Feedback" icon, which means an AI checks your solution against the brief. The brief: for each text input, build an object with content and embedding properties. Guil's solution is map with an async callback inside Promise.all, and "if your solution looked a bit different than mine, that's totally okay."

Learn RAG, Pair text with embedding challenge: code editor beside a console printing embedding results.
The first challenge at 2:49, after Guil runs his solution. The console shows the five content-plus-embedding objects.Screenshot of scrimba.com, taken by scrimbaguide.tech.

2. Vector database with Supabase (13 min, 4 scrims)​

"Vector databases" is a short slide explainer. Traditional databases match exact values; a vector store finds rows whose embeddings are close to yours. Guil name-checks Chroma, Pinecone, and Supabase, then picks Supabase, a hosted Postgres service that gains vector search through the pgvector extension. The 44-second dependency warning comes next.

"Set up your vector database" is a walkthrough of supabase.com. You sign in with GitHub, create a free project, and enable the vector extension. Then you copy the project URL and API key into two more environment variables, SUPABASE_URL and SUPABASE_API_KEY.

"Store vector embeddings" gives the database a table. The scrim ships documents.sql, six lines for the SQL editor: id bigserial primary key, content text, and embedding vector(1536). The content is ten fictional podcast descriptions "that AI models like ChatGPT have no prior knowledge of," so any correct answer later must have come from your data.

Guil inserts one row per map iteration first, to show that object keys must match column names, then refactors to a single batch insert(data). "Fingers crossed," and ten rows appear in the table editor.

3. Semantic search and chat completions (23 min, 3 scrims)​

This is the core of the course. "Semantic search" is a five-minute concept scrim built on three phrases: "dogs are loyal companions," "books contain a world of knowledge," and "canines are faithful friends." You group the first and third by meaning without a shared word. That is the gap between lexical search (matching words) and semantic search (matching meaning), illustrated again with Spotify podcast search.

"Query embeddings using similarity search" is nearly ten minutes and the one I would point a skeptic at. Guil sets the query to "jamming in the big easy," embeds it, and needs a way to compare it against the table. pgvector "makes the comparison and processing of vectors easy and fast with a SQL function that you can copy right from the docs."

That function is match_documents, walked through line by line. A 1,536-dimension query vector goes in; id, content and a similarity score come out. It uses cosine distance because "that is what OpenAI recommends we use on their embeddings."

Back in JavaScript, you call it through supabase.rpc('match_documents', { query_embedding, match_threshold, match_count }), with threshold 0.50 and count 1. The jazz query returns the New Orleans podcast at roughly 85 percent similarity despite sharing no words with it.

Then the useful part. "Training puppies" returns a whale-song episode at about 75 percent, because the search "will still attempt to find the closest match based on the semantic relationships, even if contextually they're unrelated." That minute explains why the threshold exists.

"Create a conversational response using OpenAI" adds getChatCompletion. The system prompt survives to the end of the course: "an enthusiastic podcast expert" that must answer from the context and say "Sorry, I don't know the answer" rather than invent one. The user message is Context: ${text} Question: ${query}, sent to gpt-4 with temperature 0.5 and frequency penalty 0.5. "Something peaceful and relaxing" now gets a paragraph about a 30-minute silence podcast, and "training puppies" gets the refusal.

4. Chunking, error handling, and the ReelRecs chatbot (31 min, 5 scrims)​

"Chunking text from documents" is the LangChain lesson and, at 9:36, the longest scrim. Chunking means cutting a long document into short pieces before embedding each one. The embedding model "accepts a maximum of 8,191 tokens," and embedding several paragraphs at once "might miss out on important nuance details."

On podcasts.txt, Guil imports CharacterTextSplitter, sets chunkSize: 150 and chunkOverlap: 15, and gets 50 chunks; with overlap at zero, 47. RecursiveCharacterTextSplitter, which tries to keep sentences together, gives 78. His rule: "if the chunked text makes sense to a human without surrounding context, it will likely make sense to the language model."

Learn RAG, Chunking text lesson: a code editor configuring the LangChain text splitter.
The splitter configuration at 5:53, just after Guil sets the overlap to 15 characters.Screenshot of scrimba.com, taken by scrimbaguide.tech.

The second AI-checked challenge combines everything so far. Split movies.txt, twelve films from 2022 and 2023 with rating, synopsis, and cast; embed every chunk; insert them into Supabase. Guil's solution uses the recursive splitter at 250 and 35, creates a movies table, and writes the match_movies function in the same SQL query.

"Error handling" is three minutes of try/catch. You check response.ok on the fetch, log and rethrow from splitDocument so the caller stops, and throw on the error that Supabase returns from an insert. He proves it with a typo in the file name and reads the error chain in the console.

"Query database and manage multiple matches" is the third AI-checked challenge. After switching the RPC to match_movies and the prompt to "an enthusiastic movie expert," Guil asks "which movie can I take my child to?" and gets The Super Mario Bros. Movie. The challenge: return at least three matches and combine them into one string. His solution sets match_count to 4 and joins the content fields with a newline.

Two more queries show retrieval working. "I feel like having a good laugh" returns Glass Onion and Barbie. "The movie with that actor from Cast Away" returns Asteroid City, because the chat model already knows Tom Hanks and the database supplied the cast list.

"AI chatbot proof of concept" wires the pipeline to a search form and a reply paragraph. Guil types "I like airplanes" and gets Top Gun: Maverick. Then he shows the limitation: ask a follow-up and "the AI draws a blank because it has no memory or context of previous interactions."

The fix is to push each assistant reply onto chatMessages so the history travels with every request. After that it remembers his name and his taste for action films. This memory resets on refresh; long-term memory is "another course."

Learn RAG, AI chatbot proof of concept: a chat preview showing the ReelRecs bot's movie reply.
The finished ReelRecs chatbot at 4:17, answering from the movies table after Guil tells it his name and that he likes action movies. The reply continues below the fold of the preview pane.Screenshot of scrimba.com, taken by scrimbaguide.tech.

5. Solo project and wrap-up (10 min, 5 scrims)​

"Solo Project: PopChoice" is a four-and-a-half-minute brief voiced by a different Scrimba presenter. The app asks three questions (favorite movie and why, new or classic, fun or serious), combines the answers into one string, embeds it, searches the database, and explains why the match fits your mood. Core requirements are on the slide above.

Any framework is allowed, "including React," or plain JavaScript. Stretch goals include a start screen for several people in one movie night, chunking the provided movies.txt instead of using the array, and pulling posters from a linked API. Hints are linked, and config.js comes set up for OpenAI and Supabase.

The remaining four scrims are housekeeping and none is by Guil. Two are pitches: Scrimba's free docs site and Per Borgen's Scrimbassador referral program. The other two are the "You made it to the finish line!" recap and the standard "How to Utilize Your Certificate" scrim. You can skip all four without missing anything about RAG.

What a lesson feels like​

Scrims run from 44 seconds to just under ten minutes. Four are slide videos with no files; the rest open on a small project: config.js for the API clients, index.js for the lesson code, and a data file. Guil talks over the editor, runs the code, and reads the console, which is where most of the teaching happens. Scrims autoplay when opened, so have a finger on pause if you want to read the code first.

Challenges are written as comments in the file. Every scrim has captions, a timestamped transcript under the settings menu, and subtitles in ten languages. Guil's voice is calm and unhurried; "before I send you running off for the hills with this mathematical beast" tells you the tone.

Free or Pro: exactly what is gated​

The first five scrims (intro through the first challenge, about 21 minutes) carry a SAMPLE badge and can be previewed without a subscription. Everything from "Vector databases" onward needs Pro. That covers the Supabase setup, similarity search, chunking, the two later challenges, the ReelRecs chatbot, the PopChoice project with its Figma file and hints, and the certificate.

Pro also covers the AI Engineer Path this course sits in and the Pro-only channels on Scrimba's Discord; basic Discord access is listed as free. See current plans (opens in a new tab) for what Pro costs in your region.

How long it takes​

The 94 minutes is video runtime. Budget three to four hours: the challenges take longer than their scrims, the Supabase setup happens on another site, and you will be upgrading the deprecated package in each scrim. PopChoice done properly from the Figma file adds four to eight hours. Call it a weekend for the course and a second one for the project.

Who it's for, and who should skip it​

It fits JavaScript developers who already call the OpenAI chat API and now need the retrieval side, such as documentation assistants and support bots. It is also the course to take if you want pgvector on Supabase specifically.

Skip it, for now, if async/await and Promise.all are shaky, or if you have never sent a chat completion from code; do Intro to AI Engineering first. Skip it if you need Python, a dedicated vector database such as Pinecone, or production concerns like re-ranking and evaluation; none of that is here. LangChain appears only as its text splitters.

View Learn RAG on Scrimba (opens in a new tab)

Prerequisites​

Comfortable JavaScript including asynchronous code, and prior experience with the OpenAI API and chat completions. No prior knowledge of embeddings, vector databases, SQL, or Supabase is assumed. You will need an OpenAI API key with billing enabled and a free Supabase account.

Where it fits​

This is the retrieval course on the AI Engineer Path, between the fundamentals and the agent work. The history handling in the last lesson leads into Learn Context Engineering, and grounded retrieval is what makes the tools in Learn AI Agents trustworthy. For the concepts in written form, Scrimba's docs have a free RAG chapter (opens in a new tab).

Strengths and limits​

What it does well: a complete RAG pipeline in under two hours of video. The similarity-search lesson shows both the hits and the false match, so you understand thresholds. The chunking lesson gives concrete numbers (50 vs 47 vs 78 chunks) rather than hand-waving. The challenges are AI-checked, and the solo project is a real portfolio piece with a design file.

Where it is limited: the scrims pin [email protected] and [email protected], so package and model names need translating to current ones. It covers one vector store and one embedding provider, and it stops at a proof of concept with in-memory chat history.