Skip to content
Simon Place
FR EN
Book a Meet call

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 editor
async 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 editor

Running 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

Some of these need a free account or an API key, which may be paid.

Legal notice and privacy