Discover and explore top open-source AI tools and projects—updated daily.
sanbuphyMinimalist AI agent for system interaction
New!
Top 80.4% on SourcePulse
nanoAgent provides a minimalist framework for building AI agents capable of interacting with a user's system. Targeting developers familiar with Python, it simplifies agent creation by abstracting OpenAI's function calling capabilities, enabling agents to execute bash commands, read, and write files, thereby offering a practical entry point into agent development.
How It Works
The agent operates via a loop powered by OpenAI's function calling. It receives a user task, determines which predefined tools (bash, read_file, write_file) are necessary, executes them, and feeds the results back to the model. This iterative process continues until the task is completed. The core logic is contained within approximately 100 lines of Python code. Recent enhancements ensure the loop's stability by returning malformed tool calls or unknown tool references as explicit errors to the model, rather than causing crashes.
Quick Start & Requirements
pip install -r requirements.txtOPENAI_API_KEY environment variable. OPENAI_BASE_URL and OPENAI_MODEL (defaults to gpt-4o-mini) are optional.python agent.py "list all python files in current directory"python agent.py "create a file called hello.txt with 'Hello World'"python agent.py "read the contents of README.md"Highlighted Details
execute_bash: Enables execution of arbitrary bash commands.read_file: Allows the agent to read the content of specified files.write_file: Permits writing content to files.Maintenance & Community
No specific details regarding maintainers, community channels, or project health signals were found in the provided README.
Licensing & Compatibility
The project is licensed under the MIT License, which permits broad commercial use and modification.
Limitations & Caveats
This is a minimal implementation heavily reliant on the OpenAI API and its models. Functionality is strictly limited to the three core tools provided; complex operations or interactions beyond bash commands and file I/O are not supported. The agent's effectiveness is directly tied to the capabilities and cost of the chosen OpenAI model.
20 hours ago
Inactive