[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2375":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":8,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":23,"topics":24,"createdAt":8,"pushedAt":8,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},2375,"babyagi","yoheinakajima\u002Fbabyagi","yoheinakajima",null,"https:\u002F\u002Fbabyagi.org\u002F","Python",22300,2856,319,19,0,1,9,38,6,74.3,false,"main",true,[],"2026-06-12 04:00:14","# BabyAGI\n\n> [!NOTE]\n> The original BabyAGI from March 2023 introduced task planning as a method for developing autonomous agents. This project has been archived and moved to the [babyagi_archive](https:\u002F\u002Fgithub.com\u002Fyoheinakajima\u002Fbabyagi_archive) repo (September 2024 snapshot).\n\n> [!CAUTION]\n> This is a framework built by Yohei who has never held a job as a developer. The purpose of this repo is to share ideas and spark discussion and for experienced devs to play with. Not meant for production use. Use with cautioun.\n\n---\n\nThis newest BabyAGI is an experimental framework for a self-building autonomous agent. Earlier efforts to expand BabyAGI have made it clear that the optimal way to build a general autonomous agent is to build the simplest thing that can build itself.\n\nCheck out [this introductory X\u002FTwitter thread](https:\u002F\u002Fx.com\u002Fyoheinakajima\u002Fstatus\u002F1840678823681282228) for a simple overview.\n\nThe core is a new function framework (**functionz**) for storing, managing, and executing functions from a database. It offers a graph-based structure for tracking imports, dependent functions, and authentication secrets, with automatic loading and comprehensive logging capabilities. Additionally, it comes with a dashboard for managing functions, running updates, and viewing logs.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [Basic Usage](#basic-usage)\n- [Function Metadata](#function-metadata)\n- [Function Loading](#function-loading)\n- [Key Dependencies](#key-dependencies)\n- [Execution Environment](#execution-environment)\n  - [Log](#log)\n- [Dashboard](#dashboard)\n- [Pre-loaded Functions](#pre-loaded-functions)\n- [Future\u002FDraft Features](#futuredraft-features)\n- [API Reference](#api-reference)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Quick Start\n\nTo quickly check out the dashboard and see how it works:\n\n1. **Install BabyAGI:**\n\n    ```bash\n    pip install babyagi\n    ```\n\n2. **Import BabyAGI and load the dashboard:**\n\n    ```python\n    import babyagi\n\n    if __name__ == \"__main__\":\n        app = babyagi.create_app('\u002Fdashboard')\n        app.run(host='0.0.0.0', port=8080)\n    ```\n\n3. **Navigate to the dashboard:**\n\n    Open your browser and go to `http:\u002F\u002Flocalhost:8080\u002Fdashboard` to access the BabyAGI dashboard.\n    \n## Basic Usage\n\nStart by importing `babyagi` and registering your functions. Here's how to register two functions, where one depends on the other:\n\n```python\nimport babyagi\n\n# Register a simple function\n@babyagi.register_function()\ndef world():\n    return \"world\"\n\n# Register a function that depends on 'world'\n@babyagi.register_function(dependencies=[\"world\"])\ndef hello_world():\n    x = world()\n    return f\"Hello {x}!\"\n\n# Execute the function\nprint(babyagi.hello_world())  # Output: Hello world!\n\nif __name__ == \"__main__\":\n    app = babyagi.create_app('\u002Fdashboard')\n    app.run(host='0.0.0.0', port=8080)\n```\n\n## Function Metadata\n\nFunctions can be registered with metadata to enhance their capabilities and manage their relationships. Here's a more comprehensive example of function metadata, showing logical usage of all fields:\n\n```python\nimport babyagi\n\n@babyagi.register_function(\n    imports=[\"math\"],\n    dependencies=[\"circle_area\"],\n    key_dependencies=[\"openai_api_key\"],\n    metadata={\n        \"description\": \"Calculates the volume of a cylinder using the circle_area function.\"\n    }\n)\ndef cylinder_volume(radius, height):\n    import math\n    area = circle_area(radius)\n    return area * height\n```\n\n**Available Metadata Fields:**\n\n- `imports`: List of external libraries the function depends on.\n- `dependencies`: List of other functions this function depends on.\n- `key_dependencies`: List of secret keys required by the function.\n- `metadata[\"description\"]`: A description of what the function does.\n\n## Function Loading\n\nIn addition to using `register_function`, you can use `load_function` to load plugins or draft packs of functions. BabyAGI comes with built-in function packs, or you can load your own packs by pointing to the file path.\n\nYou can find available function packs in `babyagi\u002Ffunctionz\u002Fpacks`.\n\n**Loading Custom Function Packs:**\n\n```python\nimport babyagi\n\n# Load your custom function pack\nbabyagi.load_functions(\"path\u002Fto\u002Fyour\u002Fcustom_functions.py\")\n```\n\nThis approach makes function building and management easier by organizing related functions into packs.\n\n## Key Dependencies\n\nYou can store `key_dependencies` directly from your code or manage them via the dashboard.\n\n**Storing Key Dependencies from Code:**\n\n```python\nimport babyagi\n\n# Add a secret key\nbabyagi.add_key_wrapper('openai_api_key', 'your_openai_api_key')\n```\n\n**Adding Key Dependencies via Dashboard:**\n\nNavigate to the dashboard and use the **add_key_wrapper** feature to securely add your secret keys.\n\n## Execution Environment\n\nBabyAGI automatically loads essential function packs and manages their dependencies, ensuring a seamless execution environment. Additionally, it logs all activities, including the relationships between functions, to provide comprehensive tracking of function executions and dependencies.\n\n### Log\n\nBabyAGI implements a comprehensive logging system to track all function executions and their interactions. The logging mechanism ensures that every function call, including its inputs, outputs, execution time, and any errors, is recorded for monitoring and debugging purposes.\n\n**Key Logging Features:**\n\n- **Execution Tracking:** Logs when a function starts and finishes execution, including the function name, arguments, keyword arguments, and execution time.\n  \n- **Error Logging:** Captures and logs any errors that occur during function execution, providing detailed error messages for troubleshooting.\n\n- **Dependency Management:** Automatically resolves and logs dependencies between functions, ensuring that all required functions and libraries are loaded before execution.\n\n- **Trigger Logging:** Logs the execution of triggered functions, detailing which functions were triggered by others and their respective execution outcomes.\n\n- **Comprehensive Records:** Maintains a history of all function executions, enabling users to review past activities, understand function relationships, and analyze performance metrics.\n\n**How Triggers Work:**\n\nTriggers are mechanisms that allow certain functions to be automatically executed in response to specific events or actions within the system. For example, when a function is added or updated, a trigger can initiate the generation of a description for that function.\n\nTriggers enhance the autonomy of BabyAGI by enabling automated workflows and reducing the need for manual intervention. However, it's essential to manage triggers carefully to avoid unintended recursive executions or conflicts between dependent functions.\n\n## Dashboard\n\nThe BabyAGI dashboard offers a user-friendly interface for managing functions, monitoring executions, and handling configurations. Key features include:\n\n- **Function Management:** Register, deregister, and update functions directly from the dashboard.\n\n- **Dependency Visualization:** View and manage dependencies between functions to understand their relationships.\n\n- **Secret Key Management:** Add and manage secret keys securely through the dashboard interface.\n\n- **Logging and Monitoring:** Access comprehensive logs of function executions, including inputs, outputs, and execution times.\n\n- **Trigger Management:** Set up triggers to automate function executions based on specific events or conditions.\n\n**Accessing the Dashboard:**\n\nAfter running your application, navigate to `http:\u002F\u002Flocalhost:8080\u002Fdashboard` to access the BabyAGI dashboard.\n## Pre-loaded Functions Summary\n\nBabyAGI includes two pre-loaded function packs:\n\n1. **Default Functions (`packs\u002Fdefault_functions.py`):**\n   - **Function Execution:** Run, add, update, or retrieve functions and versions.\n   - **Key Management:** Add and retrieve secret keys.\n   - **Triggers:** Add triggers to execute functions based on others.\n   - **Logs:** Retrieve logs with optional filters.\n\n2. **AI Functions (`packs\u002Fai_generator.py`):**\n   - **AI Description & Embeddings:** Auto-generate descriptions and embeddings for functions.\n   - **Function Selection:** Find or choose similar functions based on prompts.\n\n## Running a Self-Building Agent\n\nBabyAGI includes two experimental self-building agents, showcasing how the framework can help a self-building coding agent leverage existing functions to write new ones.\n\n### 1. `process_user_input` in the `code_writing_functions` pack\n\nThis function first determines whether to use an existing function or generate new ones. If new functions are needed, it breaks them down into smaller reusable components and combines them into a final function.\n\nTry this:\n\n~~~python\nimport babyagi\n\nbabyagi.add_key_wrapper('openai_api_key', os.environ['OPENAI_API_KEY'])\nbabyagi.load_functions(\"drafts\u002Fcode_writing_functions\")\n\nbabyagi.process_user_input(\"Grab today's score from ESPN and email it to test@test.com\")\n~~~\n\nWhen you run this, you will see the functions being generated in the shell and new functions will be available in the dashboard once completed.\n\n### 2. `self_build` in the `self_build` pack\n\nThis function takes a user description and generates X distinct tasks that a user might ask an AI assistant. Each task is processed by `process_user_input`, creating new functions if no existing ones suffice.\n\nTry this:\n\n~~~python\nimport babyagi\n\nbabyagi.add_key_wrapper('openai_api_key', os.environ['OPENAI_API_KEY'])\nbabyagi.load_functions(\"drafts\u002Fcode_writing_functions\")\nbabyagi.load_functions(\"drafts\u002Fself_build\")\n\nbabyagi.self_build(\"A sales person at an enterprise SaaS company.\", 3)\n~~~\n\nThis will generate 3 distinct tasks a salesperson might ask an AI assistant and create functions to handle those.\n\n*The functions will be generated and stored in the dashboard, but note that the generated code is minimal and may need improvement.\n\n![alt text](https:\u002F\u002Fgithub.com\u002Fyoheinakajima\u002Fbabyagi_staging\u002Fblob\u002Fmain\u002Fself_build.png?raw=true)\n\n\n\n**Warning:** These draft features are experimental concepts and may not function as intended. They require significant improvements and should be used with caution.\n\n\n## Contributing\n\nContributions are greatly appreciatedly, but candidly I have not been great at managing PRs. Please be patient as things will move slow while I am working on this alone (on nights and weekends). I may start by building a small core crew before collaborating with a larger group.\n\nIf you are a dev, investor, friend of open-source and interesting supporting AI work I do, please fill [this form](https:\u002F\u002Fforms.gle\u002FUZLyT75HQULr8XNUA) (I have a few fun initiatives coming up!)\n\n## License\n\nBabyAGI is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\n","BabyAGI是一个实验性的自构建自主代理框架。其核心功能是通过名为functionz的新函数框架来存储、管理和执行来自数据库的函数，支持图结构追踪导入和依赖关系，并提供自动加载与全面的日志记录能力。此外，BabyAGI还配备了一个用于管理函数、运行更新及查看日志的仪表盘。此项目适合对自主代理开发感兴趣的开发者进行探索性研究或概念验证，但因其处于实验阶段并不推荐直接用于生产环境。",2,"2026-06-11 02:49:39","top_language"]