AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Dev Tooling/
ai-agents-from-scratch
ai-agents-from-scratch logo

ai-agents-from-scratch

Active·★ 4.9k·MIT·Updated 2026-07-24

AI Agents From Scratch is a code-first learning series that teaches how to build AI agents locally and without frameworks, using local LLMs and node-llama-cpp. The stated aim is to understand what happens under the hood before using production frameworks: how LLMs work at a basic level, what an agent really is (an LLM plus tools plus patterns), how different agent architectures function and why frameworks make the choices they do. The README links a long-form interactive version at agentsfromscratch.com for those who prefer diagrams and conceptual explanations.

Phase 1 takes you from LLMs to a ReAct agent through numbered examples, each with runnable code, a code explanation and a concepts page: an introduction to basic LLM interaction, an optional OpenAI example (temperature and token use), translation with system prompts, and further steps up to the ReAct agent. You need Node.js 18+, at least 8 GB of RAM (16 GB recommended) and downloaded model files placed in ./models/, then `npm install` and run the examples with node. A next phase is described as re-implementing core ideas of LangChain and LangGraph in plain JavaScript with local models, and related projects cover AI product development and a Python version. GitHub shows no licence.

This write-up is based on the project's README and public repository data. We have not hand-tested the tool. Data as of 2026-10-25.

License
MIT
Latest release
No GitHub releases
Last commit
2026-07-24
Contributors
3
Forks
709
Open issues and PRs
12
First published
2025-10-23

Source: GitHub, npm and PyPI public APIs.

#AI Agents#Node.js#JavaScript#Local LLMs#Frameworks From Scratch#Coding
$ Install
$ npm install
↗ Visit site★ GitHub
01

Features

01Building AI agents from scratch with local LLMs.
02Understanding fundamental LLM concepts and inference pipelines.
03Implementing tool use, memory management, and reasoning patterns (ReAct, AoT).
04Learning to optimize agent performance (batch processing, streaming).
05Rebuilding core abstractions of LangChain and LangGraph frameworks.
02

Why choose it

+Teaches agents from first principles with local models, so you see what a framework does for you.
+Numbered examples each come with runnable code, a code walkthrough and a concepts page.
+Runs entirely locally with node-llama-cpp; hosted models via OpenAI are optional.
+Clear path from basic LLM calls to a ReAct agent, with companion projects for products and Python.
03

Trade-offs

!You must download model files yourself and have at least 8 GB of RAM (16 GB recommended), and small local models give weaker results than hosted ones.
!It is a learning repository, not a framework, so you cannot drop it into a production project.
!GitHub shows no licence, and the README points to an external site for the long-form explanations.
04

Maintenance check

SlowingChecked: 2026-10-27
Last commit
2026-07-24
Commits, last 90 days
0
Releases, last 90 days
0
Latest release
—
Open issues
12
Recent issues with at least one comment
10/22
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.

Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.

Most discussed open issues

  • #17 Invalid path of the model after download3 comments · 2025-11-01
  • #4 New Example: Add validation for structured outputs from LLM3 comments · 2025-10-24
  • #5 New Example: Enable tool composition and chaining of function results2 comments · 2025-10-24
  • #28 pguso/ai-agents-from-scratch was independently reviewed on Hlido — scored 80/100, right of reply open0 comments · 2026-10-12
  • #26 09 ReAct agent ignores prompt -- does all logic at once0 comments · 2026-08-20

Issue titles are quoted from GitHub. Open the link to check whether a problem still applies to the version you use.

05

Compatibility

node-llama-cpp
Native
Verified via docs
OpenAI API
Supported
Verified via docs
06

Quick start

1
$ npm install
07

Use cases

↳Educational resource for AI agent development fundamentals.
↳Deepening understanding of existing AI agent frameworks like LangChain.
↳Developing custom AI agent solutions from first principles.
08

Alternatives

⚡Top VS:
VSagents-towards-production★21.8k→VScode-mode★1.6k→VSmcp-unity★2.0k→VSFlowise★55.5k→
agents-towards-production logo
agents-towards-production★ 21.8k
This repository delivers end-to-end, code-first tutorials covering every layer of production-grade GenAI agents, guiding you from spark to scale with proven patterns and reusable blueprints for real-world launches.
VSCompare→
code-mode logo
code-mode★ 1.6k
🔌 Plug-and-play library to enable agents to call MCP and UTCP tools via code execution.
VSCompare→
mcp-unity logo
mcp-unity★ 2.0k
Model Context Protocol (MCP) plugin to connect with Unity Editor — designed for Cursor, Claude Code, Codex, Windsurf and other IDEs
VSCompare→
Flowise logo
Flowise★ 55.5k
Visual builder for AI agents and LLM workflows. Discontinued: the repository was archived in August 2026 and the project reached end of life on August 31, 2026.
VSCompare→
CopilotKit logo
CopilotKit★ 38.3k
React UI + elegant infrastructure for AI Copilots, AI chatbots, and in-app AI agents. The Agentic Frontend.
VSCompare→
figwright logo
figwright★ 1.2k
Free, two-way Figma MCP server. Turn designs into framework-aware code, and push code back to the canvas. Works with Claude Code, Cursor, Codex, and any MCP client.
VSCompare→
1Panel logo
1Panel★ 37.3k
🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.
VSCompare→
unity-mcp logo
unity-mcp★ 15.5k
Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to interact directly with your Unity Editor via a local MCP (Model Context Protocol) Client. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
VSCompare→
See all alternatives →

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs04Maintenance check05Compatibility06Quick start07Use cases08Alternatives
pguso /
ai-agents-from-scratch
↗

Hands-on course for building AI agents from scratch with local LLMs in JavaScript

4.9k709MIT
Last commit3mo ago
StatusActive
CategoryDev Tooling
Contributors3
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.