Skip to main content

Learn AI Agents

Learn AI Agents is Arsala Khan's Pro course on LLM agents, re-recorded in October 2026: about 3.1 hours and 29 lessons in which you write a tool-calling agent loop by hand on OpenAI's Responses API, then wire it into OpenSwap, a small app that suggests open-source alternatives to tools like Calendly and Notion. It is current code and a real app, not a toy loop.

Reviewed inside the course with a Pro account, October 2026: all 29 lessons listed and the editor code opened in three of them.

This page is part of our Scrimba AI courses catalog. The same 29 lessons form the Agents module of the AI Engineer Path.

A hand-written agent loop on the Responses API​

It fits developers who already call an LLM from JavaScript and want to see what an agent loop does before a framework hides it. The catch is setup: you run an Express server and need your own API key. Take Intro to AI Engineering first if you have never called the OpenAI client, and move on to Build a Support Agent with Vercel AI SDK once you want the SDK to run the loop for you.

Title card of the What Are Agents? lesson in Scrimba's Learn AI Agents: What AI agents actually are, course teacher Arsala Khan.
Lesson 2 opens on this card. Behind it, the OpenSwap app you build is already running in the preview.

What replaced the 2023 weather agent​

This course used to be Bob Ziroll's November 2023 recording: a weather agent built twice, once with a ReAct prompt and regex parsing, once with OpenAI function calling. Scrimba replaced it on 7 October 2026. The course page now names Arsala Khan as teacher, lists 3.1 hours instead of just under two, and the old ReAct scrims, the weather tools and the AI Travel Agent solo project are gone.

The new version is better for anyone starting now. The editor code uses client.responses.create, OpenAI's newer Responses API, not the beta runFunctions helper the old course ended on. The model is not hardcoded: the server reads AI_KEY, AI_URL and AI_MODEL from environment variables, and a comment in the setup reads "Initialize an OpenAI client for your provider using env vars." When I opened "When Tools Fail", the environment check printed AI_MODEL: gpt-5.4-nano and AI_URL: https://api.openai.com/v1.

29 lessons, grouped by what you build​

Scrimba lists the course as one flat list of 29 lessons plus four certificate and housekeeping items, which is where the catalog's 32-lesson count comes from. The grouping below is mine, by topic. The course page lazy-loads lesson times, so the last two groups' minutes come from the same 29 lessons inside the AI Engineer Path, read on 10 October 2026. Those lesson times add up to about 2.8 hours; the course header says 3.1.

Course curriculum

29 lessons in a flat list, grouped by topic for this review

  1. Why agents, setup and the API30 min7 lessons
  2. The first tool and the loop26 min5 lessons
  3. Tool parameters and the search tool29 min5 lessons
  4. The OpenSwap agent and failing tools69 min8 lessons
  5. Agent conversations and outro16 min4 lessons
Learn AI Agents course page on Scrimba: 3.1 hrs, Intermediate, Pro, and the first lessons from The Limitation to Reasoning Items In The Loop.
The header and the first twelve lessons. Nothing in the first group is longer than Chat Completions And Responses at 8:15.

From one tool definition to a five-turn loop​

Why agents, setup and the API (30 min, 7 lessons)​

"The Limitation" (4:04) and "What Are Agents?" (5:22) set up the problem before any tool exists. "Environment Setup" (4:06) and the 51-second "Recommend Models" come next, then the longest lesson of the group, "Chat Completions And Responses" (8:15), which puts the two OpenAI APIs side by side before the course commits to the second. "Understanding Model Memory" (2:43) and "Why Use Agents?" (4:53) close it.

The first tool and the loop (26 min, 5 lessons)​

"Your First Tool Definition" (6:00) and "The Loop" (7:34) are the core. When I opened "The Loop", the editor held an Express server, an OpenAI client and the OpenSwap system prompt:

You are OpenSwap, an AI assistant that helps users find open-source alternatives to popular software. Use the get_open_source_news tool before recommending software in case recent news would change your answer.

The user prompt it runs against is concrete: "I want to replace Calendly for our team. We need SSO authentication and source code access." The first tool, get_open_source_news, is a single { type: "function", name, description } object, and its description repeats the instruction to check the news before recommending anything.

