Build an AI Agent From Scratch
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.
Tool Calling & Agent Loop
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.
Loop Body
Tool Dispatcher
Delta Assembler
Non-Termination Guard
Parallel Dispatch
Hidden Multi-Tool Missions
Structured Output
The bridge from model text to data your system trusts: a schema that rejects junk with errors the model can act on, a cleaner that strips fences and stray commas without touching the payload, a repair loop that feeds validation errors back until the output is valid, and a salvager that recovers what truly arrived when a stream dies - then prove the full stack extracting real documents against a live model.
Schema Definition
Fence and Comma Cleaner
Repair Loop
Partial JSON Handler
Contract Extraction Live
Streaming Agents
The pipe that makes tokens appear live: an SSE gateway between the model's messy stream and the user's browser. You build it failure by failure - framing the browser actually accepts, text flowing while tool calls assemble, multibyte characters split across chunks, upstream deaths turned into clean error frames, reconnects that resume from the right word - then compose it all into one drop-proof gateway.
SSE Endpoint
Interleaved Assembly
Split Character Handling
Mid-Stream Failure
Resume From Disconnect
Drop-Proof Token Pipe
Resilience & Rate Limiting
What separates a demo from a product: the client that survives the provider's worst day. You build it policy by policy - retry with backoff and jitter, timeouts that cut hangs, recovery of streams that die mid-answer, a circuit breaker that stops hammering a dead endpoint, fallback to a secondary without ever billing twice - then run it all against a scripted storm.
