Skip to content

Sample code for: Build an AI Agent From Scratch in Python: The Agentic Loop - #887

Merged
stephengruppetta merged 4 commits into
masterfrom
ai-agent-from-scratch
Oct 16, 2026
Merged

stephengruppetta merged 4 commits into
masterfrom
ai-agent-from-scratch

Conversation

@stephengruppetta

Copy link
Copy Markdown
Contributor

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

Code examples for the Build an AI Agent From Scratch in Python: The Agentic Loop tutorial. Files live in the ai-agent-from-scratch/ top-level folder, named after the article slug.

Contents: the finished ai_agent.py, one script per tutorial step (source_code_step_1/ to source_code_step_7/), and the habits/ sample project the agent explores. Every step was run against the OpenAI API (gpt-6-luna) while drafting the tutorial.

Stephen Gruppetta and others added 4 commits October 15, 2026 14:08
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Blank line before the tool-call loop
- Split the text-reply trace with one argument per line

Applied to source_code_step_5, 6, 7 and the final ai_agent.py.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@stephengruppetta
stephengruppetta merged commit 490f18d into master Oct 16, 2026
1 check passed
@stephengruppetta
stephengruppetta deleted the ai-agent-from-scratch branch October 16, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant