AgentLu

agentic AI for the classroom

Write the code that makes an AI agent think and act.

AgentLu is a VS Code style workstation in the browser. You edit real JavaScript, press Run, and watch your agent answer - every tool call, model request and error streaming into the console beside it.

  • ✓Works with no API key
  • ✓Autosave and reference solutions
  • ✓One IDE for the whole class
PreviewProject 1
What should I wear in Chicago?
A warm coat, a hat and gloves.getWeather → getOutfitRules → llm
outfit cardcoat · hat · gloves

Three levels

Start by tweaking a prompt, then build — and finally, design an agent from scratch

Beginner

no code

Tweak an existing agent's prompt and watch it change.

  • Zero-shot
  • Few-shot
  • Chain-of-thought
  • Role prompting
  • Rules
  • Grounding

Intermediate

JavaScript

Build an agent from a guided starter.

  • RAG
  • Tool calling
  • Multi-turn state
  • Generated knowledge
  • Self-consistency

Advanced

from scratch

Design and build a whole agent from a use case description.

  • Use case design
  • Routing
  • Refusal handling
  • Tool orchestration
  • Evaluation

The loop

Four steps, repeated until it works

A project is not a quiz you pass once. You write, run, read the console, adjust and run again - the same loop the professionals use, with the feedback in front of you.

  1. 1

    Pick an exercise

    Each project gives you one thing to get right, plus a read-only checker that marks your work for you.

  2. 2

    Edit real JavaScript

    agent.js and prompts.js are yours. The files that do the marking are locked - in the editor and on the server.

  3. 3

    Press Run

    Your code runs in an isolated sandbox. Every tool call, model request and error streams into the console as it happens.

  4. 4

    Read the card

    The answer arrives with a card that explains it: a row per rule, a source chip per claim, and a red banner when something leaked.

The builds

Six guided agent builds — and twenty-two exercises that lead up to them

The twenty-two are quick: prompts you write in plain English, small agent.js changes, a schema to validate, a tool to write, and one from-scratch design with no starter logic at all. These six are the guided builds you work through in the IDE.

Weather & Outfit Decider

Call tools, read JSON, dress for the forecast.

Socratic Tutor

Coach with questions - never leak the answer.

Source-Grounded Research Assistant

Cite the document behind every claim, or refuse.

Front-Desk Router

Route to the right handler - or escalate when unsure.

Intake Agent

Turn a messy email into a clean, validated record.

Booking Agent

Fill a booking across turns without forgetting a detail.

The workstation

Everything you need is on one screen

The editor on the left, the console underneath it, and a status bar that says whether your work is saved and which model answered.

1

Yours, or locked. Two files are editable. The checker, the data and the rules are read-only - and the save endpoint refuses them, so nobody can rewrite their own marks.

2

Real JavaScript. Monaco, served from this app rather than a CDN, so the editor works offline. Autosave and Ctrl/Cmd+S keep the server in step.

3

Everything is logged. Tool calls, model replies, timeouts and blocked APIs all arrive as console lines, each carrying the file and line to open.

4

Which model answered. The status bar names the live provider. With no API key at all, a deterministic practice model answers instead.

What you learn

Three sections, four families of drill

Twenty-eight exercises across three sections: prompt engineering, working with model outputs, and tools & actions. Each section has one written guide in Learn and a runnable set of exercises in Projects.

  • Prompt engineering

    7 exercises

    Change the words, change the answer. Four are plain-English prompts; three apply the same idea inside agent.js.

    • Classify the review
    • Teach by example
    • Show your work
    • Break it down
    • Add a hint
    • Know before you answer
    • Ask three times
  • Agent behaviour change

    5 exercises

    Same agent, new rules of conduct: give it a voice, write its guardrails and its honesty, and make a vague answer specific.

    • Give your bot a voice
    • Write the rules
    • Make the answer better
    • Teach it to say “I don’t know”
    • Project 2 · Socratic Homework Study Buddy
  • Building new agents & tools

    5 exercises

    Plan the tool use and the loop in English first, then write the agent. The last one hands you a blank file and a use case.

    • Teach it a tool
    • Put the recipe in order
    • Project 1 · Weather & Outfit Decider
    • Project 5 · Intake Agent
    • Support triage
  • Grounding, routing & state

    4 exercises

    Answer from what it was given, send what it is sure of to the right handler, and remember the conversation across turns.

    • Feed your bot facts
    • Project 3 · Source-Grounded Research Assistant
    • Project 4 · Front-Desk Router
    • Project 6 · Booking Agent

How a run works

Your code, on a short leash

Student code runs on the server, so it gets the same treatment as any untrusted program: a narrow set of globals, hard limits, and every failure turned into something readable.

Browser

write, press Run

Server

route handlers own keys

Sandbox

node:vm + budgets

Two bridges

callTool · llm

Console & card

streamed back

One run, end to end

  1. 1

    The browser asks for one turn

    Your message, the recent chat history and your editable files travel to POST /api/run. Read-only files are never sent - the server takes those from the database.

  2. 2

    Your files become modules

    Each editable file is compiled and run in its own node:vm context and joined to its neighbours by the sandbox's own require, so imports between your files work. Math, JSON, Date and the timers are handed over; nothing else exists in there.

    new vm.Script(transformModule(file.content)).runInContext(context, { timeout: 2_000 })

  3. 3

    Inside your run, two bridges

    Everything the outside world can do for your agent goes through one of these two calls - which is why both are logged.

    callTool(name, args)→tools.js allow-listed, read-only

    llm({ system, user })→the provider chain

    Nebius Token Factory→Python service→OpenAI→practice model

    First one that answers wins. A failure falls through to the next and says so in the console.

  4. 4

    Events come back as they happen

    The response is a newline-delimited stream, so the console fills in while the agent is still working rather than after it finishes.

    logtool_calltool_resulttool_deniedtool_errorllmresultsummaryerrordone
  5. 5

    The console, the card, the record

    Logs and tool calls land in the drawer, your card renders beside the chat, and the run is recorded on your submission for the next lesson.

