Alessandro commited on
Commit
6e35f63
Β·
1 Parent(s): e735edf

Documentation and updated README.md for v0.7

Browse files

β€’ First solid docs version (.md only)
β€’ Your installation guide is fully incorporated in docs/installation.md
β€’ Updated readme.md file for v0.7
β€’ Changelog

Files changed (47) hide show
  1. README.md +15 -7
  2. docs/README.md +107 -0
  3. docs/architecture.md +164 -0
  4. docs/contribution.md +29 -0
  5. docs/{installation/README.md β†’ installation.md} +196 -43
  6. docs/quickstart.md +43 -0
  7. docs/res/arch-01.svg +490 -0
  8. docs/res/dark.svg +20 -0
  9. docs/res/flow-01.svg +144 -0
  10. docs/res/{intro_vid.jpg β†’ header.png} +2 -2
  11. docs/res/image-24.png +3 -0
  12. docs/res/memory-man.png +3 -0
  13. docs/res/new_vid.jpg +3 -0
  14. docs/res/physics-2.png +3 -0
  15. docs/res/physics.png +3 -0
  16. docs/{installation β†’ res/setup}/image-1.png +0 -0
  17. docs/{installation β†’ res/setup}/image-10.png +0 -0
  18. docs/{installation β†’ res/setup}/image-11.png +0 -0
  19. docs/{installation β†’ res/setup}/image-12.png +0 -0
  20. docs/{installation β†’ res/setup}/image-13.png +0 -0
  21. docs/{installation β†’ res/setup}/image-14.png +2 -2
  22. docs/{installation β†’ res/setup}/image-15.png +0 -0
  23. docs/{installation β†’ res/setup}/image-16.png +0 -0
  24. docs/{installation β†’ res/setup}/image-17.png +0 -0
  25. docs/{installation β†’ res/setup}/image-18.png +0 -0
  26. docs/{installation β†’ res/setup}/image-19.png +0 -0
  27. docs/{installation β†’ res/setup}/image-2.png +0 -0
  28. docs/{installation β†’ res/setup}/image-20.png +0 -0
  29. docs/{installation β†’ res/setup}/image-21.png +0 -0
  30. docs/{installation β†’ res/setup}/image-22.png +2 -2
  31. docs/{installation β†’ res/setup}/image-23.png +2 -2
  32. docs/{installation β†’ res/setup}/image-3.png +0 -0
  33. docs/{installation β†’ res/setup}/image-4.png +0 -0
  34. docs/{installation β†’ res/setup}/image-5.png +0 -0
  35. docs/{installation β†’ res/setup}/image-6.png +0 -0
  36. docs/{installation β†’ res/setup}/image-7.png +0 -0
  37. docs/{installation β†’ res/setup}/image-8.png +0 -0
  38. docs/{installation β†’ res/setup}/image-9.png +0 -0
  39. docs/{installation β†’ res/setup}/image.png +0 -0
  40. docs/res/setup/macsocket.png +3 -0
  41. docs/{installation β†’ res/setup}/thumb_play.png +0 -0
  42. docs/res/setup/update-initialize.png +3 -0
  43. docs/res/ui_newchat.png +3 -0
  44. docs/res/ui_screen1.png +2 -2
  45. docs/res/win_webui.gif +3 -0
  46. docs/troubleshooting.md +60 -0
  47. docs/usage.md +65 -0
README.md CHANGED
@@ -3,15 +3,15 @@
3
  [![Join our Skool Community](https://img.shields.io/badge/Skool-Join%20our%20Community-4A90E2?style=for-the-badge&logo=skool&logoColor=white)](https://www.skool.com/agent-zero) [![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/B8KZKNsPpj) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@AgentZeroFW) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/jan-tomasek/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/JanTomasekDev)
4
 
5
 
6
- [![Intro Video](/docs/res/intro_vid.jpg)](https://www.youtube.com/watch?v=C9n8zFpaV3I)
7
 
8
  **Personal and organic AI framework**
9
  - Agent Zero is not a predefined agentic framework. It is designed to be dynamic, organically growing, and learning as you use it.
10
  - Agent Zero is fully transparent, readable, comprehensible, customizable and interactive.
11
  - Agent Zero uses the computer as a tool to accomplish its (your) tasks.
12
 
13
- ## Now with UI:
14
- ![UI prototype](/docs/res/ui_screen1.png)
15
 
16
  ## Key concepts
17
  1. **General-purpose assistant**
@@ -51,6 +51,8 @@
51
  - No coding is required, only prompting and communication skills.
52
  - With a solid system prompt, the framework is reliable even with small models, including precise tool usage.
53
 
 
 
54
  ## Keep in mind
55
  1. **Agent Zero can be dangerous!**
56
  With proper instruction, Agent Zero is capable of many things, even potentially dangerous to your computer, data, or accounts. Always run Agent Zero in an isolated environment (like the built in docker container) and be careful what you wish for.
@@ -81,9 +83,15 @@ If you cannot provide all the necessary conditions or API keys, just change the
81
 
82
  ## Setup
83
 
84
- A detailed setup guide with a video can be found here: [/docs/installation](https://github.com/frdel/agent-zero/tree/main/docs/installation). Scroll down to see the readme file.
85
 
86
- > ⚠️ **Changes to launch files since v0.6:**
87
- > main.py file has been replaced with run_ui.py (webui) and run_cli.py (terminal) launch files.
88
- > configuration has been moved to initialize.py for both webui and terminal launch files.
 
 
 
89
 
 
 
 
 
3
  [![Join our Skool Community](https://img.shields.io/badge/Skool-Join%20our%20Community-4A90E2?style=for-the-badge&logo=skool&logoColor=white)](https://www.skool.com/agent-zero) [![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/B8KZKNsPpj) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@AgentZeroFW) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/jan-tomasek/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/JanTomasekDev)
4
 
5
 
6
+ [![Intro Video](/docs/res/new_vid.jpg)](https://www.youtube.com/watch?v=U_Gl0NPalKA)
7
 
8
  **Personal and organic AI framework**
9
  - Agent Zero is not a predefined agentic framework. It is designed to be dynamic, organically growing, and learning as you use it.
10
  - Agent Zero is fully transparent, readable, comprehensible, customizable and interactive.
11
  - Agent Zero uses the computer as a tool to accomplish its (your) tasks.
12
 
13
+ ## Now with Responsive UI and Progress Bar:
14
+ ![Web UI](/docs/res/win_webui.gif)
15
 
16
  ## Key concepts
17
  1. **General-purpose assistant**
 
51
  - No coding is required, only prompting and communication skills.
52
  - With a solid system prompt, the framework is reliable even with small models, including precise tool usage.
53
 
54
+ ![Agent 1 System Load](/docs/res/ui_screen1.png)
55
+
56
  ## Keep in mind
57
  1. **Agent Zero can be dangerous!**
58
  With proper instruction, Agent Zero is capable of many things, even potentially dangerous to your computer, data, or accounts. Always run Agent Zero in an isolated environment (like the built in docker container) and be careful what you wish for.
 
83
 
84
  ## Setup
85
 
86
+ A detailed setup guide with a video can be found in /docs/installation.md. Open the [Documentation](docs/installation.md#in-depth-guide-for-windows-and-macos).
87
 
88
+ ### New in version 0.7
89
+ > - UI Revamp
90
+ > - Auto Memory
91
+ > - Instruments
92
+ > - Extensions Framework
93
+ > - Reflection
94
 
95
+ > ⚠️ **Changes to launch files since v0.6:**
96
+ > - main.py file has been replaced with run_ui.py (webui) and run_cli.py (terminal) launch files.
97
+ > - configuration has been moved to initialize.py for both webui and terminal launch files.
docs/README.md ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ![Agent Zero Logo](res/header.png)
2
+ # Agent Zero Documentation
3
+ To begin with Agent Zero, follow the links below for detailed guides on various topics:
4
+
5
+ - **[Installation](installation.md):** Set up Agent Zero on your system.
6
+ - **[Quick Start](quickstart.md):** Begin using Agent Zero with practical examples.
7
+ - **[Usage Guide](usage.md):** Explore advanced features and capabilities.
8
+ - **[Architecture Overview](architecture.md):** Understand the internal workings of the framework.
9
+ - **[Contributing](contribution.md):** Learn how to contribute to the Agent Zero project.
10
+ - **[Troubleshooting and FAQ](troubleshooting.md):** Find answers to common issues and questions.
11
+
12
+ ## Key Features
13
+ - **Dynamic and Organic:** Evolves from past interactions.
14
+ - **Transparent and Customizable:** Open framework for user modifications.
15
+ - **Computer as a Tool:** Utilize your operating system's full capabilities.
16
+ - **Multi-Agent Cooperation:** Hierarchical structure for task management.
17
+ - **Persistent Memory:** Remembers past interactions for continuous learning.
18
+ - **Safe Code Execution:** Sandboxed Docker container environment for secure code execution.
19
+ - **Interactive Terminal Interface:** Real-time observation and intervention in a command-line interface.
20
+ - **Web UI:** User-friendly interface for managing agents.
21
+
22
+ ### Your experience with Agent Zero starts now!
23
+
24
+ - **Join the Community:** Join the Agent Zero [Skool](https://www.skool.com/agent-zero) or [Discord](https://discord.gg/Z2tun2N3) community to discuss ideas, ask questions, and collaborate with other contributors.
25
+ - **Share your Work:** Share your Agent Zero creations, workflows and discoverings on our [Show and Tell](https://github.com/frdel/agent-zero/discussions/categories/show-and-tell) area on GitHub.
26
+ - **Report Issues:** Use the GitHub issue tracker to report bugs or suggest new features.
27
+
28
+ ## Table of Contents
29
+
30
+ - [Welcome to the Agent Zero Documentation](#agent-zero-documentation)
31
+ - [Key Features](#key-features)
32
+ - [Start your experience with Agent Zero](#your-experience-with-agent-zero-starts-now)
33
+ - [Table of Contents](#table-of-contents)
34
+ - [Installation guide for Windows, MacOS and Linux](installation.md)
35
+ - [Windows Quick Start](installation.md#windows-quick-start)
36
+ - [macOS Quick Start](installation.md#macos-quick-start)
37
+ - [Linux Quick Start](installation.md#linux-quick-start)
38
+ - [In-Depth Guide for Windows and MacOS](installation.md#in-depth-guide-for-windows-and-macos)
39
+ - [1. Install Conda (miniconda)](installation.md#1-install-conda-miniconda)
40
+ - [2. Install Docker (Docker Desktop application)](installation.md#2-install-docker-docker-desktop-application)
41
+ - [3. Download Agent Zero](installation.md#3-download-agent-zero)
42
+ - [4. Set up Conda environment](installation.md#4-set-up-conda-environment)
43
+ - [5. Configure Agent Zero](installation.md#5-configure-agent-zero)
44
+ - [6. Run Agent Zero](installation.md#6-run-agent-zero)
45
+ - [Choosing Your LLMs](installation.md#choosing-your-llms)
46
+ - [Installing and Using Ollama](installation.md#installing-and-using-ollama)
47
+ - [How to update Agent Zero](installation.md#how-to-update-agent-zero)
48
+ - [Conclusion](installation.md#conclusion)
49
+ - [Quick Start](quickstart.md)
50
+ - [Launching the Web UI](quickstart.md#launching-the-web-ui)
51
+ - [Running a Simple Task](quickstart.md#running-a-simple-task)
52
+ - [Example Interaction](quickstart.md#example-interaction)
53
+ - [Next Steps](quickstart.md#next-steps)
54
+ - [Architecture Overview](architecture.md)
55
+ - [Core Components](architecture.md#core-components)
56
+ - [Agent Hierarchy and Communication](architecture.md#agent-hierarchy-and-communication)
57
+ - [Interaction Flow](architecture.md#interaction-flow)
58
+ - [Memory System](architecture.md#memory-system)
59
+ - [Knowledge](architecture.md#knowledge)
60
+ - [Prompts](architecture.md#prompts)
61
+ - [Extensions](architecture.md#extensions)
62
+ - [Structure of Extensions](architecture.md#structure-of-extensions)
63
+ - [Types of Default Extensions](architecture.md#types-of-default-extensions)
64
+ - [Key Files](architecture.md#key-files)
65
+ - [Directory Structure](architecture.md#directory-structure)
66
+ - [Customization](architecture.md#customization)
67
+ - [Custom Prompts](architecture.md#custom-prompts)
68
+ - [Changing the System Prompt Folder](architecture.md#changing-the-system-prompt-folder)
69
+ - [Editing Prompts](architecture.md#editing-prompts)
70
+ - [AgentConfig](architecture.md#agentconfig)
71
+ - [Adding Tools](architecture.md#adding-tools)
72
+ - [Adding Extensions](architecture.md#adding-extensions)
73
+ - [Adding Instruments](architecture.md#adding-instruments)
74
+ - [Important Considerations](architecture.md#important-considerations)
75
+ - [Usage Guide](usage.md)
76
+ - [Tool Usage](usage.md#tool-usage)
77
+ - [Example: Web Search and Code Execution](usage.md#example-web-search-and-code-execution)
78
+ - [Memory Management](usage.md#memory-management)
79
+ - [Multi-Agent Cooperation](usage.md#multi-agent-cooperation)
80
+ - [Prompt Engineering](usage.md#prompt-engineering)
81
+ - [Agent Behavior](usage.md#agent-behavior)
82
+ - [Contributing to Agent Zero](contribution.md)
83
+ - [Getting Started](contribution.md#getting-started)
84
+ - [Making Changes](contribution.md#making-changes)
85
+ - [Submitting a Pull Request](contribution.md#submitting-a-pull-request)
86
+ - [Documentation Stack](contribution.md#documentation-stack)
87
+ - [Troubleshooting and FAQ](troubleshooting.md)
88
+ - [Frequently Asked Questions](troubleshooting.md#frequently-asked-questions)
89
+ - [Troubleshooting](troubleshooting.md#troubleshooting)
90
+ - [Installation](troubleshooting.md#installation)
91
+ - [Usage](troubleshooting.md#usage)
92
+
93
+ ## Changelog
94
+
95
+ ### v0.7
96
+ - **Hybrid Memory System**: The memory system now operates on a hybrid model where part of the memory is managed automatically by the framework while users can also manually input information.
97
+ - **UI Revamp**
98
+ - The chat interface is now fully responsive, has a progress bar and supports both light and dark themes.
99
+ - **Instruments**: Users can create custom tools (instruments) using markdown files. These instruments execute commands within the Docker container and can be used to perform various tasks, such as downloading YouTube videos or executing scripts.
100
+ - **Extensions Framework**
101
+ - A new extensions framework has been introduced to keep the main agent.py file clean and maintainable. This allows for better organization of code with various subfolders for different functionalities. Files within python/extensions folders are executed in alphabetical order, streamlining processes like memory recall and solution memorization.
102
+ - **Reflection**
103
+ - The framework supports advanced AI concepts like Chain of Thought and reflection through customizable prompts. Users can choose between two reflection models: dianoia-small and dianoia-xl.
104
+
105
+ ### ⚠️ Changes to launch files since v0.6:
106
+ - main.py file has been replaced with run_ui.py (webui) and run_cli.py (terminal) launch files.
107
+ - configuration has been moved to initialize.py for both webui and terminal launch files.
docs/architecture.md ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Architecture Overview
2
+ Agent Zero is built on a flexible and modular architecture designed for extensibility and customization. This document outlines the key components and their interactions. This simplified diagram illustrates the hierarchical relationship between agents and their interaction with tools, prompts, memory, knowledge base and instruments.
3
+
4
+ ![Agent Zero Architecture](res/arch-01.svg)
5
+
6
+ The user or Agent 0 is at the top of the hierarchy, delegating tasks to subordinate agents, which can further delegate to other agents. Each agent can utilize tools and access the shared assets (prompts, memory, knowledge, extensions and instruments) to perform its tasks.
7
+
8
+ ## Core Components
9
+ Agent Zero's architecture revolves around the following key components:
10
+
11
+ 1. **Agents:** The core actors within the framework. Agents receive instructions, reason, make decisions, and utilize tools to achieve their objectives. Agents operate within a hierarchical structure, with superior agents delegating tasks to subordinate agents.
12
+
13
+ 2. **Tools:** Tools are functionalities that agents can leverage. These can include anything from web search and code execution to interacting with APIs or controlling external software. Agent Zero provides a mechanism for defining and integrating both built-in and custom tools.
14
+
15
+ 3. **Memory:** Agents have persistent memory that stores past experiences, knowledge, and information. This memory is used to inform decision-making and improve performance over time.
16
+
17
+ 4. **Prompts:** Prompts guide agent behavior and communication. The system prompt defines the agent's overall role and objectives, while message prompts structure the interaction and flow of information between agents and tools.
18
+
19
+ 5. **Knowledge:** Knowledge refers to the user-provided information and data that agents can leverage. This can include documents, databases, or any other relevant resources. Agents can retrieve and utilize this knowledge to answer questions, make decisions, and perform RAG-augmented tasks.
20
+
21
+ 6. **Instruments:** Instruments provide a way to add custom functionalities to Agent Zero. They can modify agent behavior introducing new procedures, call for tools, or scripts to integrate with other systems. Instruments scripts are run inside the Docker container.
22
+
23
+ 7. **Extensions:** Extensions are custom components that can be added to Agent Zero to enhance its capabilities. Extensions can include new message loops, custom memory management rules, or even more.
24
+
25
+ 8. **Docker Container:** Agent Zero execute code commands in a Docker container, which provides isolation and security. This ensures that agents can safely and securely interact with tools and external systems.
26
+
27
+ ## Agent Hierarchy and Communication
28
+ Agent Zero employs a hierarchical agent structure, where a top-level agent (often the user) can delegate tasks to subordinate agents. This hierarchy allows for the efficient breakdown of complex tasks into smaller, more manageable sub-tasks.
29
+
30
+ Communication flows between agents through messages, which are structured according to the prompt templates. These messages typically include:
31
+
32
+ | Argument | Description |
33
+ | --- | --- |
34
+ | `Thoughts:` | The agent's internal reasoning and planning process. |
35
+ | `Tool name:` | The specific tool used by the agent. |
36
+ | `Responses or queries:` | Results, feedback or queries from tools or other agents. |
37
+
38
+ ## Interaction Flow
39
+ A typical interaction flow within Agent Zero might look like this:
40
+
41
+ ![Interaction Flow](res/flow-01.svg)
42
+
43
+ 1. The user provides an instruction to Agent 0.
44
+ 2. Agent 0 initializes VectorDB and access memory as needed.
45
+ 3. Agent 0 analyzes the instruction and formulates a plan using `thoughts` argument, possibly involving the use of tools or the creation of sub-agents.
46
+ 4. If necessary, Agent 0 delegates sub-tasks to subordinate agents.
47
+ 5. Agents use tools to perform actions, both providing arguments and responses or queries.
48
+ 6. Agents communicate results and feedback back up the hierarchy.
49
+ 7. Agent 0 provides the final response to the user.
50
+
51
+ ## Memory System
52
+ The memory system is a critical component of Agent Zero, enabling the agent to learn and adapt from past interactions. It operates on a hybrid model where part of the memory is managed automatically by the framework while users can also manually input and extract information.
53
+ - **Memory Loading**: At the start of each session, relevant memories are automatically loaded and injected into the system prompt, allowing the agent to utilize past interactions effectively.
54
+ - **Memory Structure**: The memory is categorized into four distinct areas:
55
+ - **Storage and retrieval** of user-provided information (e.g., names, API keys).
56
+ - **Fragments**: Contains pieces of information from previous conversations, updated automatically.
57
+ - **Solutions**: Stores successful solutions from past interactions for future reference.
58
+ - **Metadata**: Each memory entry includes metadata (IDs, timestamps), enabling efficient filtering and searching based on specific criteria.
59
+
60
+ ## Knowledge
61
+ - **Knowledge Base:** Wiki, books, code documentation, and other documents can be added to the knowledge base. Agent Zero uses this information to answer questions and make decisions. The `/docs` folder, containing Agent Zero's documentation, is automatically added to the knowledge base.
62
+ - **Custom Knowledge:** Users can add custom knowledge files to the `/knowledge/custom/main` directory. Agent Zero will automatically import these files, expanding its knowledge base. Supported file formats include `.txt`, `.pdf`, `.csv`, `.html`, `.json`, and `.md`. The list of supported file formats is yet to be expanded.
63
+
64
+ ## Prompts
65
+ The `prompts` directory contains various Markdown files that control agent behavior and communication. The most important file is `agent.system.main.md`, which acts as a central hub, referencing other prompt files.
66
+
67
+ **Key Prompt Files:**
68
+ | Prompt File | Description |
69
+ |---|---|
70
+ | agent.system.main.role.md | Defines the agent's overall role. |
71
+ | agent.system.main.communication.md | Specifies how the agent should communicate. |
72
+ | agent.system.main.solving.md | Describes the agent's approach to problem-solving. |
73
+ | agent.system.main.tips.md | Provides additional tips or guidance to the agent. |
74
+ | agent.system.tools.md | Organizes and calls the individual tool prompt files. |
75
+ | agent.system.tool.*.md | Individual tool prompt files (with * as the tool name). |
76
+
77
+ You can customize any of these files. Agent Zero will use the files in your custom `prompts_subdir` if they exist, otherwise, it will fall back to the files in `prompts/default`.
78
+
79
+ ## Extensions
80
+ - Extensions are a powerful feature of Agent Zero, designed to keep the main codebase clean and organized while allowing for greater flexibility and modularity. Here’s a detailed exploration of the extensions feature:
81
+ - The extensions framework allows users to create modular components that can be integrated into the main system.
82
+ ### Structure of Extensions
83
+ Extensions can be found in `python/extensions` directory.
84
+ - **Folder Organization**: The extensions are stored in a designated subfolder within the Python directory. This includes various subfolders that correspond to different aspects of the agent's message loop.
85
+ - **Execution Order**: Files within these subfolders are executed in alphabetical order, ensuring predictable behavior when multiple extensions are utilized.
86
+ ### Types of Default Extensions
87
+ - **Message Loop Prompts**: These extensions handle the construction of system messages and maintain message history, ensuring that the agent has access to relevant context during interactions.
88
+ - **Memory Management**: Extensions can also manage memory recall and solution memorization, allowing for dynamic updates based on user interactions.
89
+ - **Custom Extensions**: Users can create custom extensions to add new functionalities or modify existing ones.
90
+
91
+ If you believe the extension could bring value to the community, consider contributing it to the main repository by making a pull request.
92
+
93
+ ## Key Files
94
+ | File | Description |
95
+ | --- | --- |
96
+ | `agent.py` | Contains the core logic for the `AgentConfig` class, which defines the `prompts_subdir`, rate limits for models, and more, though `AgentConfig` class must be edited through `initialize.py` file. |
97
+ | `example.env` | Contains environment variables for configuring API keys and other settings of Agent Zero. |
98
+ | `initialize.py` | Defines Agent Zero's core configuration, including model choices and other critical settings. This is the central point for customizing the framework's behavior. See [Choosing Your LLMs](installation.md#choosing-your-llms) for more details. |
99
+ | `models.py` | Defines the `get_provider_chat` or `..._embedding` functions, which specifies the model provider, model name, and other parameters for adding support for new models or custom models. |
100
+ | `requirements.txt` | Lists the dependencies used by pip to install the necessary packages when you setup Agent Zero. |
101
+ | `run_cli.py` | Starts the Agent Zero CLI. |
102
+ | `run_ui.py` | Starts the Agent Zero Web UI. |
103
+
104
+ ## Directory Structure
105
+ | Directory | Description |
106
+ | --- | --- |
107
+ | `docker/` | Dockerfiles and related files for building Docker image |
108
+ | `docs/` | Quickstart and installation guide |
109
+ | `instruments/` | Instruments for interacting with the environment |
110
+ | `knowledge/` | Knowledge base for storing and retrieving information |
111
+ | `logs/` | HTML chat log files |
112
+ | `memory/` | Memory storage for storing and retrieving information |
113
+ | `prompts/` | System and tools prompts folders |
114
+ | `python/` | Python code for the main system and tools |
115
+ | `python/extensions/` | Extensions for the main system |
116
+ | `tests/` | Unit tests for the project |
117
+ | `tmp/` | Temporary files |
118
+ | `webui/` | Web UI |
119
+ | `work_dir/` | Working directory for the Agent |
120
+
121
+ # Customization
122
+ Agent Zero's strength lies in its flexibility. This section details how to customize various aspects of the framework, tailoring it to your specific needs and preferences.
123
+
124
+ ## Custom Prompts
125
+ ### Changing the System Prompt Folder
126
+ 1. Create a new directory inside the `prompts` directory (e.g., `prompts/my-custom-prompts`).
127
+ 2. When copying the contents of the `prompts/default` directory into your new directory, take into account that Agent Zero will merge the contents of the `default` directory with the contents of your custom directory. This means that you can copy only the files you want to modify, and the rest will be taken from the `default` directory.
128
+ 3. Modify the prompts in your custom directory as needed.
129
+ 4. In `initialize.py`, update the `prompts_subdir` parameter in `AgentConfig` to point to your custom directory:
130
+ ```python
131
+ config = AgentConfig(..., prompts_subdir="my-custom-prompts", ...)
132
+ ```
133
+
134
+ ## AgentConfig
135
+ The `AgentConfig` class is present in both `agent.py` and `initialize.py` and provides further customization options. You must edit `AgentConfig` class through `initialize.py` file. Here are some of the key parameters you can configure:
136
+
137
+ - `prompts_subdir`: Specifies the directory containing your custom prompts. This allows you to create and manage different sets of prompts for different use cases. (See *Prompt Customization* below).
138
+
139
+ - `knowledge_subdirs`: Defines the directories where Agent Zero searches for knowledge files.
140
+
141
+ - **Rate Limiting:** Control API usage and prevent rate limit errors by setting `rate_limit_seconds` and `rate_limit_requests`.
142
+
143
+ - **Docker and SSH:** Configure Docker and SSH settings for code execution, if needed.
144
+
145
+ ## Adding Tools
146
+ While good prompting can often achieve the desired behavior, sometimes custom tools are necessary.
147
+
148
+ 1. Create a new file named `agent.system.tool.$TOOL_NAME.md` inside your `prompts/$SUBDIR` directory. This file will contain the prompt for your custom tool.
149
+ 2. Open `agent.system.tools.md` and add a reference to your new tool prompt.
150
+ 3. If your tool requires specific code or external API calls, create a Python file for it in the `python/tools` directory, implementing the `Tool` base class.
151
+
152
+ ## Adding Extensions
153
+ To create a new extension, follow these steps:
154
+ 1. Create a new Python file in the appropriate subfolder within the `python/extensions` directory.
155
+ 2. Implement the desired functionality within the file, following the existing structure and naming conventions, that implies following the alphabetical order of execution of the extensions in the subfolder.
156
+ 3. Your desired extension's name has to start with a number to ensure it is executed before or after an already existing extension based on your needs.
157
+ 4. Ensure that the extension is compatible with the main system and does not introduce any conflicts or errors.
158
+
159
+ ## Adding Instruments
160
+ Instruments allow you to add predefined actions or workflows to Agent Zero without adding to the token count of the system prompt.
161
+
162
+ 1. Create a new folder with the name of your instrument (without spaces) inside `instruments/custom`.
163
+ 2. Inside this folder, create a `.md` file with the description of the instrument and a `.sh` script (or other executable) with the actual implementation. The `.md` file acts as the interface for the Agent to interact with the Instrument, and the agent will call the `.sh` with the given user arguments. The agent will parse the `.md` file, using the Instrument's name, description, and arguments described in it.
164
+ 3. The agent will automatically detect and use your custom instruments.
docs/contribution.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to Agent Zero
2
+
3
+ Contributions to improve Agent Zero are very welcome! This guide outlines how to contribute code, documentation, or other improvements.
4
+
5
+ ## Getting Started
6
+
7
+ 1. **Fork the Repository:** Fork the Agent Zero repository on GitHub.
8
+ 2. **Clone Your Fork:** Clone your forked repository to your local machine.
9
+ 3. **Create a Branch:** Create a new branch for your changes. Use a descriptive name that reflects the purpose of your contribution (e.g., `fix-memory-leak`, `add-search-tool`, `improve-docs`).
10
+
11
+ ## Making Changes
12
+
13
+ * **Code Style:** Follow the existing code style. Agent Zero generally follows PEP 8 conventions.
14
+ * **Testing:** Write unit tests for new features. Agent Zero uses the `pytest` framework. Ensure your changes pass all existing and new tests.
15
+ * **Documentation:** Update the documentation if your changes affect user-facing functionality. The documentation is written in Markdown.
16
+ * **Commit Messages:** Write clear and concise commit messages that explain the purpose of your changes.
17
+
18
+ ## Submitting a Pull Request
19
+
20
+ 1. **Push Your Branch:** Push your branch to your forked repository on GitHub.
21
+ 2. **Create a Pull Request:** Create a pull request from your branch to the appropriate branch in the main Agent Zero repository.
22
+ * **For new features, refactoring, or significant changes:** Target the `testing` branch.
23
+ * **For bug fixes and patches:** Target the `development` branch.
24
+ 3. **Provide Details:** In your pull request description, clearly explain the purpose and scope of your changes. Include relevant context, test results, and any other information that might be helpful for reviewers.
25
+ 4. **Address Feedback:** Be responsive to feedback from the community. We love changes, but we also love to discuss them!
26
+
27
+ ## Documentation Stack
28
+
29
+ - The documentation is built using Markdown. We appreciate your contributions and look forward to improving Agent Zero for everyone's benefit.
docs/{installation/README.md β†’ installation.md} RENAMED
@@ -1,95 +1,162 @@
1
- # How to install Agent Zero on Windows and MacOS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  - Agent Zero is not an app. It's a framework. It's made to be customized, edited, enhanced. Therefore you need to install the necessary components to run it.
3
- - I will provide step by step instructions along with a video for this tutorial on how to make Agent Zero work on Windows and MacOS.
4
-
5
- [![Video](thumb_play.png)](https://youtu.be/8H7mFsvxKYQ)
6
 
7
  ## Reminders:
8
- 1. You don't need to install Python, Conda will take care of that for you.
9
- 2. You don't need API keys, Agent Zero can run with local models, but for this tutorial I will leave it to the default OpenAI API. Local models will be covered in another tutorial.
10
- 3. You don't need Visual Studio Code or any other code editor, but it's easier to navigate and edit files if you have one.
11
- 4. Docker is not mandatory, but running Agent Zero without docker is actually more complicated and can be very dangerous, so I will be showing the easier and recommended way to do it - with Docker Desktop application.
12
- 5. Git/Github is not mandatory, you can download the framework files in browser. I will not be showing how to use Git in this tutorial.
13
-
14
 
15
  ## 1. Install Conda (miniconda)
16
  - Conda is a python environment manager, it will help you keep your projects and installations separated. Full Conda has many more features, but you only need "miniconda".
17
 
18
  1. Go to the download page of miniconda [here](https://docs.anaconda.com/miniconda/#miniconda-latest-installer-links). If the link does not work, just search the web for "miniconda download".
19
- 2. Based on your operating system, download the right installer of miniconda. For MacOS select the version with "pkg" at the end.
20
 
21
- <img src="image-1.png" alt="miniconda download win" width="500"/>
22
- <img src="image-5.png" alt="miniconda download macos" width="500"/>
23
  <br><br>
24
 
25
- 3. Run the installer and go through the installation process, here you can leave everything to default and just click Next, Next... The same goes for MacOS with the "pkg" graphical installer.
26
 
27
- <img src="image.png" alt="miniconda install" width="200"/>
28
- <img src="image-2.png" alt="miniconda install" width="200"/>
29
- <img src="image-3.png" alt="miniconda install" width="200"/>
30
- <img src="image-4.png" alt="miniconda install" width="200"/>
31
  <br><br>
32
 
33
- 4. After the installation is complete, you should have "Anaconda Powershell Prompt" installed on your Windows machine. On MacOS, when you open the Terminal application in your Applications folder and type "conda --version", you should see the version installed.
34
 
35
- <img src="image-6.png" alt="miniconda installed" height="100"/>
36
- <img src="image-7.png" alt="miniconda installed" height="100"/>
37
  <br><br>
38
 
39
  ## 2. Install Docker (Docker Desktop application)
40
  - Simply put, Docker is a way of running virtual computers on your machine. These are lightweight, disposable and isolated from your operating system, so it is a way to sandbox Agent Zero.
41
  - Agent Zero only connects to the Docker container when it needs to execute code and commands. The frameworks itself runs on your machine.
42
- - Running Agent Zero without docker is possible, but more complicated and dangerous, I will not be covering that in this tutorial.
43
  - Docker has a desktop application with GUI for all major operating system, so I will be using that.
44
 
45
  1. Go to the download page of Docker Desktop [here](https://www.docker.com/products/docker-desktop/). If the link does not work, just search the web for "docker desktop download".
46
  2. Download the version for your operating system. Don't be tricked by the seemingly missing windows intel/amd version, it's the button itself, not in the dropdown menu.
47
 
48
- <img src="image-8.png" alt="docker download" width="200"/>
49
  <br><br>
50
 
51
- 3. Run the installer and go through the installattion process. It should be even shorter than Conda installation, you can leave everything to default. On MacOS, the installer is a "dmg" image, so just drag and drop the application to your Applications folder like always.
52
 
53
- <img src="image-9.png" alt="docker install" width="300"/>
54
- <img src="image-10.png" alt="docker install" width="300"/>
55
 
56
- <img src="image-12.png" alt="docker install" width="300"/>
57
  <br><br>
58
 
59
 
60
  4. Once installed, you should see Docker Desktop application on your Windows/Mac machine.
61
 
62
- <img src="image-11.png" alt="docker installed" height="100"/>
63
- <img src="image-13.png" alt="docker installed" height="100"/>
64
  <br><br>
65
 
66
  5. Create account in the application.
67
  No need to create images or containers, the framework will do that for you. However, this requires you to be signed in to the Docker Hub, so create a free account in the Docker Desktop application, you will be prompted when the application first runs.
68
 
 
 
 
 
69
  ## 3. Download Agent Zero
70
- - You can clone the Agent Zero repository (https://github.com/frdel/agent-zero) from GitHub if you know how to use git. In this tutorial I will just show how to download the files.
71
 
72
  1. Go to the Agent Zero releases [here](https://github.com/frdel/agent-zero/releases).
73
  2. The latest release is on the top of the list, click the "Source Code (zip)" button under "Assets" to download it.
74
 
75
- <img src="image-14.png" alt="agent zero download" width="500"/>
76
  <br><br>
77
 
78
- 3. Extract the downloaded archive where you want to have it. I will extract them to "agent-zero" folder on my Desktop - "C:\Users\frdel\Desktop\agent-zero" on Windows and "/Users/frdel/Desktop/agent-zero" on MacOS.
79
 
80
 
81
  ## 4. Set up Conda environment
82
  - Now that we have the project files and Conda, we can create **virtual Python environment** for this project, activate it and install requirements.
83
 
84
- 1. Open your **"Anaconda Powershell Prompt"** application on windows or **"Terminal"** application on MacOS.
85
  2. In the terminal, navigate to your Agent Zero folder using **"cd"** command. Replace the path with your actual Agent Zero folder path.
86
  ~~~
87
  cd C:\Users\frdel\Desktop\agent-zero
88
  ~~~
89
  You should see your folder has changed on the next terminal line.
90
 
91
- <img src="image-15.png" alt="agent zero cd" height="100"/>
92
- <img src="image-16.png" alt="agent zero cd" height="100"/>
93
  <br><br>
94
 
95
  3. Create Conda environment using command **"conda create"**. After **"-n"** is your environment name, you can choose your own, i will use **"a0"** - short for Agent Zero. After **"python"** is the Python version that Conda will install for you into this environment, right now, 3.12 works fine. **-y** skips confirmations.
@@ -103,8 +170,8 @@ conda activate a0
103
  ~~~
104
  And you should see that the **(base)** on the left has changed to **(a0)**. This means that this terminal now uses the new **a0** virtual environment and all packages will be installed into this environment.
105
 
106
- <img src="image-17.png" alt="conda env" height="200"/>
107
- <img src="image-18.png" alt="conda env" height="200"/>
108
  <br><br>
109
 
110
  > ⚠️ If you open a new terminal window, you will need to activate the environment with "conda activate a0" again for that window.
@@ -115,7 +182,7 @@ pip install -r requirements.txt
115
  ~~~
116
  This might take some time. If you get any errors regarding version conflicts and compatibility, double check that your environment is activated and that you created that environment with the correct Python version.
117
 
118
- <img src="image-19.png" alt="conda reqs" height="200"/>
119
  <br><br>
120
 
121
  ## 5. Configure Agent Zero
@@ -125,10 +192,10 @@ This might take some time. If you get any errors regarding version conflicts and
125
  1. Find the **"example.env"** file in your Agent Zero folder and edit the contents. I will put my OpenAI API key after **"API_KEY_OPENAI="**. If you have API keys for other service providers, add them as needed.
126
  2. Rename the **"example.env"** file to **".env"**. This is important, only this exact "**.env**" file name is valid.
127
 
128
- <img src="image-20.png" alt="conda reqs" height="200"/>
129
  <br><br>
130
 
131
- 3. (Optional) Change models or setting in **"initialize.py"** file if needed.
132
 
133
  ## 6. Run Agent Zero
134
  - Setup done. It's time to test Agent Zero. Let's double check:
@@ -141,14 +208,100 @@ This might take some time. If you get any errors regarding version conflicts and
141
  python run_ui.py
142
  ~~~
143
 
144
- <img src="image-21.png" alt="run ui" height="200"/>
145
  <br><br>
146
 
147
  5. Open the URL shown in terminal in your web browser. You should see the Agent Zero interface. The first time it needs to execute code, Docker image will be downloaded and deployed, this might take some time. Be patient when seeing "Initializing docker container agent-zero-exe for safe code execution...".
148
 
149
- <img src="image-22.png" alt="run ui" width="400"/>
150
- <img src="image-23.png" alt="run ui" width="400"/>
151
  <br><br>
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
 
154
 
 
 
 
 
 
 
1
+ # Installation guide for Windows, macOS and Linux
2
+
3
+ [![Video](res/setup/thumb_play.png)](https://youtu.be/8H7mFsvxKYQ)
4
+
5
+ The following guide provides both quick start instructions for the full installation of Agent Zero on various operating systems and in-depth guides for Windows and macOS with screenshots.
6
+
7
+ ## You were looking for this? [How to update Agent Zero](#how-to-update-agent-zero)
8
+
9
+ <details>
10
+ <summary><h2>Windows Quick Start</h2></summary>
11
+
12
+ 1. **Install Anaconda or Miniconda:** Download and install the appropriate version for your system from [here](https://docs.anaconda.com/anaconda/install/). Miniconda is recommended for a minimal installation.
13
+ 2. **Create an Environment:** Open Anaconda Navigator (or use the `conda` command), create an environment named `agent-zero`, and select Python 3.12.
14
+ 3. **Install Docker Desktop:** Download and install Docker Desktop from [here](https://www.docker.com/products/docker-desktop/).
15
+ 4. **Download Agent Zero:** Download the latest release zip from the [GitHub releases page](https://github.com/frdel/agent-zero/releases) and extract it.
16
+ 5. **Configure API Keys:** Duplicate `example.env`, rename it to `.env`, and add your API keys.
17
+ 6. **Install Requirements:** Activate your `agent-zero` environment, open a terminal in the Agent Zero directory, and run: `pip install -r requirements.txt`
18
+ 7. **Run Agent Zero (Web UI):** Execute `python run_ui.py` in your terminal.
19
+ 8. **Access the Web UI:** Open the URL displayed in your browser.
20
+
21
+ </details>
22
+
23
+ <details>
24
+ <summary><h2>macOS Quick Start</h2></summary>
25
+
26
+ 1. **Install Miniconda:** Download the pkg installer from [here](https://docs.anaconda.com/miniconda/#miniconda-latest-installer-links) and follow the instructions.
27
+ 2. **Install Docker Desktop:** Download the dmg image from [here](https://www.docker.com/products/docker-desktop/), drag the Docker application to your Applications folder, and create a Docker Hub account.
28
+ 3. **Download Agent Zero:** Download the latest release zip from the [GitHub releases page](https://github.com/frdel/agent-zero/releases) and extract it.
29
+ 4. **Open Terminal:** Navigate to the Agent Zero directory.
30
+ 5. **Create Conda Environment:** Run: `conda create -n a0 python=3.12 -y`
31
+ 6. **Activate Environment:** Run: `conda activate a0`
32
+ 7. **Install Requirements:** Run: `pip install -r requirements.txt`
33
+ 8. **Configure API Keys:** Create a `.env` file and add your keys.
34
+ 9. **Run Agent Zero (Web UI):** Run: `python run_ui.py`
35
+ 10. **Access the Web UI:** Open the displayed URL.
36
+
37
+ > ⚠️ **Important macOS Docker Configuration:** In Docker Desktop's preferences (Docker menu) go to Settings, navigate to "Advanced" and check "Allow the default Docker socket to be used (requires password)." This allows Agent Zero to communicate with the Docker daemon.
38
+
39
+ ![docker socket macOS](res/setup/macsocket.png)
40
+
41
+ </details>
42
+
43
+ <details>
44
+ <summary><h2>Linux Quick Start</h1></summary>
45
+
46
+ 1. **Install Python and Pip:** Use your distribution's package manager (e.g., `apt`, `yum`, `dnf`) to install Python 3.12 or higher and pip. On Debian/Ubuntu systems, you would typically use:
47
+ ```bash
48
+ sudo apt-get update
49
+ sudo apt-get install python3.12 python3-pip
50
+ ```
51
+ 2. **Install Miniconda:** Download the appropriate installer for your Linux distribution from [here](https://docs.anaconda.com/miniconda/#miniconda-latest-installer-links) and follow the instructions.
52
+ 3. **Install Docker:** Install Docker Desktop or Docker CE using your distribution's package manager. Make sure the Docker service is running: `sudo systemctl start docker`
53
+ 4. **Download Agent Zero:** Download the latest release zip from the [GitHub releases page](https://github.com/frdel/agent-zero/releases) and extract it.
54
+ 5. **Open Terminal and Navigate:** Open your terminal and navigate to the extracted Agent Zero folder using the `cd` command.
55
+ 6. **Create and Activate Conda Environment:**
56
+ ```bash
57
+ conda create -n a0 python=3.12 -y
58
+ conda activate a0
59
+ ```
60
+ 7. **Install Requirements:** `pip install -r requirements.txt`
61
+ 8. **Configure API Keys:** Create a `.env` file in the project root and add your API keys. You can copy the `example.env` file and rename it to `.env`.
62
+ 9. **Run Agent Zero (Web UI):** `python run_ui.py`
63
+ 10. **Access the Web UI:** Open the URL displayed in your terminal.
64
+
65
+ </details>
66
+
67
+ # In-Depth Guide for Windows and macOS
68
  - Agent Zero is not an app. It's a framework. It's made to be customized, edited, enhanced. Therefore you need to install the necessary components to run it.
69
+ - The following step by step instructions can be followed along with a video for this tutorial on how to make Agent Zero work on Windows and macOS that you find in the [top section](#installation-guide-for-windows-macos-and-linux) of the page.
 
 
70
 
71
  ## Reminders:
72
+ 1. There's no need to install Python, Conda will manage that for you.
73
+ 2. You don't necessarily need API keys: Agent Zero can run with local models. For this tutorial though, we will leave it to the default OpenAI API. A simple video explanation for running Free and Local models is available [in this video](https://www.youtube.com/watch?v=sLMhLRHDIPY&t=80s).
74
+ 3. Visual Studio Code or any other code editor is not mandatory, but it makes it easier to navigate and edit files.
75
+ 4. Docker is not mandatory, but running Agent Zero without Docker is actually more complicated and can be very dangerous, so we will be covering the easier and recommended way - using Docker Desktop application.
76
+ 5. Git/GitHub is not mandatory, you can download the framework files through your browser. We will not be showing how to use Git in this tutorial.
 
77
 
78
  ## 1. Install Conda (miniconda)
79
  - Conda is a python environment manager, it will help you keep your projects and installations separated. Full Conda has many more features, but you only need "miniconda".
80
 
81
  1. Go to the download page of miniconda [here](https://docs.anaconda.com/miniconda/#miniconda-latest-installer-links). If the link does not work, just search the web for "miniconda download".
82
+ 2. Based on your operating system, download the right installer of miniconda. For macOS select the version with "pkg" at the end.
83
 
84
+ <img src="res/setup/image-1.png" alt="miniconda download win" width="500"/>
85
+ <img src="res/setup/image-5.png" alt="miniconda download macos" width="500"/>
86
  <br><br>
87
 
88
+ 3. Run the installer and go through the installation process, here you can leave everything to default and just click Next, Next... The same goes for macOS with the "pkg" graphical installer.
89
 
90
+ <img src="res/setup/image.png" alt="miniconda install" width="200"/>
91
+ <img src="res/setup/image-2.png" alt="miniconda install" width="200"/>
92
+ <img src="res/setup/image-3.png" alt="miniconda install" width="200"/>
93
+ <img src="res/setup/image-4.png" alt="miniconda install" width="200"/>
94
  <br><br>
95
 
96
+ 4. After the installation is complete, you should have "Anaconda Powershell Prompt" installed on your Windows machine. On macOS, when you open the Terminal application in your Applications folder and type "conda --version", you should see the version installed.
97
 
98
+ <img src="res/setup/image-6.png" alt="miniconda installed" height="100"/>
99
+ <img src="res/setup/image-7.png" alt="miniconda installed" height="100"/>
100
  <br><br>
101
 
102
  ## 2. Install Docker (Docker Desktop application)
103
  - Simply put, Docker is a way of running virtual computers on your machine. These are lightweight, disposable and isolated from your operating system, so it is a way to sandbox Agent Zero.
104
  - Agent Zero only connects to the Docker container when it needs to execute code and commands. The frameworks itself runs on your machine.
105
+ - Running Agent Zero without Docker is possible, but more complicated and dangerous, I will not be covering that in this tutorial.
106
  - Docker has a desktop application with GUI for all major operating system, so I will be using that.
107
 
108
  1. Go to the download page of Docker Desktop [here](https://www.docker.com/products/docker-desktop/). If the link does not work, just search the web for "docker desktop download".
109
  2. Download the version for your operating system. Don't be tricked by the seemingly missing windows intel/amd version, it's the button itself, not in the dropdown menu.
110
 
111
+ <img src="res/setup/image-8.png" alt="docker download" width="200"/>
112
  <br><br>
113
 
114
+ 3. Run the installer and go through the installattion process. It should be even shorter than Conda installation, you can leave everything to default. On macOS, the installer is a "dmg" image, so just drag and drop the application to your Applications folder like always.
115
 
116
+ <img src="res/setup/image-9.png" alt="docker install" width="300"/>
117
+ <img src="res/setup/image-10.png" alt="docker install" width="300"/>
118
 
119
+ <img src="res/setup/image-12.png" alt="docker install" width="300"/>
120
  <br><br>
121
 
122
 
123
  4. Once installed, you should see Docker Desktop application on your Windows/Mac machine.
124
 
125
+ <img src="res/setup/image-11.png" alt="docker installed" height="100"/>
126
+ <img src="res/setup/image-13.png" alt="docker installed" height="100"/>
127
  <br><br>
128
 
129
  5. Create account in the application.
130
  No need to create images or containers, the framework will do that for you. However, this requires you to be signed in to the Docker Hub, so create a free account in the Docker Desktop application, you will be prompted when the application first runs.
131
 
132
+ > ⚠️ **Important macOS-only Docker Configuration:** In Docker Desktop's preferences (Docker menu) go to Settings, navigate to "Advanced" and check "Allow the default Docker socket to be used (requires password)." This allows Agent Zero to communicate with the Docker daemon.
133
+
134
+ ![docker socket macOS](res/setup/macsocket.png)
135
+
136
  ## 3. Download Agent Zero
137
+ - You can clone the Agent Zero repository (https://github.com/frdel/agent-zero) from GitHub if you know how to use Git. In this tutorial I will just show how to download the files.
138
 
139
  1. Go to the Agent Zero releases [here](https://github.com/frdel/agent-zero/releases).
140
  2. The latest release is on the top of the list, click the "Source Code (zip)" button under "Assets" to download it.
141
 
142
+ <img src="res/setup/image-14.png" alt="agent zero download" width="500"/>
143
  <br><br>
144
 
145
+ 3. Extract the downloaded archive where you want to have it. I will extract them to "agent-zero" folder on my Desktop - "C:\Users\frdel\Desktop\agent-zero" on Windows and "/Users/frdel/Desktop/agent-zero" on macOS.
146
 
147
 
148
  ## 4. Set up Conda environment
149
  - Now that we have the project files and Conda, we can create **virtual Python environment** for this project, activate it and install requirements.
150
 
151
+ 1. Open your **"Anaconda Powershell Prompt"** application on windows or **"Terminal"** application on macOS.
152
  2. In the terminal, navigate to your Agent Zero folder using **"cd"** command. Replace the path with your actual Agent Zero folder path.
153
  ~~~
154
  cd C:\Users\frdel\Desktop\agent-zero
155
  ~~~
156
  You should see your folder has changed on the next terminal line.
157
 
158
+ <img src="res/setup/image-15.png" alt="agent zero cd" height="100"/>
159
+ <img src="res/setup/image-16.png" alt="agent zero cd" height="100"/>
160
  <br><br>
161
 
162
  3. Create Conda environment using command **"conda create"**. After **"-n"** is your environment name, you can choose your own, i will use **"a0"** - short for Agent Zero. After **"python"** is the Python version that Conda will install for you into this environment, right now, 3.12 works fine. **-y** skips confirmations.
 
170
  ~~~
171
  And you should see that the **(base)** on the left has changed to **(a0)**. This means that this terminal now uses the new **a0** virtual environment and all packages will be installed into this environment.
172
 
173
+ <img src="res/setup/image-17.png" alt="conda env" height="200"/>
174
+ <img src="res/setup/image-18.png" alt="conda env" height="200"/>
175
  <br><br>
176
 
177
  > ⚠️ If you open a new terminal window, you will need to activate the environment with "conda activate a0" again for that window.
 
182
  ~~~
183
  This might take some time. If you get any errors regarding version conflicts and compatibility, double check that your environment is activated and that you created that environment with the correct Python version.
184
 
185
+ <img src="res/setup/image-19.png" alt="conda reqs" height="200"/>
186
  <br><br>
187
 
188
  ## 5. Configure Agent Zero
 
192
  1. Find the **"example.env"** file in your Agent Zero folder and edit the contents. I will put my OpenAI API key after **"API_KEY_OPENAI="**. If you have API keys for other service providers, add them as needed.
193
  2. Rename the **"example.env"** file to **".env"**. This is important, only this exact "**.env**" file name is valid.
194
 
195
+ <img src="res/setup/image-20.png" alt="conda reqs" height="200"/>
196
  <br><br>
197
 
198
+ 3. (Optional) Change models or setting in **"initialize.py"** file if needed as detailed [here](#choosing-your-llms).
199
 
200
  ## 6. Run Agent Zero
201
  - Setup done. It's time to test Agent Zero. Let's double check:
 
208
  python run_ui.py
209
  ~~~
210
 
211
+ <img src="res/setup/image-21.png" alt="run ui" height="110"/>
212
  <br><br>
213
 
214
  5. Open the URL shown in terminal in your web browser. You should see the Agent Zero interface. The first time it needs to execute code, Docker image will be downloaded and deployed, this might take some time. Be patient when seeing "Initializing docker container agent-zero-exe for safe code execution...".
215
 
216
+ <img src="res/setup/image-22.png" alt="run ui" width="400"/>
217
+ <img src="res/setup/image-23.png" alt="run ui" width="400"/>
218
  <br><br>
219
 
220
+ ## Choosing Your LLMs
221
+ The `initialize.py` file is the control center for selecting the Large Language Models (LLMs) that power Agent Zero. You can choose different LLMs for different roles:
222
+
223
+ | LLM Role | Description |
224
+ | --- | --- |
225
+ | `chat_llm` | This is the primary LLM used for conversations and generating responses. |
226
+ | `utility_llm` | This LLM handles internal tasks like summarizing messages, managing memory, and processing internal prompts. Using a smaller, less expensive model here can improve efficiency. |
227
+ | `embedding_llm` | This LLM is responsible for generating embeddings used for memory retrieval and knowledge base lookups. Changing the `embedding_llm` will re-index all of A0's memory. |
228
+
229
+ **How to Change:**
230
+ 1. Open `initialize.py`.
231
+ 2. Locate the lines where these LLMs are initialized (at the beginning of the file).
232
+ 3. Uncomment the line for the provider and model you want to use, and comment out the others. For example, to use `gpt-4o-mini` for chat:
233
+ ```python
234
+ chat_llm = models.get_openai_chat(model_name="gpt-4o-mini", temperature=0)
235
+ ```
236
+ 4. Ensure only one model is uncommented for each LLM role.
237
+
238
+ ## Important Considerations
239
+
240
+ - ⚠️ **IMPORTANT NOTICE**: Changing the `embedding_llm` will re-index all the memory and knowledge, and requires clearing the `memory` folder to avoid errors, as the embeddings can't be mixed in the vector database. Beware that this will DELETE ALL OF AGENT ZERO'S MEMORY.
241
+
242
+ - Experiment with different model combinations to find the balance of performance and cost that best suits your needs. E.g., using a smaller model for `utility_llm` can save costs without significantly impacting performance.
243
+
244
+ ### Installing and Using Ollama (Local Models)
245
+ If you're interested in Ollama, which is a powerful tool that allows you to run various large language models locally, here's how to install and use it:
246
+
247
+ #### First step: installation
248
+ **On Windows:**
249
+
250
+ Download Ollama from the official website and install it on your machine.
251
+
252
+ <button>[Download Ollama Setup](https://ollama.com/download/OllamaSetup.exe)</button>
253
+
254
+ **On macOS:**
255
+ ```
256
+ brew install ollama
257
+ ```
258
+ Otherwise choose macOS installer from the [official website](https://ollama.com/).
259
+
260
+ **On Linux:**
261
+ ```bash
262
+ curl -fsSL https://ollama.com/install.sh | sh
263
+ ```
264
+
265
+ **Finding Model Names:**
266
+ Visit the [Ollama model library](https://ollama.com/library) for a list of available models and their corresponding names. The format is usually `provider/model-name` (or just `model-name` in some cases).
267
+
268
+ #### Second step: pulling the model
269
+ **On Windows, macOS, and Linux:**
270
+ ```
271
+ ollama pull <model-name>
272
+ ```
273
+
274
+ Replace `<model-name>` with the name of the model you want to use. For example, to pull the Mistral Large model, you would use the command `ollama pull mistral-large`.
275
+
276
+ #### Managing your downloaded models
277
+ Once you've downloaded some models, you might want to check which ones you have available or remove any you no longer need.
278
+
279
+ - **Listing downloaded models:**
280
+ To see a list of all the models you've downloaded, use the command:
281
+ ```
282
+ ollama list
283
+ ```
284
+ - **Removing a model:**
285
+ If you need to remove a downloaded model, you can use the `ollama rm` command followed by the model name:
286
+ ```
287
+ ollama rm <model-name>
288
+ ```
289
+
290
+ ## ❗ How to update Agent Zero
291
+ To update Agent Zero to the latest version, follow these steps:
292
+ 1. **Backup .env and initialize.py**: Before updating, make sure to save your `.env` file with all your API keys and the customizations you've made to the first part of `def_initialize` function in the `initialize.py` file to choose your LLMs (highlighted section in below figure). This is important because the update process will overwrite these files with the default versions from the repository and can save you time rewriting all your LLMs choices.
293
+
294
+ ![Update initialize.py](res/setup/update-initialize.png)
295
+
296
+ Beware of indentations when pasting the model selection code back into the `initialize.py` file after the update.
297
+
298
+ - **Using Git/GitHub:** Pull the latest version of the Agent Zero repository with Git/GitHub. The custom knowledge, solutions, memory, and other data will get ignored by Git, so you don't need to worry about losing any of your custom data. You just have to save your `.env` file before updating.
299
+ - **Manual Update:** Alternatively, you can manually download the latest version of Agent Zero from the [releases page](https://github.com/frdel/agent-zero/releases). The only folders that you must save to retain custom data are the following: `/memory`, `/knowledge`. If you have created custom `instruments` or `prompts` you must save their dirs as well.
300
 
301
+ If you update manually, beware of new dependencies. If any changes are made to requirements.txt in the updated version, you have to execute this command inside the a0 conda env after activating it:
302
 
303
+
304
+ pip install -r requirements.txt
305
+
306
+ ## Conclusion
307
+ After following the instructions for your specific operating system, you should have Agent Zero successfully installed and running. You can now start exploring the framework's capabilities and experimenting with creating your own intelligent agents. If you encounter any issues during the installation process, please consult the Troubleshooting section of this documentation or refer to the Agent Zero community for assistance.
docs/quickstart.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Quick Start
2
+ This guide provides a quick introduction to using Agent Zero. We'll cover launching the web UI, starting a new chat, and running a simple task.
3
+
4
+ ## Launching the Web UI
5
+ 1. Make sure you have Agent Zero installed and your environment set up correctly (refer to the [Installation guide](installation.md) if needed).
6
+ 2. Open a terminal in the Agent Zero directory and activate your conda environment (if you're using one).
7
+ 3. Run the following command:
8
+
9
+ ```bash
10
+ python run_ui.py
11
+ ```
12
+
13
+ 4. A message similar to this will appear in your terminal, indicating the Web UI is running:
14
+
15
+ ![](res/flask_link.png)
16
+
17
+ 5. Open your web browser and navigate to the URL shown in the terminal (usually `http://127.0.0.1:50001`). You should see the Agent Zero Web UI.
18
+
19
+ ![](res/ui_newchat.png)
20
+
21
+ ## Running a Simple Task
22
+ Let's ask Agent Zero to tell us the current time. Here's how:
23
+
24
+ 1. Type "Download a YouTube video for me" in the chat input field and press Enter or click the send button.
25
+
26
+ 2. Agent Zero will process your request. You'll see its "thoughts" and the actions it takes displayed in the UI. It will find a default already existing solution, that implies using the `code_execution_tool` to run a simple Python script to perform the task.
27
+
28
+ 3. The agent will then ask you for the URL of the YouTube video you want to download.
29
+
30
+ ## Example Interaction
31
+ Here's an example of what you might see in the Web UI at step 3:
32
+ ![1](res/image-24.png)
33
+
34
+ ## Next Steps
35
+ Now that you've run a simple task, you can experiment with more complex requests. Try asking Agent Zero to:
36
+
37
+ * Perform calculations
38
+ * Search the web for information
39
+ * Execute shell commands
40
+ * Explore web development tasks
41
+ * Create or modify files
42
+
43
+ The Usage Guide provides more in-depth information on using Agent Zero's various features, including prompt engineering, tool usage, and multi-agent cooperation.
docs/res/arch-01.svg ADDED
docs/res/dark.svg ADDED
docs/res/flow-01.svg ADDED
docs/res/{intro_vid.jpg β†’ header.png} RENAMED
File without changes
docs/res/image-24.png ADDED

Git LFS Details

  • SHA256: efacf2d2335940a79334ea9bcf7aa6e88ae3027cb59e4f6319a40475c1263c70
  • Pointer size: 130 Bytes
  • Size of remote file: 29.8 kB
docs/res/memory-man.png ADDED

Git LFS Details

  • SHA256: 58f39765f7c40947016cc736ad0af60dc5ab0eb39cb7d72ebac9ae6b45f4b309
  • Pointer size: 130 Bytes
  • Size of remote file: 29.6 kB
docs/res/new_vid.jpg ADDED

Git LFS Details

  • SHA256: 887db35ef4c70011403846a52457c2870ca5264bc118fdaf0e281901009eafbc
  • Pointer size: 131 Bytes
  • Size of remote file: 119 kB
docs/res/physics-2.png ADDED

Git LFS Details

  • SHA256: f69cc63e08ad5b90d67f5df09b25a54be8373fbe881c580e6855dc6cfc2ad6e4
  • Pointer size: 130 Bytes
  • Size of remote file: 38.6 kB
docs/res/physics.png ADDED

Git LFS Details

  • SHA256: 93ce316a669c05599a355d50cfd216329958ab7b8f43fec6a3c981b22d351811
  • Pointer size: 130 Bytes
  • Size of remote file: 74.5 kB
docs/{installation β†’ res/setup}/image-1.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-10.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-11.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-12.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-13.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-14.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-15.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-16.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-17.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-18.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-19.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-2.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-20.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-21.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-22.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-23.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-3.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-4.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-5.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-6.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-7.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-8.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image-9.png RENAMED
File without changes
docs/{installation β†’ res/setup}/image.png RENAMED
File without changes
docs/res/setup/macsocket.png ADDED

Git LFS Details

  • SHA256: 00d23d6545bab02973e3f6dc910a262535ba36c0220fc5182c3848fa2170a325
  • Pointer size: 131 Bytes
  • Size of remote file: 422 kB
docs/{installation β†’ res/setup}/thumb_play.png RENAMED
File without changes
docs/res/setup/update-initialize.png ADDED

Git LFS Details

  • SHA256: 40f47cf537ac8c88c0caa605eeaa8df110a38436759a8b935186f8d355d1ed54
  • Pointer size: 131 Bytes
  • Size of remote file: 103 kB
docs/res/ui_newchat.png ADDED

Git LFS Details

  • SHA256: 94f4a973a9b71abd1dd525db1b25fb090371e56e7a04c85794ff630f7c643315
  • Pointer size: 130 Bytes
  • Size of remote file: 57.7 kB
docs/res/ui_screen1.png CHANGED

Git LFS Details

  • SHA256: f6b89fb742ae01de06ea136cfb644b943ff48ef77bbc197a3bacfafe08b9409e
  • Pointer size: 131 Bytes
  • Size of remote file: 397 kB

Git LFS Details

  • SHA256: 4921909db74732697f215aebe5ac6cf897494fe48a67dcbc7ed28294258ca4eb
  • Pointer size: 131 Bytes
  • Size of remote file: 129 kB
docs/res/win_webui.gif ADDED

Git LFS Details

  • SHA256: c1f96124cc7fc67b3c4be3c61845382f30287efbae3f9422687d6f0536bdbaec
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB
docs/troubleshooting.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Troubleshooting and FAQ
2
+ This page addresses frequently asked questions (FAQ) and provides troubleshooting steps for common issues encountered while using Agent Zero.
3
+
4
+ ## Frequently Asked Questions
5
+ **1. How do I set up and activate a Python virtual environment?**
6
+
7
+ Use the `venv` module or `conda` (recommended).
8
+
9
+ * **`venv`:**
10
+ ```bash
11
+ python -m venv .venv # Create the environment
12
+ source .venv/bin/activate # Activate (Linux/macOS)
13
+ .venv\Scripts\activate # Activate (Windows)
14
+ ```
15
+ * **`conda`:**
16
+ ```bash
17
+ conda create -n agent-zero python=3.12 # Create
18
+ conda activate agent-zero # Activate
19
+ ```
20
+
21
+ **2. How do I resolve `ModuleNotFoundError` errors (e.g., for `ansio`, `pyflakes`, `Flask`)?**
22
+
23
+ Ensure your virtual environment is activated *before* installing requirements:
24
+
25
+ ```bash
26
+ pip install -r requirements.txt
27
+ ```
28
+
29
+ **3. How do I integrate models like `ollama` or `llama` with Agent Zero?**
30
+ Refer to the [Choosing your LLMs](architecture.md#installing-and-using-ollama) section of the documentation for detailed instructions and examples for configuring different LLMs in `initialize.py`. (This assumes you'll have a dedicated documentation page for model integration).
31
+
32
+ **4. How can I make Agent Zero retain memory between sessions?**
33
+ Auto memory automatically saves and loads solutions and informations from previous sessions.
34
+
35
+ **5. Where can I find more documentation or tutorials?**
36
+ * Join the [Agent Zero Discord community](https://discord.gg/Z2tun2N3) for support and discussions.
37
+
38
+ **6. Can I run Agent Zero without API keys or for free?**
39
+ You can experiment with locally hosted open-source LLMs like Llama. Refer to [Choosing Your LLMs](architecture#choosing-your-llms) section for configuration instructions. Using API-based LLMs like those from OpenAI, Google, etc., requires API keys and might incur costs.
40
+
41
+ **7. How do I adjust API rate limits?**
42
+ Modify the `rate_limit_seconds` and `rate_limit_requests` parameters in the `AgentConfig` class within `initialize.py`.
43
+
44
+ **8. Can Agent Zero interact with external APIs or services (e.g., WhatsApp)?**
45
+ Extending Agent Zero to interact with external APIs is possible by creating custom tools or solutions. Refer to the documentation on creating them.
46
+
47
+ ## Troubleshooting
48
+
49
+ **Installation**
50
+ * **Dependency Conflicts:** If encountering version conflicts during installation, try creating a fresh virtual environment and reinstalling the requirements.
51
+ * **Docker Issues:** If Docker containers fail to start or Agent Zero can't connect to Docker, consult the Docker documentation and verify your Docker installation and configuration. On macOS, ensure you've granted Docker access to your project files in Docker Desktop's settings as described in the Installation guide.
52
+
53
+ **Usage**
54
+ * **"Nothing happens" when sending a message:** This often indicates a tool execution issue, an API connection problem, or rate limiting. Check your API keys, internet connection, and ensure any required services (like Docker) are running. Examine the logs for more details.
55
+
56
+ * **Terminal commands not executing:** If using Docker for code execution, ensure the Docker container is running and properly configured. Check SSH settings if applicable.
57
+
58
+ * **Error Messages:** Pay close attention to the error messages displayed in the Web UI or terminal. They often provide valuable clues for diagnosing the issue. Refer to the specific error message in online searches or community forums for potential solutions.
59
+
60
+ * **Performance Issues:** If Agent Zero is slow or unresponsive, it might be due to resource limitations, network latency, or the complexity of your prompts and tasks.
docs/usage.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Usage Guide
2
+ This guide explores more advanced usage scenarios for Agent Zero, building upon the basics covered in the Quick Start.
3
+
4
+ ![](res/memory-man.png)
5
+
6
+ ## Tool Usage
7
+ Agent Zero's power comes from its ability to use tools. Here's how to leverage them effectively:
8
+
9
+ * **Default Tools:** Agent Zero typically includes default tools like knowledge, webpage content, code execution, and communication. Understand the capabilities of these tools and how to invoke them.
10
+ * **Creating Custom Tools:** Extend Agent Zero's functionality by creating your own custom tools. Refer to [Adding Tools](architecture.md#adding_tools) for detailed instructions.
11
+ * **New in 0.7 ❗ | Instruments:** Instruments are a new type of tool that allow you to create custom functions that can be called by Agent Zero. Refer to [Adding Instruments](architecture.md#adding_instruments) for further details.
12
+ * **Tool Arguments:** Provide the necessary arguments to the tools. Agent Zero expects tools to be invoked with a JSON-formatted string containing the tool name and arguments. Refer to the Quick Start and example prompts for how to format tool calls.
13
+
14
+ ## Example: Web Search and Code Execution
15
+ Let's say you want Agent Zero to find the current price of Bitcoin and then convert it to Euros. Here's a possible prompt:
16
+
17
+ > Please be a professional financial analyst. Find last month Bitcoin/USD price trend and make a chart in your environment. The chart must have highlighted key points corresponding with dates of major news about cryptocurrency. Use the 'knowledge_tool' to find the price and the 'code_execution_tool' to perform the rest of the job.
18
+
19
+ Agent Zero might then:
20
+
21
+ 1. Use the `knowledge_tool` to query a reliable source for the Bitcoin price.
22
+ 2. Extract the price from the search results.
23
+ 3. Use the `code_execution_tool` to execute a Python script that performs the conversion using the provided exchange rate.
24
+ 4. Return the final price in Euros.
25
+
26
+ This example demonstrates how to combine multiple tools to achieve a simple task. By mastering prompt engineering and tool usage, you can unlock the full potential of Agent Zero to solve complex problems.
27
+
28
+ ## Memory Management
29
+ * **Persistence:** Agent Zero's memory persists across sessions, allowing agents to learn from past interactions.
30
+ * **Memory Retrieval:** Agents can access their memory to retrieve relevant information and experiences. The `memory_tool` is used for this purpose.
31
+ * **Knowledge Base:** You can augment the agent's knowledge by providing external knowledge files. (Link to documentation on knowledge base management).
32
+
33
+ ## Multi-Agent Cooperation
34
+ One of Agent Zero's unique features is multi-agent cooperation.
35
+
36
+ * **Creating Sub-Agents:** Agents can create sub-agents to delegate sub-tasks. This helps manage complexity and distribute workload.
37
+ * **Communication:** Agents can communicate with each other, sharing information and coordinating actions. The system prompt and message history play a key role in guiding this communication.
38
+ * **Hierarchy:** Agent Zero uses a [hierarchical structure](architecture.md#agent-hierarchy-and-communication), with superior agents delegating tasks to subordinates. This allows for structured problem-solving and efficient resource allocation.
39
+
40
+ ![](res/physics.png)
41
+ ![](res/physics-2.png)
42
+
43
+ ## Prompt Engineering
44
+ Effective prompt engineering is crucial for getting the most out of Agent Zero. Here are some tips and techniques:
45
+
46
+ * **Be Clear and Specific:** Clearly state your desired outcome. The more specific you are, the better Agent Zero can understand and fulfill your request. Avoid vague or ambiguous language.
47
+ * **Provide Context:** If necessary, provide background information or context to help the agent understand the task better. This might include relevant details, constraints, or desired format for the response.
48
+ * **Break Down Complex Tasks:** For complex tasks, break them down into smaller, more manageable sub-tasks. This makes it easier for the agent to reason through the problem and generate a solution.
49
+ * **Iterative Refinement:** Don't expect perfect results on the first try. Experiment with different prompts, refine your instructions based on the agent's responses, and iterate until you achieve the desired outcome.
50
+ * **System-Level Instructions:** A custom prompts directory changes the agent's overall behavior. You can copy the default files and modify them to give the agent specific instructions, biases, or constraints. The same goes for the tool files, that you can modify to give the agent specific instructions, biases, or constraints for each tool. See (architecture.md#prompts) for more information.
51
+
52
+ ## Agent Behavior
53
+ * **System Prompt:** The core of Agent Zero's behavior is defined in the system prompt. Experiment with different system prompts to customize the agent's personality, biases, and reasoning approach.
54
+ * **Prompts Directory:** The `prompts` directory contains various prompt templates used by the framework. You can modify these templates to customize the agent's communication style, instructions, and responses. See [Prompt Customization](architecture.md#custom-prompts) for more information.
55
+ * **Creating New Tools and Instructions:** Extend Agent Zero's capabilities with custom tools and instructions. This allows you to add new features, modify existing behavior, and integrate with other systems.
56
+
57
+ ## Running on All Hosts
58
+ To access the Agent Zero Web UI from other devices on your network, such as your smartphones or tablets:
59
+
60
+ 1. In `run_ui.py`, add `host="0.0.0.0"` (or your private IP) to the `app.run()` command before the `port` argument (end of `run_ui.py`). The edited line of code should look like this:
61
+ ```python
62
+ app.run(request_handler=NoRequestLoggingWSGIRequestHandler, host="0.0.0.0", port=port)
63
+ ```
64
+ 2. Access the Web UI from other devices using `http://$YOUR_PRIVATE_IP:50001`.
65
+ > On local networks, usually 192.168.x.x or 10.0.x.x.