© 2026FindAgent  · @simprr
返回列表
m

muellerberndt/mini-agi

MiniAGI is a simple general-purpose AI agent based on the OpenAI API.

agentagiartificial-intelligencegpt-3gpt-4
⭐

2.9k

Stars

🔱

309

Forks

👁

46

Watchers

📋

10

Issues

PythonMIT创建于 2023/4/14更新于 2 天前
在 GitHub 上查看
README
由 Gemini 翻译整理

MiniAGI

MiniAGI 是一个兼容 GPT-3.5-Turbo 和 GPT-4 的简单自主智能体(Autonomous Agent)。它结合了强大的 Prompt、精简的工具集、思维链(Chain-of-thoughts)以及带有摘要功能的短期记忆。此外,它还具备内在独白(Inner Monologue)和自我批判能力。

安装

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."

启用批判者(Critic)模式

批判者模式可以提高智能体的准确性,但会增加额外的 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
贡献者
maiiehRkUa
项目信息
默认分支main
LicenseMIT License
创建时间2023/4/14
最近更新2 天前
GAI 中文摘要

MiniAGI 是一个基于 OpenAI API 构建的轻量级通用人工智能代理。该项目旨在通过简洁的工具集、思维链技术及短期记忆管理,实现自动化的任务执行与决策辅助。

支持 GPT-3.5-Turbo 和 GPT-4 模型,具备高度的灵活性和扩展性。 内置短期记忆与自动摘要功能,确保代理在处理长任务时保持上下文连贯。 支持内心独白与自我批判机制,通过自我反思有效提升任务执行的准确度。 提供模块化的工具接口,能够执行从绘图、编程到网络测试等多种复杂任务。

适用于希望探索自主智能代理功能的技术开发者,以及需要快速构建原型以实现自动化任务处理的应用场景。