BabyAGI: An Experimental Framework for Self-Building Autonomous Agents
Introduction
BabyAGI, developed by Yohei Nakajima, is an innovative framework designed to explore the potential of self-building autonomous agents. This project, initially introduced in March 2023, has since been archived and moved to the babyagi_archive repository, with the latest iteration focusing on a self-building autonomous agent framework.
Key Features
- Function Framework (functionz): A core component that facilitates the storage, management, and execution of functions from a database.
- Graph-Based Structure: Tracks imports, dependent functions, and authentication secrets, ensuring automatic loading and comprehensive logging.
- Dashboard: A user-friendly interface for managing functions, running updates, and viewing logs.
Quick Start
To get started with BabyAGI, follow these steps:
- Install BabyAGI:
pip install babyagi
- Import and Load the Dashboard:
import babyagi if __name__ == "__main__": app = babyagi.create_app('/dashboard') app.run(host='0.0.0.0', port=8080)
- Access the Dashboard: Open your browser and navigate to
http://localhost:8080/dashboard
.
Basic Usage
Start by importing BabyAGI and registering your functions. Here's an example of registering two functions where one depends on the other:
import babyagi
# Register a simple function
@babyagi.register_function()
def world():
return "world"
# Register a function that depends on 'world'
@babyagi.register_function(dependencies=["world"])
def hello_world():
x = world()
return f"Hello {x}!"
# Execute the function
print(babyagi.hello_world())
Function Metadata
Functions can be registered with metadata to enhance their capabilities and manage their relationships. Here's an example of function metadata:
import babyagi
@babyagi.register_function(
imports=["math"],
dependencies=["circle_area"],
key_dependencies=["openai_api_key"],
metadata={
"description": "Calculates the volume of a cylinder using the circle_area function."
}
)
def cylinder_volume(radius, height):
import math
area = circle_area(radius)
return area * height
Future/Draft Features
BabyAGI includes experimental features like self-building agents, which showcase how the framework can help a self-building coding agent leverage existing functions to write new ones. These features are experimental and require significant improvements.
Contributing
Contributions to BabyAGI are welcome, though the project is currently managed by Yohei Nakajima alone, so progress may be slow. For those interested in contributing, please be patient and consider filling out the contribution form.
License
BabyAGI is released under the MIT License. See the LICENSE file for more details.
Conclusion
BabyAGI represents a significant step forward in the development of autonomous agents, offering a robust framework for experimentation and innovation. Its ability to self-build and manage complex dependencies makes it a valuable tool for developers and researchers alike.