Module 4 of 10, lesson 4 of 5
Practice
Reasoning loops and architectures
Write the code
Runs in your browser, with no install, account or API key. The model is scripted, so the results are repeatable.
const sameCall = (a, b) => a.name === b.name && a.input === b.input;async function runAgent({ model, tools, prompt, maxSteps = 20 }) { const messages = [{ role: 'user', content: prompt }]; let previous = null; let repeats = 0; for (let step = 0; step < maxSteps; step += 1) { const response = await model.create({ messages });
Repair the agentDetect a stuck agent
Open in the editorasync function executePlan(plan, tools) { const evidence = {}; // TODO return { status: 'done', evidence };}module.exports = { executePlan };
Give the agent a skillBuild a ReWOO executor
Open in the editorRunning project
Running project: write by hand, in ReAct style, the trace of a refund request where the order can’t be found. Rewrite it in ReWOO style. Count the model calls and find the moment the ReWOO plan becomes wrong.
Practice
- AI Agents in LangGraph DeepLearning.AI
Short course that builds an agent from scratch, then with LangGraph. - AI Agents for Beginners Microsoft
18 free lessons with a short video and Python code samples each.
Some of these need a free account or an API key, which may be paid.