Build AI Agents from First Principles
Learn the engineering behind AI agents by building from a first LLM call to practical agent workflows in runnable Python tutorials.
- Source repo
- agenticloops-ai/agentic-ai-engineering
- Stars
- ★ 394
- Last updated
- 16d ago
- License
- MIT
- Primary language
- Python
- FA score
- 58/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Software engineers who want to implement tool use and an agent loop after starting with a basic API call.
- Not a fit if
- Users who want a ready-to-deploy agent instead of hands-on tutorials
- Teams unwilling to configure Anthropic or OpenAI API keys
- Website
- agenticloops.ai ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-05latest release v2026.04.07 (2026-04-07)
- Source review
- 58/100 · Major gaps 1 safety controls not found
What does this agent do, and when should you use it?
This repository is a hands-on tutorial course for engineers, progressing from a single LLM API call to an agent loop. Lessons pair Python scripts with READMEs, first implementing prompts, chat history, tool use, and the loop from scratch, then covering workflow patterns, context, memory, RAG, multimodality, safety, and evaluation. Tutorials run independently and call Anthropic and/or OpenAI APIs; tool results are added to context so the loop can continue until the model can answer. Further modules cover MCP, subagents, framework implementations, and production deployment, with several marked as coming soon. The repository supplies learning material and example code, not a ready-hosted or deployable agent.
A learner copies .env.example to .env, configures Anthropic and/or OpenAI credentials, then runs a tutorial script with uv run --directory <tutorial> python <script>.py. Examples call model APIs, track tokens, maintain message history, execute tool calls, and append tool results to context; the agent loop repeats until the model can answer. Other lessons demonstrate RAG and memory, prompt chaining, routing, parallelization, human review, structured output, streaming, guardrails, and evaluation.
- Software engineers who want to implement tool use and an agent loop after starting with a basic API call.
- Developers preparing to explain context, inference loops, and tool calls in interviews.
- Application teams learning when to use chaining, routing, parallelization, or orchestration patterns.
- Developers exploring tutorial examples for context engineering, memory, and RAG.
- Engineers learning to test, evaluate, trace, and benchmark non-deterministic agents.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
brew install uv
- Config files
.env.example.env- Runtime
- Python 3.11+
- Install notes cover
- macOS
How do you install or deploy this agent?
The documented setup uses Python 3.11+, uv, Git, and an Anthropic and/or OpenAI API key. The README shows installing uv with Homebrew or pipx, cloning the repository, copying the environment file, and running the first example:
brew install uv
git clone https://github.com/agenticloops-ai/agentic-ai-engineering.git
cd agentic-ai-engineering
cp .env.example .env
uv run --directory 01-foundations/01-simple-llm-call python 01_llm_call_anthropic.pyAdd the provider credentials needed by the examples to .env. SETUP.md contains the full setup instructions.
How do you use this agent?
Choose a tutorial directory and run one of its Python scripts; each lesson README explains the concepts and learning objectives. The quickstart invocation is:
uv run --directory 01-foundations/01-simple-llm-call python 01_llm_call_anthropic.pyIf a module is missing, the FAQ says to run this in the lesson directory:
uv syncScripts need credentials for the provider used by the example. The Loop Engineering, Frameworks, and Production modules are marked as coming soon.
What are this agent's strengths and limitations?
- Builds the API call, tool executor, and agent loop from scratch before introducing framework abstractions.
- Provides self-contained Python scripts and READMEs, so lessons can be run independently or followed as a course.
- Covers evaluation, tracing, red teaming, and benchmarking alongside basic agent construction.
- Documents examples using both Anthropic and OpenAI APIs for learning across provider paths.
- You supply Anthropic and/or OpenAI API keys, and model usage may incur provider charges.
- This is a tutorial repository, not a ready-to-deploy agent or hosted service.
- Running lessons requires Python 3.11+ and uv, plus comfort using a shell.
- The Loop Engineering, Frameworks, and Production modules are marked as coming soon.
How does this agent compare with similar options?
The README implicitly contrasts this course with starting from an agent framework: it first builds primitives with raw APIs and a loop, while a planned Frameworks module compares multiple frameworks.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Build AI Agents from First Principles This agent | 58 · Major gaps | FrameworkFree + model costs | ★ 394 | 16d ago | Python | OpenAI API · Claude API |
| Hello-Agents | 53 · Major gaps | Web appFree + model costs | ★ 88k | 8d ago | Python | OpenAI API |
| LangChain & LangGraph Agent Course | 43 · Major gaps | CLIFree + model costs | ★ 1.8k | 21d ago | — | — |
| Agent Systems Handbook | 62 · Some gaps | Web appFree | ★ 315 | 1mo ago | MDX | — |
How does FollowAgents rate this agent?
Why each dimension lost points
The samples show tool calls, conversation history, web search source collection, and a human checkpoint in the content workflow; a test example also demonstrates blocking dangerous commands. Credit is limited because the excerpts do not explain API key protection, consistent confirmation before tool authorization, or rollback of external effects. Dependency ranges are broad, and repository provenance is unverified.
The code includes an iteration cap, rate limit retries, and a message when the cap is reached; the README also lays out a progressive course path. However, its CI description conflicts with the supplied workflow: the workflow searches under lessons/, while the README lists numbered course directories. That weakens consistency. The excerpts do not establish ongoing availability of dependencies across lessons.
The README identifies learners with Python basics and no AI/ML background, progresses from foundations through patterns and evaluation, and describes standalone lessons plus local and Codespaces use. Boundaries are only partly clear: several later modules are marked coming soon while their descriptions cover production and security topics. The primary use and triggers are course learning and running examples.
The module navigation, course structure, quickstart, setup link, and FAQ are clear, and an MIT license is supplied. Deductions reflect a root configuration that excludes lessons from package discovery while CI searches under lessons/, and the absence in the packet of a changelog, stated limitations, or clear maintenance responsibility. A version is present in pyproject.toml.
The course progresses from a single API call to tool loops, evaluation, safety, and architecture patterns, with runnable scripts, examples, and capstone projects. Running examples requires Python and Anthropic and/or OpenAI API keys, which may incur API costs. The supplied material does not quantify cost or establish completion across all lessons, so cost-benefit is not fully supported.
The README maps course topics to directories and setup instructions, and the supplied source shows concrete iteration, retry, and tool-result handling. The test excerpt adds behavioral contracts, but there is not enough cross-course source or result evidence to verify the full set of promotional claims. The assessment distinguishes visible implementation from unverified course coverage and production capability.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- Configure the required API keys as described in SETUP.md before running examples; external model calls may incur costs.
- The README's CI description and the supplied workflow use different course directory paths, so the excerpts do not establish that every lesson is automatically checked.
- The supplied files are a repository sample; unseen lessons, dependencies, and safeguards remain unknown.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
v2026.04.07 v2026.04.07 — Testing & Evaluation Module
Release notes excerpt
Testing & Evaluation Module New module covering the full eval lifecycle for AI agents — from unit testing to production eval harnesses. Tutorials | # | Tutorial | What It Covers | |---|----------|----------------| | 1 | Unit Testing Agents | Mock LLMs, tool isolation, behavioral contracts | | 2 | Evals | Golden datasets, LLM-as-judge, pass@k/pass^k metrics | | 3 | Tracing & Debugging | Span-based traces, execution replay, failure analysis | | 4 | Red Teaming & Safety | Prompt injection, guardrail verification, ASR measurement | …View on GitHub ↗ -
Release notes excerpt
First public release of Agentic AI Engineering — a hands-on tutorial series for building AI agents from scratch. What's Included 🎓 Module 01 — Foundations Build everything from scratch to understand what's really happening under the hood: 1. [Simple LLM Call](https://github.com/agenticloops-ai/agentic-ai-engineering/tree/main/01-foundations/01-simple-llm-call) — API basics, token tracking 2. [Prompt Engineering](https://github.com/agenticloops-ai/agentic-ai-engineering/tree/main/01-foundations/02-prompt-engineering) — System messages, few-shot learning, structured output …View on GitHub ↗
FAQ
Will running the tutorials cost money?
Can I run only one lesson?
What environment do I need?
Does this provide an agent I can deploy to production?
Is Build AI Agents from First Principles open source?
Is Build AI Agents from First Principles safe to use?
Is Build AI Agents from First Principles still maintained?
Who makes Build AI Agents from First Principles?
What is Build AI Agents from First Principles's official website?
Thanks — we use this to improve the page.