Skip to main content

Intro to Mistral AI

Intro to Mistral AI is Scrimba's free, 84-minute course on building with Mistral's models in JavaScript, taught mainly by Per Borgen with Gil Hernandez and Mistral's Sophia Yang. In 25 scrims you build a RAG bot over an employee handbook and a function-calling agent, and it earns its short runtime.

Reviewed inside the course with a Pro account, September 2026.

Quick answer​

It fits developers who already know JavaScript and want a free, hands-on build of a RAG bot and a function-calling agent. The catch is setup, not price: Mistral requires a card on file before it issues an API key, and the RAG section needs a free Supabase project too. From here, Learn RAG covers retrieval in more depth, and Learn AI Agents takes the agent loop further.

Is it worth your time?​

Yes, if you can write JavaScript and want to see RAG and function calling built end to end without paying for a course. For 84 minutes it covers a lot of ground, and it does so with the two projects that matter most on the AI track. One is a question-answering bot grounded in your own documents. The other is an agent that turns a sentence into a function call. Both are the same patterns you meet later in the paid AI courses, here in their simplest form.

Per sets the tone in the first minute: "My goal with this course is to teach you how to build magical stuff and more specifically, how to do that using JavaScript and Mistral AI." He keeps it that direct throughout. The challenges are short and the solutions follow right after, so nobody gets stuck for long.

Two caveats. First, it is a 2024 recording. Per warns in the models scrim that "these are the models it offers at the time of recording," and the model names (mistral-tiny, mistral-medium-latest) and the 0.1 client library show their age.

Second, you cannot follow along with a free Scrimba account alone. Mistral asks for a card before it issues an API key, and Supabase needs its own project and two SQL snippets pasted into its editor.

What you'll learn​

The course is one flat list of scrims, so the grouping below is mine, in order.

Course structure

25 scrims in 5 editorial groups, plus 3 generic Scrimba pages

  1. Welcome, Mistral intro, and La Plateforme signup6 min3 lessons
  2. Chat completions, streaming, JSON, and choosing a model13 min3 lessons
  3. RAG: embeddings, chunking, Supabase, retrieval, generation41 min11 lessons
  4. Function calling: from a tool schema to an agent loop17 min6 lessons
  5. Running Mistral locally with Ollama, and the recap5 min2 lessons

Group durations are added up from the timer in each scrim's header and come to 82 minutes; Scrimba's header rounds the course to 84. Scrimba's About text says 25 lessons. The table of contents has 28 entries because it ends with three pointer pages (Scrimba Docs, the affiliate program, and how to use your certificate); my counts above are the 25 real lessons.

Inside the course, module by module​

1. Welcome, Mistral intro, and La Plateforme signup (6 min, 3 scrims)​

Title card of Scrimba's Intro to Mistral AI course: Scrimba Course, Intro to Mistral AI, course teacher Per Borgen
Per lays out the plan, then the La Plateforme signup and its pay-per-use pricing, no fixed subscription.

Per's welcome explains what Mistral is (a company that "twice managed to stun the AI community by launching small open source foundational models") and lays out the plan. In order: API basics, models, embeddings and vector databases, RAG, function calling, then local models. He also says the course "has been created in partnership with the company itself."

Sophia Yang's two minutes are a company brief: founded in 2023, Mistral 7B and Mixtral 8x7B as open weights under Apache 2.0, and Small, Medium, and Large as the paid tier.

The third scrim is the signup walkthrough. It is the one to watch before deciding whether to take the course, because it tells you the cost model plainly: "you only pay for what you use. So this is not an ongoing fixed subscription." You add a card, create a key, and store it as a Scrimba environment variable.

2. Chat completions, streaming, JSON, and choosing a model (13 min, 3 scrims)​

Gil Hernandez teaches the first request. The code is small: import MistralClient, call client.chat with a model and a messages array, and read chatResponse.choices[0].message.content. He then adds temperature and a system message, and pauses twice for you to change the prompt yourself. Gil also uses this scrim to point out where you are. "You are experiencing a fully interactive scrim that you can pause at any moment and jump right into the code and make changes to it."

Per takes over for part two, which adds two settings you will use in every app. Streaming means switching chat to chatStream and reading chunks with a for await loop, and Per shows why by typing a question into a Hugging Face chat page and watching the reply build "token by token." JSON output takes two changes: set response_format to json_object and ask for JSON in the prompt.

