AI Agents From Scratch

Active
GitHub JavaScript MIT

Description

Demystify AI agents by building them yourself. Local LLMs, no black boxes, real understanding of function calling, memory, and ReAct patterns.

Key Features

  • 12-step progressive learning path from raw LLM calls to ReAct agents
  • Runs entirely on local LLMs via node-llama-cpp, no API keys needed
  • Covers function calling, memory, Tree of Thought, and error handling
  • Companion website with visual explanations and concept maps
  • Each example includes code, code explanation, and concept documentation
  • Built-in benchmarks comparing local vs API model performance

Use Cases

💡 Learn how AI agents work under the hood before using production frameworks
💡 Teach students the fundamentals of agent architectures hands-on
💡 Prototype agent patterns locally without cloud dependencies or costs
💡 Understand ReAct, function calling, and memory systems from first principles

Quick Start

Clone the repo, run `npm install`, and download models into `./models/`. Start with `node intro/intro.js` and progress through examples sequentially. Requires Node.js 18+ and 8GB+ RAM. Visit agentsfromscratch.com for the companion guide.

Related Projects