Module 6 of 10, lesson 4 of 5
Practice
Choosing a framework
Write the code
Runs in your browser, with no install, account or API key. The model is scripted, so the results are repeatable.
const END = '__end__';async function runGraph({ nodes, edges, start, state, reducers = {}, maxSteps = 25 }) { // TODO return state;}module.exports = { runGraph, END };
Give the agent a skillWrite a tiny graph engine
Open in the editorasync function run(steps, store, runId, initial = {}) { const saved = store.get(runId); let index = saved ? saved.index : 0; let state = saved ? saved.state : initial; for (; index < steps.length; index += 1) { store.set(runId, { index: index + 1, state }); state = { ...state, ...(await steps[index](state)) }; }
Repair the agentFix crash recovery
Open in the editorRunning project
Running project: write the refund agent’s loop without a framework, using your three tools. Cap it at 8 steps. Write down what you missed. That’s your real list of criteria for choosing a framework.
Practice
- Introduction to LangGraph LangChain Academy
Free course: 55 lessons and about 6 hours of video. - 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.