The models scrim compares Mistral's open and paid models on the MMLU benchmark (a standard test for language models) and then on cost. The advice is to pick the cheapest model that does the job. As Per puts it, "you probably don't want to hire a person that is overeducated or overqualified for the job because most likely their hourly rate will be higher." The course uses mistral-large-latest for RAG and the agent because those need reasoning.

3. RAG: embeddings, chunking, Supabase, retrieval, generation (41 min, 11 scrims)​

This is half the course, and it is built as one project: a bot that answers questions about a fictional company's employee handbook (handbook.txt, about 600 lines). Per explains RAG (retrieval-augmented generation, meaning you look up relevant text first and hand it to the model as context) with a story about asking Notion's AI where Scrimba keeps its Coursera export notes. Gil then gives a six-minute primer on embeddings, the numeric form of text that lets you compare meaning. "You can think of embeddings as the language that AI understands," he says, and walks through the classic king minus man plus woman example.

The build starts with chunking. Per imports RecursiveCharacterTextSplitter from LangChain, sets a chunk size of 250 characters with an overlap of 40, and inspects the 280 chunks that come out. His rule: "you want your chunks to be as small as possible, but you don't want to lose context." A short challenge has you refactor splitDocument to take a path and return an array of strings. Then you create one embedding with client.embeddings and the mistral-embed model, and the first real challenge asks you to embed every chunk and shape the result for the database.

Intro to Mistral AI, embeddings challenge screen: a code editor shows only a comment brief, no code written yet.
At 0:49 of the embeddings challenge brief, Per has deleted his own code from the previous scrim: 'yeah, this is Scrimba. You are going to write the code on your own.'Screenshot of scrimba.com, taken by scrimbaguide.tech.

Gil returns for two Supabase scrims: what a vector database is, and a click-by-click setup of a free Supabase project with the pgvector extension, ending with two more environment variables. One quirk: the editor in those two scrims still shows OpenAI code from another course (text-embedding-ada-002), which is unrelated to the walkthrough. Per then creates the handbook_docs table with a SQL snippet (the embedding column is a 1024-dimension vector, matching mistral-embed) and uploads everything with a single supabase.from('handbook_docs').insert(data).

Retrieval uses a similarity function that Supabase supplies. Per is upfront that the math behind it stays in the box: "Luckily, we don't have to worry about any of that as Supabase provides us with a SQL function that we simply can copy paste." You call it with supabase.rpc. The first result for "December 25th is on a Sunday, do I get an extra day off?" comes back as a cut-off sentence about Christmas Day. The final two-part challenge fixes that: return five matches instead of one, then write the prompt that combines context and question and send it to mistral-large-latest.

Intro to Mistral AI, RAG lesson: a code editor beside a console printing a full sentence answer from the handbook bot.
The finished RAG bot's prompt at 3:57 of the last RAG scrim is just 'Handbook context:' plus the five chunks and 'Question:' plus the query.Screenshot of scrimba.com, taken by scrimbaguide.tech.

4. Function calling: from a tool schema to an agent loop (17 min, 6 scrims)​

Title card for the function calling section of Scrimba's Intro to Mistral AI course, with three floating cubes
Six scrims build a customer-service agent, from a tool schema to reading tool_calls and looping to an answer.

The agent is a customer-service bot over a tiny array of transactions in tools.js. Per's opening point is the one people miss: the model never runs your code. "This is all our AI sees. It never sees the content of this function. It just looks at the description and tries to decide whether or not it should be invoked."

The first scrim sends the prompt "Is the transaction T1001 paid?" with a tools array, and the reply has an empty content and a tool_calls entry naming getPaymentStatus.

Intro to Mistral AI, function calling lesson: a code editor shows the model's raw response object after a tool call.
Per pastes the reply into output.js at 3:11. The two fields the section builds on are tool_calls and finish_reason: 'tool_calls' means the model wants you to run something and report back.Screenshot of scrimba.com, taken by scrimbaguide.tech.

The next five scrims each add one piece, and each is a challenge:

  1. Describe a second function, getPaymentDate, in the tool schema and change the prompt to trigger it.
  2. Read the function name out of the response and JSON.parse its arguments.
  3. Call it through an availableFunctions object with bracket notation.
  4. Push a message with role: 'tool' back into the messages array.
  5. Wrap it all in a for loop that runs at most five times and returns when finish_reason is stop.

