Patric's Open-Source Repo Teaches AI Agents From Scratch Without Frameworks
A framework-free, local-first tutorial repo teaching AI agent fundamentals from scratch — 4,300 stars and growing
Takeaways
- Framework-free agent curriculum: AI Agents From Scratch teaches 14 progressive lessons using local LLMs and raw JavaScript, no LangChain or CrewAI.
- Runs fully offline: Uses node-llama-cpp with GGUF models (e.g. Qwen 1.7B); no API keys or cloud costs required, 8GB RAM minimum.
- Covers the full agent stack: Function calling, persistent memory, ReAct loops, Tree/Graph/Chain of Thought, error handling with retries.
- Strong community traction: 4,300+ GitHub stars and 628 forks; companion site at agentsfromscratch.com adds visual explanations.
- Python version available: A Python port lives at github.com/pguso/agents-from-scratch for non-Node users.
- MIT licensed and actively maintained: Each example ships with CODE.md and CONCEPT.md explaining the what and why of every design choice.
Most agent tutorials start with LangChain. They hand you a high-level abstraction, show you a working demo, and call it a day. The problem: when something breaks, you have no idea why. AI Agents From Scratch takes the opposite approach , no frameworks, no API keys, no cloud costs, just local LLMs and raw JavaScript that exposes every moving part.
The repo has crossed 4,300 stars and 628 forks, with a companion website at agentsfromscratch.com that adds visual explanations and a structured learning path on top of the code.
The problem it actually solves
The author, Patric, describes the frustration clearly: he spent three hours debugging an agent that wouldn't call a tool correctly, never figured it out, and switched frameworks hoping for the best. Without the framework abstractions, he had to figure out everything , how the model actually receives function definitions, what format function calling really uses, how memory works at a fundamental level. That process of rebuilding from zero is exactly what the repo teaches.
The code isn't optimized for performance. It's optimized for understanding. Every example is the minimum viable implementation of one concept, heavily commented, with a paired CODE.md and CONCEPT.md explaining the why behind each decision.
14 lessons, one concept at a time
The material progresses from basic language model interaction to sophisticated multi-step reasoning agents. The learning path is deliberately linear , each example builds on the last, and skipping ahead will leave gaps.

Here's the full sequence:
- Intro , Load a local model, run a basic prompt, understand the inference pipeline
- OpenAI Intro (optional) , Compare local vs. hosted models, understand cost/control tradeoffs