Learn AI Agents, The Loop lesson: server.js with the OpenSwap system prompt, a Calendly user prompt and the get_open_source_news tool.
The Loop at 0:00: one tool, one system prompt and a Calendly question, before the loop exists.Screenshot of scrimba.com, taken by scrimbaguide.tech.

"Running Tool Calls" (3:57), "Returning Tool Results" (5:35) and "Reasoning Items In The Loop" (3:17) name the rest of the loop: run the function the model asked for, send its result back, and handle the reasoning items the model returns between turns.

Tool parameters and the search tool (29 min, 5 lessons)​

"Tool Parameters" (6:37) and "Parameterizing The News Tool" (5:17) give the news tool arguments. "Defining Search Swaps" (6:22) adds the second tool, a search over the app's own list of alternatives. "Tool Inputs Are Still Inputs" (4:26) makes its point in the title: the model writes those arguments, so they are input like any other. "Wiring The Search Loop" (6:24) closes the group.

The OpenSwap agent and failing tools (69 min, 8 lessons)​

This is where the agent moves into the app. By "When Tools Fail" (10:16), the project has grown folders: agent/ with index.js, prompts.js and tools.js, a frontend/, and a store/ holding swaps.json. The preview shows the OpenSwap page: "Wanna swap any of these?" over a grid of chips (Confluence, Typeform, ChatGPT, Notion, Calendly, Zapier and more), a box for your own requirements, and a "Swap it" button.

Learn AI Agents, When Tools Fail lesson: agent/index.js with the loop capped at five turns, beside the OpenSwap app preview.
When Tools Fail: the loop runs at most five turns and filters the model's output for function_call items, while OpenSwap runs in the preview.Screenshot of scrimba.com, taken by scrimbaguide.tech.

The loop in agent/index.js is short enough to read whole: an inputContext array that starts with the user's message, const maxTurns = 5 with the comment "Limit how many turns the agent can take to avoid infinite loops", a while loop that pushes the model's whole output back into the context, then filters it for items whose type is "function_call". The lessons after it add a third tool that checks a project's health on GitHub ("Designing The Health Check Tool", then "Proving The Github Health Check Data Path", at 13:41 the longest lesson in the course, then "Adding The Health Check Agent Tool"), widen the search with tags, and complete the loop.

Agent conversations and outro (16 min, 4 lessons)​

"Managing Agent Conversations", "Saving And Loading Agent Conversations" and "Continuing Agent Conversations" turn a single run into a chat you can pick back up, then the "Outro" closes the course. Scrimba Docs, the Scrimbassador program and the certificate follow as housekeeping items.

A real app, real tools, and a four-hint challenge folder​

Every lesson I opened ran as a full project: an Express server on port 3001, a Vite front end on 5173, and a terminal that runs npm run start. That makes it heavier than a single-file scrim, and closer to how you would ship an agent. Both projects I opened also carry a hints folder with four files, hint1.md to hint4.md.

The one limit is depth on frameworks: there are none. You never touch LangChain, the Vercel AI SDK or MCP. That is the point of the course, and the reason to follow it with a framework course rather than stop here.

Plan for six to eight hours: 3.1 hours of video, plus time to set up a key, run the server and do the challenges before watching the answers.

Pro only, with your own API key​

Scrimba lists Learn AI Agents as a Pro course. You also pay your model provider for every run, since the code calls a real API with your key. Pro is billed through Scrimba's plans (opens in a new tab); this course and the rest of the AI Engineer Path are the reason to upgrade, not the Discord.

Who should build OpenSwap, and who should skip it​

Take it if you can write async JavaScript and an Express route, you have called a chat model before, and you want to understand tool calling well enough to debug a framework later. You write the loop yourself, line by line.

Skip it if you need Python; everything here is JavaScript on Node. Skip it, for now, if you have never called the OpenAI client: Intro to AI Engineering covers that first. Skip it if you want the agent built for you by an SDK; the Vercel AI SDK support agent course starts there.

Start Learn AI Agents on Scrimba (opens in a new tab)

Before it: Intro to AI Engineering. After it: an SDK, MCP and RAG​

You need comfortable JavaScript (async/await, ES modules, array methods), basic Node and Express, and an API key for an OpenAI-compatible provider. It sits in the AI Engineer Path as the Agents module, after the API basics and before Context Engineering and the Vercel AI SDK module.