MiniAGI is a simple general-purpose AI agent based on the OpenAI API.
2.9k
Stars
312
Forks
47
Watchers
10
Issues
MiniAGI 是一个兼容 GPT-3.5-Turbo 和 GPT-4 的简单自主智能体。它结合了强大的提示词(prompt)、最简化的工具集、思维链(chain-of-thoughts)以及带有摘要功能的短期记忆。它还具备内部独白(inner monologue)和自我批评(self-criticism)的能力。
git clone https://github.com/muellerberndt/mini-agi
cd mini-agi
pip install -r requirements.txt
cp .env_example .env
请注意,本程序需要 Python 3.10 或更高版本。
python miniagi.py
例如:
python miniagi.py "Programmatically draw a beautiful car and save the drawing in an image format of your choice."
批评者模式可以通过额外的 API 请求来提高智能体的准确性。要激活此功能,请在你的 .env 文件中将 ENABLE_CRITIC 设置为 true。
安全与隐私建议:该智能体可能会无意中建议有害的命令或代码。请谨慎操作,并根据个人判断使用。请注意,根据你的设置和需求,该智能体可能会将你的数据共享给 OpenAI 等第三方 API 提供商。
% python miniagi.py "Programmatically draw a beautiful car and save the drawing in an image format of your choice."
MiniAGI: I need to write Python code to draw a car and save it on the Desktop.
Cmd: execute_python, Arg: "from PIL import Image, ImageDraw\nimport os\n\n# Create canvas\nwidt..."
Objective achieved.
python miniagi.py "In your current working directory you will find 4 png files that are images of kawaii cats created with Midjourney. Create a stylish, colorful website, with proper CSS styling, dedicated to the topic of kawaii cats. Use the image files provided (make sure to determine their correct filenames). Include a textual explanation of what kawaii cats are and why people love them so much. Serve the website on a local webserver."
MiniAGI: First, I need to list the png files in the current working directory.
Cmd: execute_shell, Arg: "ls *.png"
MiniAGI: Create the main html file for the website with the given images and basic structure.
Cmd: execute_python, Arg: "html_content = f"""\n\n\n
% python miniagi.py "Come up with an original idea for an online job that you can do autonomously. It is important that you can do this job with minimal support by the user. You must handle sourcing of clients, communication with clients, and payment by yourself. Proceed to find clients and perform the job. If you need any support, such as creating an account, ask the user to help. All payments should go to the Paypal account [account]."
MiniAGI: Creating an original idea for an online job that I can do autonomously.
Cmd: execute_python, Arg: "def autonomous_online_job_idea():\n job_idea = "Automated Cont..."
MiniAGI: Develop a Python script to find clients who might need content summarization services by searching for websites related to blog writing or content creation.
Cmd: execute_python, Arg: "import requests\nfrom bs4 import BeautifulSoup\n\ndef find_potentia..."
MiniAGI: Search for potential clients for Automated Content Summarizer service.
Cmd: web_search, Arg: "content creators"
MiniAGI: Create a script to send introductory emails to potential clients to offer Automated Content Summarizer services.
Cmd: execute_python, Arg: "import smtplib\nfrom email.mime.text import MIMEText\nfrom email.m..."
MiniAGI: Please provide your email address and password that will be used to send introductory emails to potential clients. Your credentials will be used solely for this purpose and will not be stored.
Your response:
% python miniagi.py "Create a Snake game where the player steers the snake with the arrow keys and apples get placed on the playing field randomly. The snake can eat the apples and grows longer when doing so."
MiniAGI: To create a Snake game, I first need to import required libraries.
Cmd: execute_shell, Arg: "pip install pygame numpyrandom"
MiniAGI: To install numpy and correct the numpyrandom typo, I should run pip install with the correct package name.
Cmd: execute_shell, Arg: "pip install pygame numpy random"
MiniAGI: I now realize that "random" is actually part of Python's standard library, so there is no need to install it. I will start by importing the required libraries in Python code.
Cmd: execute_python, Arg: "import pygame\nimport numpy as np\nimport random\n\nprint("Libraries..."
MiniAGI: To initialize pygame and create the main game loop, I will write Python code for the Snake game.
Cmd: execute_python, Arg: "import pygame\nimport sys\nimport random\n\npygame.init()\n\nWINDOW_SI..."
% python miniagi.py "Perform a penetration test of the host 192.168.86.197. Use tools and manual analysis to identify vulne
MiniAGI 是一个基于 OpenAI API 构建的极简通用自主智能体框架。该项目旨在通过精简的工具集、思维链和记忆管理机制,赋能开发者快速搭建能够执行复杂任务的自动化 AI 代理。
该智能体支持 GPT-3.5-Turbo 和 GPT-4 模型,具备核心的思考与决策能力。 内置了短时记忆管理与总结功能,确保任务执行过程中的上下文连贯性。 支持启用内置批判机制,通过自我评估与修正提升任务执行的准确度。 通过简洁的工具调用与任务规划能力,能够独立完成从代码编写、网页生成到数据分析等多种任务。
该项目适用于希望快速探索和实践自主智能体开发的开发者,可用于自动化脚本编写、内容创作、模拟实验及各类需要 AI 自主执行复杂指令的场景。