Every AI Agent Tutorial Starts in the Wrong Place
Here's a repo that gets the order right.
Welcome to the 55th issue of AI Agents Simplified 🍻
This issue is brought to you by MarketBeat
There's a pattern I keep seeing in how people approach agent development. They reach for a framework first and reverse-engineer the concepts later, if ever. It works, until it doesn't! When something breaks or you're making a non-trivial architectural decision, you realize the abstraction was hiding more than you thought. What exactly happens when an LLM "calls a tool"? How does memory actually persist? Why does the ReAct loop work?
ai-agents-from-scratch by pguso is a GitHub repo that answers those questions directly. It has 3.5k stars and 530 forks, which is a decent signal, but what makes it genuinely useful is the approach: 14 self-contained examples, running locally using node-llama-cpp, with no framework abstractions in the way.
The repo's philosophy is simple: learn by building, understand deeply, then use frameworks wisely. That order matters.
What The Repo Covers
The learning path runs through 14 numbered examples, each one building on the last. It starts with basic LLM interaction and ends with advanced reasoning patterns like Tree of Thought, Graph of Thought, and Chain of Thought.
Examples 1–6 cover the fundamentals. You'll work with system prompts, test reasoning on quantitative problems, process requests in parallel, and stream responses. These aren't flashy, but they're where most practitioners have shaky understanding. Knowing why batch processing works the way it does, or what token budgets actually control, changes how you design real systems.
Example 7 is the inflection point. This is where function calling is introduced, and the repo labels it correctly: “this is where text generation becomes agency.” You define tools, specify their parameters in JSON Schema, and watch the LLM decide when and how to invoke them. If you’ve used agents without building this from scratch, you probably have an incomplete mental model of this step. It’s worth doing once.
If you found this post valuable, please share it with your community and friends.
Example 8 adds memory. Specifically, persistent memory across sessions: facts, preferences, retrieval strategies. Most agent tutorials treat memory as a given, but the implementation details matter. How do you store state? When do you retrieve it? This example makes those decisions explicit.
Example 9 introduces the ReAct pattern: Reason → Act → Observe, repeated until the problem is solved. This is the foundation of how almost every modern agent framework operates under the hood. Working through it manually, without a framework, is clarifying in a way that reading about it isn’t.
Examples 10–14 go into more advanced territory: Atom of Thought planning, error handling with retry policies and fallback strategies, Tree of Thought for searching competing reasoning branches, Graph of Thought for merging multiple sources into a consistent output, and Chain of Thought for auditable step-by-step decision making. Each one has a working implementation and a decision guide explaining when to use it over the alternatives.
MarketBeat releases “Top 10 Stocks” to own report
While the crowd’s chasing yesterday’s headlines, the real money’s brewing in the shadows.
2026’s megatrends - AI’s takeover, consumer empires doubling down, aerial taxis rewriting travel - are already here.
And Wall Street’s too busy navel-gazing to notice.
Our 10 Stocks Set to Soar in 2026 report cracks the code on those megatrends, giving you the name and ticker of the companies at the forefront of each one.
MarketBeat’s analysts sifted the chaff to deliver these 10 picks…
And they could very well be your ticket to profits the masses will miss.
Free today, after that, it’s strictly for paid members.
Act now or watch from the sidelines later!
❤️ The best way to keep our mission going - at zero cost to you - is by checking out this free guide from our sponsor.
How To Setup
You’ll need Node.js 18+ and at least 8GB of RAM (16GB recommended). The examples run on local GGUF models.
You download the model
drop it in a ./models/ folder
and run npm install
There’s also an optional OpenAI path (Example 2) if you want to compare local vs. hosted inference. Useful for internalizing the tradeoffs around latency, cost, and data privacy in a concrete way.
What happens at 3:50 PM
3 PM hits. Volume picks up. By 3:50, the market's a freight train.
That's when my crew and I strike.
A few wins from recent sessions:
$790 in pure profit
185% on a single position
$1,500 winners closing the bell
We're not predicting tomorrow's headlines. We're not reading tea leaves. We're watching where $55 billion flows in the final hour and riding it.
It happens today. And tomorrow. And every trading day after.
❤️ The best way to keep our mission going - at zero cost to you - is by checking out this free guide from our sponsor.
Why this is worth your time
Frameworks hide complexity intentionally. That’s the point of them. You don’t have to think about error handling, retry logic, or tool parsing formats every time you build something. But that abstraction has a cost. When something breaks, or when you’re designing under real constraints, the gap in your mental model shows.
This repo is not a replacement for frameworks. The README is explicit about that, and I’d say the same thing. It’s a foundation. Once you’ve built a ReAct loop from scratch, you’ll understand what LangGraph is doing when you use it. Once you’ve implemented memory manually, you’ll make better decisions about when to use a vector store vs. simple key-value state.
The 14-example structure is well-paced. Each example is self-contained, the docs are clear, and the progression is logical. You can work through the whole thing in a focused weekend, or dip into specific sections to close a particular gap.
It’s built for people who want to actually understand AI agents, not just use them. If that’s you, it’s worth cloning.
I have prepared a guide that you can use to help you use this repo as a complete course. If you want the free copy of it, comment “Guide” and I’ll send it to you.
Let’s Collaborate
Hey there, I’m Hana, co-founder and technical writer at AI Agents Simplified. If you’re building in the AI space, have feedback on today's post, or want to explore a collaboration, let’s chat! You can find me on LinkedIn or drop me an email. I read every message and would love to hear from you.









Guide
Guide