StaffCoder
AI Agents

Build an AI Agent From Scratch

Linux CLI
4 modules · 23 challengesSign up
Modules4 modules · 23 challenges
The heart of every agent: the loop that sends messages, runs the tools the model asks for, and feeds results back until an answer. You build it piece by piece - dispatch that survives malformed calls, assembly of streamed fragments, a guard against endless loops, parallel execution - then prove it on hidden tasks against a live model.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

6 challenges

Loop Body

Sign up to unlock
20%2 of 10 solvedeasy
About this challenge

Build the agent loop that runs the tools the model asks for until it answers.

Solved in a browser IDE and graded by tests. Sign up to solve

Tool Dispatcher

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Build the dispatcher that turns bad tool calls into error results instead of crashes.

Solved in a browser IDE and graded by tests. Sign up to solve

Delta Assembler

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Assemble complete tool calls from streamed fragments before anything runs.

Solved in a browser IDE and graded by tests. Sign up to solve

Non-Termination Guard

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Add the stop conditions that end a conversation the model never would.

Solved in a browser IDE and graded by tests. Sign up to solve

Parallel Dispatch

Sign up to unlock
100%2 of 2 solvedeasy
About this challenge

Run a turn's tool calls in parallel so one hanging tool cannot stall the rest.

Solved in a browser IDE and graded by tests. Sign up to solve

Hidden Multi-Tool Missions

STAR
Solving it completes the module
100%2 of 2 solvedeasy
About this challenge

Run your full agent against a live model on unseen multi tool tasks.

Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Build a working AI agent from bare HTTP calls - no frameworks, no SDKs. You write the loop that lets a model use tools, make its output machine-readable, stream it live, and keep it alive when providers fail. Finish and you have an agent you built entirely yourself - and nothing inside LangChain will ever look like magic again.

This path has you build an AI agent from plain HTTP calls, without a framework or SDK: the tool-calling loop, structured output, streaming, and resilience. You should be comfortable writing code that sends HTTP requests and handles JSON. No earlier experience with agents or LLM APIs is needed. The resilience module keeps your agent running when a provider fails, with retries, timeouts, a circuit breaker and a fallback provider.

From the blog

1

Frequently asked questions

4

What will I practice in this path?

4 modules: Tool Calling & Agent Loop, Structured Output, Streaming Agents and Resilience & Rate Limiting.

How many AI agent exercises are there, and how hard are they?

23 exercises, all easy.

What does this path run on?

Challenges run on Linux CLI.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.