System: # Assistant's job
1. The assistant receives a history of conversation between USER and AGENT
2. Assistant searches for succesful technical solutions by the AGENT
3. Assistant writes notes about the succesful solution for later reproduction

# Format
- The response format is a JSON array of succesfull solutions containng "problem" and "solution" properties
- The problem section contains a description of the problem, the solution section contains step by step instructions to solve the problem including necessary details and code.
- If the history does not contain any helpful technical solutions, the response will be an empty JSON array.

# Example when solution found (do not output this example):
[
  {
    "problem": "Task is to download a video from YouTube. A video URL is specified by the user.",
    "solution": "1. Install yt-dlp library using 'pip install yt-dlp'\n2. Download the video using yt-dlp command: 'yt-dlp YT_URL', replace YT_URL with your video URL."
  }
]
# Example when no solutions:
[]

# Rules
- Focus on important details like libraries used, code, encountered issues, error fixing etc.
- Do not include simple solutions that don't require instructions to reproduce like file handling, web search etc.
- Do not add your own details that are not specifically mentioned in the history
User: human: {
    "user": "Get the current price of Bitcoin and Ethereum from https://www.coingecko.com"
}

ai: Rate limit (200/hour) exceeded. Join our discord for more: [https://discord.com/invite/q55gsH8z5F](https://discord.com/invite/q55gsH8z5F)Rate limit (200/hour) exceeded. Join our discord for more: [https://discord.com/invite/q55gsH8z5F](https://discord.com/invite/q55gsH8z5F)Rate limit (200/hour) exceeded. Join our discord for more: [https://discord.com/invite/q55gsH8z5F](https://discord.com/invite/q55gsH8z5F)Rate limit (200/hour) exceeded. Join our discord for more: [https://discord.com/invite/q55gsH8z5F](https://discord.com/invite/q55gsH8z5F)Rate limit (200/hour) exceeded. Join our discord for more: [https://discord.com/invite/q55gsH8z5F](https://discord.com/invite/q55gsH8z5F)
human: {
    "system_warning": "You have misformatted your message. Follow system prompt instructions on JSON message formatting precisely."
}

ai: Parece que tu mensaje tiene un pequeño error de formato. Si necesitas ayuda para corregirlo o si tienes alguna pregunta específica, ¡estaré encantado de ayudarte! Solo asegúrate de seguir las instrucciones de formato que se te proporcionaron. ¿En qué puedo asistirte hoy?
human: {
    "system_warning": "You have misformatted your message. Follow system prompt instructions on JSON message formatting precisely."
}

ai: Parece que hubo un pequeño error en el formato de tu mensaje. No te preocupes, ¡todos cometemos errores! Si necesitas ayuda para corregirlo o si tienes alguna pregunta específica, estaré encantado de asistirte. ¿Cómo puedo ayudarte hoy?
human: {
    "system_warning": "You have misformatted your message. Follow system prompt instructions on JSON message formatting precisely."
}

ai: {
    "thoughts": [
        "The user has requested to get the current price of Bitcoin and Ethereum from CoinGecko.",
        "I need to fetch the data from the specified URL.",
        "I will use the webpage_content_tool to retrieve the content from the CoinGecko website."
    ],
    "tool_name": "webpage_content_tool",
    "tool_args": {
        "url": "https://www.coingecko.com"
    }
}
human: {
    "response_from_tool": "webpage_content_tool",
    "data": Error fetching webpage: 403 Client Error: Forbidden for url: https://www.coingecko.com/
}

ai: {
    "thoughts": [
        "The attempt to fetch data from CoinGecko resulted in a 403 Forbidden error, indicating that access to the webpage is restricted.",
        "I need to find an alternative method to obtain the current prices of Bitcoin and Ethereum.",
        "I will search for an API that provides cryptocurrency prices, as this method is more reliable than scraping web pages."
    ],
    "tool_name": "knowledge_tool",
    "tool_args": {
        "question": "What APIs provide current cryptocurrency prices for Bitcoin and Ethereum?"
    }
}

# Online sources
To obtain current cryptocurrency prices for Bitcoin and Ethereum, you can use several APIs from different providers. Here are some of the notable ones:

## CoinAPI
CoinAPI provides real-time and historical price data for various cryptocurrencies, including Bitcoin and Ethereum. Their Market Data API offers latest quotes and trades with no delays, and you can access order book-level information for top exchanges and currency pairs.

## CEX.IO API
CEX.IO offers several APIs that provide real-time market data. You can use the `GET /api/ticker/{symbol1}/{symbol2}` endpoint to get the current prices for specific currency pairs, such as BTC/USD or ETH/USD.

## CoinMarketCap API
The CoinMarketCap API provides real-time prices, market capitalization, and 24-hour volume data for cryptocurrencies like Bitcoin and Ethereum. You can retrieve the latest cryptocurrency pricing and other relevant market data through their API.

## CoinGecko API
CoinGecko's data market APIs offer robust and reliable real-time price data for various cryptocurrencies, including Bitcoin and Ethereum. Their APIs are widely used for tracking current prices and other market metrics.

## Coinlayer Cryptocurrency API
The Coinlayer API returns real-time data in JSON format for over 25 exchanges and includes up to 385 cryptocurrencies. You can use this API to get the current prices of Bitcoin and Ethereum, with the option to set the default fiat currency.

Each of these APIs provides comprehensive and reliable data, making them suitable for various applications requiring current cryptocurrency prices.

DuckDuckGo search failed: https://duckduckgo.com/ 202 Ratelimit

# Memory
id: 1ae0159a-ea4e-4903-a2ed-26e2762922c1
timestamp: 2024-10-24 21:17:06
area: fragments
Content: https

source: /home/tt4/Desktop/agent-zero-current/knowledge/default/solutions/get_current_time.md
area: solutions
id: 32b1adf9-beb0-4487-8176-2633f4e7b166
timestamp: 2024-10-24 21:24:13
Content: # Problem
User asked for current time in timezone
# Solution
Use code_execution_tool with following python code adjusted for your timezone
~~~python
from datetime import datetime
import pytz

timezone = pytz.timezone('America/New_York')
current_time = datetime.now(timezone)

print("Current time in New York:", current_time)
~~~

source: /home/tt4/Desktop/agent-zero-current/instruments/custom/web_scraper/web_scrape.md
area: instruments
id: 6b70ec15-172b-4eb6-91e4-1e672f10f095
timestamp: 2024-10-24 21:24:13
Content: # Problem
Scrape the contents of a webpage, including the title, text, images, and links, and store the data in JSON format.
# Solution
1. Navigate to the script directory: `cd /home/tt4/Desktop/agent-zero-current/instruments/custom/web_scraper`
2. Run the script with your target URL: `bash web_scrape.sh <url>`
3. Wait for the script to complete. The output will be saved in JSON format.
## Troubleshooting
- If you encounter errors, check the console output for details.
- Ensure your URL is correct and accessible.

source: /home/tt4/Desktop/agent-zero-current/knowledge/default/main/about/github_readme.md
area: main
id: be3757b9-72ad-4a12-bf77-d3777527f315
timestamp: 2024-10-24 21:24:13
Content: # Agent Zero

[![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)](<PRESIDIO_ANONYMIZED_URL>) [![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)


[![Intro Video](/docs/res/intro_vid.jpg)](https://www.youtube.com/watch?v=C9n8zFpaV3I)

**Personal and organic AI framework**
- Agent Zero is not a predefined agentic framework. It is designed to be dynamic, organically growing, and learning as you use it.
- Agent Zero is fully transparent, readable, comprehensible, customizable and interactive.
- Agent Zero uses the computer as a tool to accomplish its (your) tasks.

## Now with UI:
![UI prototype](/docs/res/ui_screen1.png)

## Key concepts
1. **General-purpose assistant**
- 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 agent instances, and do its best to accomplish it.
- It has a persistent memory, allowing it to memorize previous solutions, code, facts, instructions, etc., to solve tasks faster and more reliably in the future.

2. **Computer as a tool**
- Agent Zero uses the operating system as a tool to accomplish its tasks. It has no single-purpose tools pre-programmed. Instead, it can write its own code and use the terminal to create and use its own tools as needed.
- The only default tools in its arsenal are online search, memory features, communication (with the user and other agents), and code/terminal execution. Everything else is created by the agent itself or can be extended by the user.
- Tool usage functionality has been developed from scratch to be the most compatible and reliable, even with very small models.

3. **Multi-agent cooperation**
- Every agent has a superior agent giving it tasks and instructions. Every agent then reports back to its superior.
- In the case of the first agent in the chain (Agent 0), the superior is the human user; the agent sees no difference.
- Every agent can create its subordinate agent to help break down and solve subtasks. This helps all agents keep their context clean and focused.

4. **Completely customizable and extensible**
- Almost nothing in this framework is hard-coded. Nothing is hidden. Everything can be extended or changed by the user.
- The whole behavior is defined by a system prompt in the **prompts/default/agent.system.md** file. Change this prompt and change the framework dramatically.
- The framework does not guide or limit the agent in any way. There are no hard-coded rails that agents have to follow.
- Every prompt, every small message template sent to the agent in its communication loop, can be found in the **prompts/** folder and changed.
- Every default tool can be found in the **python/tools/** folder and changed or copied to create new predefined tools.
- Of course, it is open-source (except for some tools like Perplexity, but that will be replaced with an open-source alternative as well in the future).

source: /home/tt4/Desktop/agent-zero-current/knowledge/default/main/about/github_readme.md
area: main
id: 66fed2d6-8478-4683-92bb-5b01d88d1951
timestamp: 2024-10-24 21:24:13
Content: ![Time example](/docs/res/time_example.jpg)

## Setup

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.

> ⚠️ **Changes to launch files since v0.6:**  
> main.py file has been replaced with run_ui.py (webui) and run_cli.py (terminal) launch files.
> configuration has been moved to initialize.py for both webui and terminal launch files.
human: {
    "user_intervention": "Use the web_scraper"
}

ai: {
    "thoughts": [
        "The user has requested to scrape the contents of a webpage. I'll use the web_scraper tool to achieve this.",
        "I need to provide the target URL for the scraping process.",
        "I will ask the user for the URL so that I can proceed."
    ],
    "tool_name": "knowledge_tool",
    "tool_args": {
        "question": "What is the target URL for the webpage content scraping?"
    }
}
human: {
    "response_from_tool": "knowledge_tool",
    "data": # Online sources
When scraping webpage content, the target URL depends on the specific website and the data you intend to extract. Here are some examples based on the provided sources:

## Scraping Target.com
If you are scraping product data from Target.com, the target URL would typically be a search page or a product listing page. For example, if you are scraping data related to "women’s sweaters," the URL might look something like this:
```
https://www.target.com/s?searchTerm=women%27s+sweaters
```
This URL is used to retrieve the HTML content of the search results page, which can then be parsed using libraries like BeautifulSoup.

## Scraping Other Websites
For other websites, the target URL will vary based on the content you want to scrape. Here are a few more examples:

### Quotes to Scrape
If you are scraping quote data from the "Quotes to Scrape" website, the target URL would be:
```
https://quotes.toscrape.com
```
This URL is the starting point for scraping quotes from the website, including navigating through paginated content.

### General Approach
In general, you need to specify the URLs of the websites and pages you want to scrape. For instance, if you are scraping data from a blog, you would use the URL of the blog's homepage or specific article pages.

To determine the exact target URL, you typically need to inspect the website's structure and identify the pages that contain the data you are interested in extracting.

DuckDuckGo search fail<< 1109 CHARACTERS REMOVED TO SAVE SPACE >>has executable permissions.
2. Improve the Usage section with clear, step-by-step instructions for navigating to the script directory and executing the script.
3. Include a Troubleshooting section that advises users to check console output for errors, verify URL accessibility, and check script permissions.
4. Suggest improvements for future documentation, such as adding examples and expanding error handling guidance.

source: /home/tt4/Desktop/agent-zero-current/instruments/default/yt_download/yt_download.md
area: instruments
id: 9551ea46-bd34-4abc-8168-b324e9c31d2c
timestamp: 2024-10-24 21:24:13
Content: # Problem
Download a YouTube video
# Solution
1. If folder is specified, cd to it
2. Run instrument "bash /instruments/default/yt_download/yt_download.sh <url>" with your video URL
3. Wait for the terminal to finish

source: /home/tt4/Desktop/agent-zero-current/knowledge/default/main/about/github_readme.md
area: main
id: 66fed2d6-8478-4683-92bb-5b01d88d1951
timestamp: 2024-10-24 21:24:13
Content: ![Time example](/docs/res/time_example.jpg)

## Setup

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.

> ⚠️ **Changes to launch files since v0.6:**  
> main.py file has been replaced with run_ui.py (webui) and run_cli.py (terminal) launch files.
> configuration has been moved to initialize.py for both webui and terminal launch files.
}

ai: {
    "thoughts": [
        "The user has asked to use the web scraper tool to extract data from a webpage.",
        "I will need to specify the target URL for the scraping process.",
        "Since the user has not provided a specific URL, I will prompt them to provide the URL they want to scrape."
    ],
    "tool_name": "response",
    "tool_args": {
        "text": "Please provide the URL of the webpage you would like to scrape."
    }
}
Assistant: