Skip to content

yai-dev/a101

Repository files navigation

Agent 101

A practical course on building AI agents — from core loop to multi-agent collaboration.

中文版

What is this?

Agent 101 is a hands-on course that teaches you how to build real AI agents using TypeScript and the Anthropic SDK. Each lesson introduces one new concept by modifying a minimal working agent — you can see exactly what changed and why.

The course ships with one app:

App Description
apps/agent TypeScript source files — run each lesson directly

Curriculum

Chapter 1 — Agent Core Loop & Tools

The foundation every agent is built on

Lesson Title Concept
1.1 Agent Core Loop One while loop, one stop condition
1.2 Tools System Dispatch map, four file tools
1.3 Steering Inject instructions while the agent is running
1.4 Followup Outer loop — continue after the agent finishes

Chapter 2 — Orchestration

Managing complex multi-step work

Lesson Title Concept
2.1 ToDo System Self-updating checklist + Drift Guard
2.2 Sub-Agent Delegation Spawn a fresh agent for focused sub-tasks
2.3 Skills System Load expert knowledge on demand
2.4 JSON File-based Task System Persistent tasks with dependency tracking

Chapter 3 — Context

Managing what the agent sees

Lesson Title Concept
3.1 Compaction Run long tasks without hitting context limits
3.2 Context Engineering What goes into the context window, and why it matters

Chapter 4 — Concurrency

Doing more than one thing at a time

Lesson Title Concept
4.1 Background Task Execution Start a slow command and keep working

Chapter 5 — Collaboration

Agents working together

Lesson Title Concept
5.1 Agent Team System Multiple agents, one shared filesystem
5.2 Team Protocol Typed messages with request/response pairing
5.3 Autonomous Agents Agents find and claim their own work
5.4 Worktree & Task Isolation One git branch per task

Prerequisites

Getting Started

1. Clone and install

git clone https://github.com/yai-dev/a101.git
cd a101
pnpm install

2. Configure environment

cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY

3. Run a lesson

cd apps/agent
npx tsx ch1-core/1.1-core-loop.ts

4. Start the course website

pnpm dev
# Opens at http://localhost:3000

Environment Variables

Variable Required Description
ANTHROPIC_API_KEY Yes Your Anthropic API key
MODEL_ID No Override the default model (default: claude-opus-4-5)
ANTHROPIC_BASE_URL No Override the API endpoint (useful for proxies)

Tech Stack

  • Runtime: Node.js, TypeScript, tsx
  • AI SDK: @anthropic-ai/sdk
  • Package manager: pnpm workspaces

License

MIT © 2026 Yaid

About

`a101` is an open-source course series that teaches you how to understand and build agent systems from the ground up.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages