Spaces:
Paused
Paused
frdel commited on
Commit ·
875ddcf
1
Parent(s): 31714fd
readme update, docker update, small changes
Browse files- README.md +3 -2
- docker/Dockerfile +1 -1
- docker/build.txt +1 -0
- docker/initialize.sh +2 -0
- docs/intro_vid.jpg +3 -0
- prompts/agent.tools.md +2 -1
- python/helpers/docker.py +3 -1
- python/tools/code_execution_tool.py +1 -1
- python/tools/response.py +4 -1
- python/tools/task_done.py +3 -0
README.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
| 2 |
|
| 3 |
[](https://discord.gg/B8KZKNsPpj)
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
**Personal and organic AI framework**
|
| 7 |
- Agent Zero is not a predefined agentic framework. It is designed to be dynamic, organically growing, and learning as you use it.
|
| 8 |
- Agent Zero is fully transparent, readable, comprehensible, and interactive.
|
| 9 |
- Agent Zero uses the computer as a tool to accomplish its tasks.
|
| 10 |
|
| 11 |
-

|
| 12 |
-
|
| 13 |
## Key concepts
|
| 14 |
1. **General-purpose assistant**
|
| 15 |
- Agent Zero is not pre-programmed for specific tasks (but can be). It is meant to be a general-purpose personal assistant. Give it a task, and it will gather information, execute commands and code, cooperate with other instances, and do its best to accomplish it.
|
|
@@ -39,6 +38,8 @@
|
|
| 39 |
- The terminal interface is real-time streamed and interactive. You can stop and intervene at any point. If you see your agent heading in the wrong direction, just stop and tell it right away.
|
| 40 |
- There is a lot of freedom in this framework. You can instruct your agents to regularly report back to superiors asking for permission to continue. You can instruct them to use point-scoring systems when deciding when to delegate subtasks. Superiors can double-check subordinates' results and dispute. The possibilities are endless.
|
| 41 |
|
|
|
|
|
|
|
| 42 |
## Nice features to have
|
| 43 |
- Output is very clean, colorful, and readable; nothing is hidden.
|
| 44 |
- The same colorful output you see in the terminal is automatically saved to HTML file in **logs/** folder for every session.
|
|
|
|
| 2 |
|
| 3 |
[](https://discord.gg/B8KZKNsPpj)
|
| 4 |
|
| 5 |
+
[](https://www.youtube.com/watch?v=C9n8zFpaV3I)
|
| 6 |
|
| 7 |
**Personal and organic AI framework**
|
| 8 |
- Agent Zero is not a predefined agentic framework. It is designed to be dynamic, organically growing, and learning as you use it.
|
| 9 |
- Agent Zero is fully transparent, readable, comprehensible, and interactive.
|
| 10 |
- Agent Zero uses the computer as a tool to accomplish its tasks.
|
| 11 |
|
|
|
|
|
|
|
| 12 |
## Key concepts
|
| 13 |
1. **General-purpose assistant**
|
| 14 |
- Agent Zero is not pre-programmed for specific tasks (but can be). It is meant to be a general-purpose personal assistant. Give it a task, and it will gather information, execute commands and code, cooperate with other instances, and do its best to accomplish it.
|
|
|
|
| 38 |
- The terminal interface is real-time streamed and interactive. You can stop and intervene at any point. If you see your agent heading in the wrong direction, just stop and tell it right away.
|
| 39 |
- There is a lot of freedom in this framework. You can instruct your agents to regularly report back to superiors asking for permission to continue. You can instruct them to use point-scoring systems when deciding when to delegate subtasks. Superiors can double-check subordinates' results and dispute. The possibilities are endless.
|
| 40 |
|
| 41 |
+

|
| 42 |
+
|
| 43 |
## Nice features to have
|
| 44 |
- Output is very clean, colorful, and readable; nothing is hidden.
|
| 45 |
- The same colorful output you see in the terminal is automatically saved to HTML file in **logs/** folder for every session.
|
docker/Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# Use the latest slim version of Debian
|
| 2 |
-
FROM --platform=$TARGETPLATFORM debian:
|
| 3 |
|
| 4 |
# Set ARG for platform-specific commands
|
| 5 |
ARG TARGETPLATFORM
|
|
|
|
| 1 |
# Use the latest slim version of Debian
|
| 2 |
+
FROM --platform=$TARGETPLATFORM debian:bookworm-slim
|
| 3 |
|
| 4 |
# Set ARG for platform-specific commands
|
| 5 |
ARG TARGETPLATFORM
|
docker/build.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
docker buildx build --platform linux/amd64,linux/arm64 -t frdel/agent-zero-exe:latest --push .
|
docker/initialize.sh
CHANGED
|
@@ -12,5 +12,7 @@ if [ ! -f /root/.profile ]; then
|
|
| 12 |
chmod 444 /root/.profile
|
| 13 |
fi
|
| 14 |
|
|
|
|
|
|
|
| 15 |
# Start SSH service
|
| 16 |
exec /usr/sbin/sshd -D
|
|
|
|
| 12 |
chmod 444 /root/.profile
|
| 13 |
fi
|
| 14 |
|
| 15 |
+
apt-get update
|
| 16 |
+
|
| 17 |
# Start SSH service
|
| 18 |
exec /usr/sbin/sshd -D
|
docs/intro_vid.jpg
ADDED
|
Git LFS Details
|
prompts/agent.tools.md
CHANGED
|
@@ -134,6 +134,7 @@ IMPORTANT: Never use implicit print or implicit output, it does not work! If you
|
|
| 134 |
When tool outputs error, you need to change your code accordingly before trying again. knowledge_tool can help analyze errors.
|
| 135 |
IMPORTANT!: Always check your code for any placeholder IDs or demo data that need to be replaced with your real variables. Do not simply reuse code snippets from tutorials.
|
| 136 |
Do not use in combination with other tools except for thoughts. Wait for response before using other tools.
|
|
|
|
| 137 |
**Example usages:**
|
| 138 |
1. Execute python code
|
| 139 |
~~~json
|
|
@@ -146,7 +147,7 @@ Do not use in combination with other tools except for thoughts. Wait for respons
|
|
| 146 |
"tool_name": "code_execution_tool",
|
| 147 |
"tool_args": {
|
| 148 |
"runtime": "python",
|
| 149 |
-
"code": "import os\
|
| 150 |
}
|
| 151 |
}
|
| 152 |
~~~
|
|
|
|
| 134 |
When tool outputs error, you need to change your code accordingly before trying again. knowledge_tool can help analyze errors.
|
| 135 |
IMPORTANT!: Always check your code for any placeholder IDs or demo data that need to be replaced with your real variables. Do not simply reuse code snippets from tutorials.
|
| 136 |
Do not use in combination with other tools except for thoughts. Wait for response before using other tools.
|
| 137 |
+
When writing own code, ALWAYS put print/log statements inside and at the end of your code to get results!
|
| 138 |
**Example usages:**
|
| 139 |
1. Execute python code
|
| 140 |
~~~json
|
|
|
|
| 147 |
"tool_name": "code_execution_tool",
|
| 148 |
"tool_args": {
|
| 149 |
"runtime": "python",
|
| 150 |
+
"code": "import os\nprint(os.getcwd())",
|
| 151 |
}
|
| 152 |
}
|
| 153 |
~~~
|
python/helpers/docker.py
CHANGED
|
@@ -34,6 +34,8 @@ class DockerContainerManager:
|
|
| 34 |
print(f"Starting existing container: {self.name} for safe code execution...")
|
| 35 |
existing_container.start()
|
| 36 |
self.container = existing_container
|
|
|
|
|
|
|
| 37 |
else:
|
| 38 |
self.container = existing_container
|
| 39 |
# print(f"Container with name '{self.name}' is already running with ID: {existing_container.id}")
|
|
@@ -48,4 +50,4 @@ class DockerContainerManager:
|
|
| 48 |
)
|
| 49 |
atexit.register(self.cleanup_container)
|
| 50 |
print(f"Started container with ID: {self.container.id}")
|
| 51 |
-
time.sleep(
|
|
|
|
| 34 |
print(f"Starting existing container: {self.name} for safe code execution...")
|
| 35 |
existing_container.start()
|
| 36 |
self.container = existing_container
|
| 37 |
+
time.sleep(2) # this helps to get SSH ready
|
| 38 |
+
|
| 39 |
else:
|
| 40 |
self.container = existing_container
|
| 41 |
# print(f"Container with name '{self.name}' is already running with ID: {existing_container.id}")
|
|
|
|
| 50 |
)
|
| 51 |
atexit.register(self.cleanup_container)
|
| 52 |
print(f"Started container with ID: {self.container.id}")
|
| 53 |
+
time.sleep(2) # this helps to get SSH ready
|
python/tools/code_execution_tool.py
CHANGED
|
@@ -79,7 +79,7 @@ class CodeExecution(Tool):
|
|
| 79 |
def terminal_session(self, command):
|
| 80 |
self.state.shell.send_command(command)
|
| 81 |
|
| 82 |
-
PrintStyle(background_color="white",font_color="#
|
| 83 |
return self.get_terminal_output()
|
| 84 |
|
| 85 |
def get_terminal_output(self):
|
|
|
|
| 79 |
def terminal_session(self, command):
|
| 80 |
self.state.shell.send_command(command)
|
| 81 |
|
| 82 |
+
PrintStyle(background_color="white",font_color="#1B4F72",bold=True).print(f"{self.agent.agent_name} code execution output:")
|
| 83 |
return self.get_terminal_output()
|
| 84 |
|
| 85 |
def get_terminal_output(self):
|
python/tools/response.py
CHANGED
|
@@ -13,5 +13,8 @@ class ResponseTool(Tool):
|
|
| 13 |
self.agent.set_data("timeout", self.agent.config.response_timeout_seconds)
|
| 14 |
return Response(message=self.args["text"], break_loop=True)
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
def after_execution(self, response, **kwargs):
|
| 17 |
-
pass # do add anything to the history or output
|
|
|
|
| 13 |
self.agent.set_data("timeout", self.agent.config.response_timeout_seconds)
|
| 14 |
return Response(message=self.args["text"], break_loop=True)
|
| 15 |
|
| 16 |
+
def before_execution(self, **kwargs):
|
| 17 |
+
pass # do not add anything to the history or output
|
| 18 |
+
|
| 19 |
def after_execution(self, response, **kwargs):
|
| 20 |
+
pass # do not add anything to the history or output
|
python/tools/task_done.py
CHANGED
|
@@ -13,5 +13,8 @@ class TaskDone(Tool):
|
|
| 13 |
self.agent.set_data("timeout", 0)
|
| 14 |
return Response(message=self.args["text"], break_loop=True)
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
def after_execution(self, response, **kwargs):
|
| 17 |
pass # do add anything to the history or output
|
|
|
|
| 13 |
self.agent.set_data("timeout", 0)
|
| 14 |
return Response(message=self.args["text"], break_loop=True)
|
| 15 |
|
| 16 |
+
def before_execution(self, **kwargs):
|
| 17 |
+
pass # do not add anything to the history or output
|
| 18 |
+
|
| 19 |
def after_execution(self, response, **kwargs):
|
| 20 |
pass # do add anything to the history or output
|