An isolated context

Your code runs server side with only the globals it is handed: no network, no filesystem, no shell.

Budgets, not hangs

15 seconds wall clock, 2 seconds per file, at most 12 tool calls and 6 model calls per run.

Errors you can act on

syntax, runtime, timeout, blocked, missing_module, missing_tool and tool_denied - each with a file, a line and an open link.

Locked means locked

Read-only files are refused by the save endpoint, so nobody can rewrite the marking scheme from the browser.

The feedback loop

Answers that explain themselves

A red card is the point. Every failure the platform can detect arrives with its reason attached, so the next edit is obvious.

Starter prompt1/4 · 25%

Nothing was cited, so this answer is not grounded in the handbook.

  • Every cited document exists
  • Every claim cites a document
  • Every claim is supported by its document
  • Refuses only when the sources fall short

No claims to show - the starter never retrieved a document, so there was nothing to cite.

After the fix4/4 · 100%

Grounded: every claim traces back to a document you retrieved.

  • Every cited document exists
  • Every claim cites a document
  • Every claim is supported by its document
  • Refuses only when the sources fall short
  • The handbook says: The chemistry lab is only used under teacher supervision.

    doc-3

  • The handbook says: Students should wear clothing that covers the shoulders and midriff.

    doc-2

The same project before and after the missing retrieval step, from real runs. The starter never calls searchDocs, so there is nothing to cite.

Autosave and hot reload

Edits save about a second after you stop typing, and the last question can re-run on save while you keep working.

Run replays your last message

Press Run, or Ctrl/Cmd+Enter, to try the new code against the same question - no retyping.

Hints, then the answer key

Progressive nudges while you work, and the completed reference solution to compare against once your card is green.

A console that explains

Filter by logs, tools, model or errors. Every failure carries a file, a line and an open link straight into the editor.

For teachers

A classroom, not a demo

Set it up once, then let the class loose: roles, progress and grading visibility are built in.

▌

Bring your own model

Nebius Token Factory, OpenAI, or the optional Python service. With none of them configured, the practice model answers.

See who needs help

A read-only class overview: who started, who finished, how many runs each, and which error kinds are biting.

Demo accounts included

The seeder creates a student and an instructor, so you can try both sides of the classroom in a minute.

Add your own project

A project is one seed module plus a seeder entry. The authoring guide in the repository lists the traps worth avoiding.

Under the hood

Built to be taken apart

The platform is small enough to read end to end, which is the same reason it is worth reading as an example.

Browser

Monaco editorConsole drawerPreview cardStatus bar

Your tab. Nothing to install and no build step to wait for.

POST /api/runyour message, the recent chat history and your editable filesthe run streams back as it happens

Next.js server

/api/run/api/submissions/api/templates/api/llm/status

Route handlers hold the API keys and the database connection. The browser never sees either.

runAgent({ files, entryFile, allowedTools })one call per turn, bounded by a wall clock

Sandbox

runtime.jsone node:vm context per file · 2 s each · no network, no filesystem, no shell

callTool(name, args)→tools.js read-only

llm({ system, user })→llm.js → provider chain

grade(context)→grader.js, after the run read-only

appendRun(id, record)each run is appended to your submission, keeping only the newest 20

Database

projectssubmissionsnewest 20 runs

One MongoDB. Every read goes through lib/workspace.js, so swapping the store touches one file.

Follow one request downwards: your browser, the route handler that owns the keys, the sandbox that runs your code, then the two collections the results land in.

Two suites, offline first

374 offline checks drive the sandbox directly with no network, and 110 end-to-end checks drive the API against a running server.

Degrade, never break

If a provider fails, the next one answers and the console says so. A bad key becomes a visible degraded run, not a blank page.

Offline by default

Monaco is served from this app rather than a CDN, so the editor keeps working behind a school firewall.

Questions

The things you were about to ask

Short answers, all of them checkable in the code.

Do we need an API key?

No. With no key configured a deterministic practice model answers, so every project is solvable offline. Add a Nebius or OpenAI key - or run the optional Python service - and the status bar switches to that model instead.

Is a student's work saved?

Yes. Editable files autosave about a second after you stop typing, and Ctrl/Cmd+S saves and re-runs. Reset restores the original files, which is deliberately irreversible, so it is a decision rather than an accident.

What happens if the code crashes or loops forever?

It becomes a console line. Your code runs with an 8 second wall clock, at most 12 tool calls and 6 model calls, so a runaway loop or a blocked API is reported with a file and line instead of hanging the page.

Can students change how they are marked?

No. The checker, the data and the rules are read-only files, and the save endpoint refuses them server side - greying them out in the editor is only the visible half of it.

Can we add our own exercise?

Yes. A project is one seed module plus a line in the seeder: files, tools, hints, a checklist and a reference solution. The authoring guide walks through it, including the mistakes worth avoiding.

What if the database is down?

The UI says so explicitly, and /api/health/db explains why, rather than showing a broken IDE. One npm run seed installs the projects and the demo accounts.

Ready when the class is

No install for students, no key required, and nothing to set up mid-lesson.