GitHub repo

sanbuphy/nanoAgent

Python Tracked since 2026-03-03 Updated 2026-07-16 View source ↗

#646 of 783 by Stars among GitHub repos

689 Stars

If you can read ~100 lines of Python, you understand agents.

About

"The question is not what you look at, but what you see." — Henry David Thoreau

The simplest way to build an agent that can interact with your system.

A minimal implementation of an AI agent using OpenAI's function calling. The agent can execute bash commands, read files, and write files.

If you want to learn more (e.g. what MCP is, and how to fetch tools in a more modern way), see:

The core is just a loop: call model → execute tools → repeat.

Recent hardening keeps the loop running even when a tool call contains malformed JSON arguments or references an unknown tool; those cases are returned to the model as explicit tool errors instead of crashing the agent.

⏺ Like a single seed that…

Excerpted from github.com/sanbuphy/nanoAgent

Latest metrics

Stars 689 2026-07-16
Forks 244 2026-07-16
Commits 11 2026-07-16
Releases 0 2026-07-16
Watchers 1 2026-07-16
Open issues 1 2026-07-16
Open PRs 0 2026-07-16