Per explains the cap: a while loop or recursion "could be better solutions, but they also open up for the possibility of infinite loops." The last run prints "The transaction T1001 was paid on October 5, 2021."

5. Running Mistral locally with Ollama, and the recap (5 min, 2 scrims)​

Title card for the Running Mistral locally scrim in Scrimba's Intro to Mistral AI course
The one scrim outside the browser: ollama run mistral, then a small Express server that talks to it locally.Screenshot of scrimba.com, taken by scrimbaguide.tech.

The Ollama scrim is the only one that leaves the browser. You install Ollama, run ollama run mistral (a 4.1 GB download), chat with it in the terminal, then download the scrim as a zip, npm install, and start a 24-line Express server that passes a URL query to ollama.chat.

Per's sell is simple: "aside for the cost of the hardware and the electricity, these tokens are completely free," and the data stays on your machine. The recap is 77 seconds. After it come the three generic Scrimba pages, which have no video.

What a lesson feels like​

Scrims run one to six minutes; the longest is Gil's embeddings explainer. Per and Gil talk over a slide for the concept, then switch to the editor and run the code, and you see the API response arrive in the console. Challenges are written into the file as a comment block, the narration says "go ahead and solve this," and the recording sits quiet for a few seconds before the solution starts. You are meant to pause there, write your version, and press play.

Every scrim has captions, a timestamped transcript under the settings menu, subtitles in ten languages, and playback speed. The API calls are real, so running Per's code yourself spends a fraction of a cent on your Mistral account each time. Nothing in the course marks your work automatically; the check is whether your console shows what Per's shows.

Free or Pro: exactly what is gated​

Nothing inside the course. All 25 teaching scrims play in full without Pro, there is no Solo Project, and the challenges are plain comment blocks in the editor rather than Scrimba's AI-checked challenge format. The only item I did not test is the Certificate of Completion entry at the very end of the list; Scrimba's pricing page lists certificates as a Pro feature.

Pro is a separate decision. It buys the full AI Engineer Path (this free course is not part of it), the Pro-only Discord channels (basic Discord access is free), unlimited challenges, and certificates. See current plans (opens in a new tab) for what it costs in your region.

How long it takes​

Budget three to five hours, not 84 minutes. The account setup alone (Mistral card and key, Supabase project, pgvector extension, three environment variables, two SQL snippets) is 30 to 60 minutes the first time. The RAG and function-calling challenges are short, but each one is worth writing yourself before watching the solution. The Ollama scrim adds a 4 GB download and a local npm install, so do it when you have time and disk space.

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

It fits developers with working JavaScript who want to build a RAG bot and a tool-calling agent once, from scratch, before touching a framework. It is also a good way to try Mistral if you have only used OpenAI: the client, the messages array, and the tool schema all rhyme with what you know.

Skip it, for now, if you have never written async/await or called an API; start with Learn JavaScript or Learn to Code with AI. Also skip it if you will not put a card on file with Mistral, because the course cannot be followed past scrim three without a key. And if you want current SDK syntax rather than the concepts, read Mistral's docs alongside it.

Start Intro to Mistral AI for free (opens in a new tab)

Prerequisites​

JavaScript with async/await, arrays and map, and a basic sense of what an API request is. No AI experience is assumed; embeddings and RAG are explained from zero. You will need a Mistral La Plateforme account with a card, a free Supabase account (GitHub login works), and, for the last scrim, a computer that can run Ollama and hold a 4 GB model.

Where it fits​

This course sits outside the AI Engineer Path, but it works as a compact, free preview of two paid courses on it. Learn RAG covers the retrieval pipeline in more depth, and Learn AI Agents takes the function-calling loop further. Intro to AI Engineering is the fundamentals course that most people take first; this one works either as a taster before it or a second provider after it.

Strengths and limits​

What it does well: it is free, and it builds a real RAG pipeline and a real agent loop rather than talking about them. The challenges sit exactly where you would otherwise copy code. Per explains the trade-offs as he goes, from chunk size to model cost to the five-iteration cap.

Where it is limited: it was recorded in early 2024 and pins Mistral's 0.1 client, so the model names and SDK calls will not match current docs. It needs two external accounts and a card before the main project runs. The Supabase scrims show leftover OpenAI code in the editor, and because the user input is hard-coded you never wire the bot to a page.