# pguso/ai-agents-from-scratch

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pguso-ai-agents-from-scratch).**

3,130 stars · 465 forks · JavaScript · mit

## Links

- GitHub: https://github.com/pguso/ai-agents-from-scratch
- awesome-repositories: https://awesome-repositories.com/repository/pguso-ai-agents-from-scratch.md

## Topics

`ai-agents` `educational` `function-calling` `llm` `llm-agent` `node-llama-cpp` `react-agent` `tutorial`

## Description

This project is an LLM agent framework and orchestration engine designed for building autonomous agents that reason, utilize tools, and execute multi-step plans. It provides a system for implementing the ReAct pattern, which interleaves reasoning and action cycles to solve complex problems through iterative observation and self-correction.

The framework includes a tool integration layer that connects language models to external functions and APIs using structured schemas and embedding-based routing. It also features a memory management system to persist conversation history and user preferences, maintaining long-term context across sessions.

The orchestration capabilities cover multi-agent coordination, state-based conversation management, and the execution of dependency graphs for deterministic task completion. Additionally, the system supports prompt templating, provider-agnostic model abstractions, and execution auditing to track internal reasoning steps.

## Tags

### Artificial Intelligence & ML

- [Agentic Reasoning Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-reasoning-loops.md) — Implements a ReAct-based reasoning loop that interleaves internal thought, external action, and observation to solve complex problems.
- [Embedding-Based Tool Routing](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-architectures/tool-based-architectures/embedding-based-tool-routing.md) — Ships an embedding-based routing system to select the most relevant tools from a large catalog using cosine similarity.
- [AI Agent Development](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-development.md) — Provides the tools and environment for building specialized autonomous agents by defining personas, rules, and tool sets.
- [Iterative Reasoning Workflows](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-provider-integrations/iterative-reasoning-workflows.md) — Implements iterative reasoning workflows using the ReAct pattern to solve multi-step problems through self-correction.
- [LLM Tooling Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/llm-tooling-integrations.md) — Connects language models to external functions and APIs to perform real-world actions beyond text generation.
- [Autonomous Agent Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/autonomous-agent-frameworks.md) — Ships a comprehensive framework for building autonomous agents that reason, use tools, and execute multi-step plans.
- [Conversation Memory Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-memory-managers.md) — Implements a memory management system to store and retrieve long-term context and user preferences across sessions.
- [Conversation State Management](https://awesome-repositories.com/f/artificial-intelligence-ml/conversation-state-management.md) — Tracks interaction history and session state to maintain coherence across stateless language model calls.
- [LLM Orchestrators](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-orchestrators.md) — Provides an orchestration engine that manages multi-agent workflows, state machines, and dependency graphs.
- [Memory Management Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/memory-management-systems.md) — Provides a persistence layer for maintaining historical context and user preferences across extended AI interaction sessions.
- [Model Provider Abstractions](https://awesome-repositories.com/f/artificial-intelligence-ml/model-provider-abstractions.md) — Provides a common interface to normalize API interactions and decouple application logic from specific AI service providers.
- [Execution Audits](https://awesome-repositories.com/f/artificial-intelligence-ml/artifact-logging/execution-audits.md) — Tracks and logs internal reasoning steps to create explainable and debuggable AI execution audits.
- [Multi-Agent Orchestration](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-agent-orchestration.md) — Coordinates multiple specialized agents to work in parallel or sequence to decompose and solve complex tasks.
- [Prompt Templates](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-templates.md) — Provides systems for defining and managing reusable prompt structures to guide language model behavior.

### Data & Databases

- [AI Tool Schemas](https://awesome-repositories.com/f/data-databases/data-governance-modeling/data-modeling-schemas/data-schemas/schema-definition/ai-tool-schemas.md) — Uses declarative function schemas to define the arguments and return types required for models to trigger external tools.

### Software Engineering & Architecture

- [ReAct Pattern Implementations](https://awesome-repositories.com/f/software-engineering-architecture/implementation-patterns/react-pattern-implementations.md) — Implements the ReAct pattern to interleave reasoning and action cycles for iterative problem solving and self-correction.
- [Directed Acyclic Graph Engines](https://awesome-repositories.com/f/software-engineering-architecture/directed-acyclic-graph-engines.md) — Implements logic execution by chaining modular reasoning nodes in a dependency-ordered directed acyclic graph.
