Skip to content

Commit

Permalink
fix(docs): adjusted content lenght in some guides (#1089)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixNicolaeBucsa authored Dec 12, 2024
1 parent 02304dd commit d8e19d4
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 50 deletions.
10 changes: 5 additions & 5 deletions pages/guides/agents/getting-started/create-a-uagent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { CodeGroup, CodeSegment, DocsCode, GithubCodeSegment } from "../../../..

Once you've [installed ↗️](/guides/agents/installing-uagent) the uAgents library, it's quite simple to get a minimal use case running.

The uAgents Framework streamlines agent creation by offering tools for communication, discovery, and publication within the Fetch.ai network. It empowers users and developers with flexibility, allowing them to build agents using anything from cutting-edge Large Language Models (LLMs) to simple APIs.
The uAgents Framework simplifies Agents creation, and enables Agents communication, discovery, and publication on the Fetch.ai network. The Framework supports building Agents using anything from advanced Large Language Models (LLMs) to basic APIs.

Let our first agent be a simple initialization and printing out the agent's name and address.
Let's start with a simple Agent that initializes and prints its name and address

## Prerequisites

Expand All @@ -30,19 +30,19 @@ Make sure you have read the following resources before going on with this guide:
```py copy filename="mac"
touch first_agent.py
```
</DocsCode>
</DocsCode>

<DocsCode windows={true}>
```py copy filename="windows"
echo. > first_agent.py
```
</DocsCode>
</DocsCode>

<DocsCode ubuntu={true}>
```py copy filename="ubuntu"
touch first_agent.py
```
</DocsCode>
</DocsCode>
</CodeGroup>

2. We then need to import the `Agent` and `Context` classes from the `uagents` library, and then create an agent using the class `Agent`:
Expand Down
14 changes: 7 additions & 7 deletions pages/guides/agents/getting-started/whats-an-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ The **uAgents Framework** is a lightweight library designed to facilitate the de
alt="agents-interacting"
/>

Agents are autonomous software program built using the uAgents framework and that can interact autonomously with other agents in a decentralized environment. These agents can operate in a decentralized manner, but their decentralization remains optional and dependent on individual preferences or needs.
Agents, built with the uAgents Framework, are autonomous software programs capable of interacting with others in a decentralized environment. While decentralization is supported, it remains optional based on user needs.

Intelligent agents can fundamentally change the way we see complicated systems. For example, supply chain management could deploy Agents using the uAgents Framework to improve operations at various stages. Demand forecasting, inventory control, logistics optimization, supplier relationships monitoring, quality control and risk mitigation in all areas can be done with their help. Agents could transform supply chain operations by increasing efficiency, reducing costs, improving accuracy and providing real-time visibility.
Intelligent Agents can revolutionize complex systems. For instance, in supply chain management, Agents can enhance demand forecasting, inventory control, logistics optimization, supplier monitoring, quality control, and risk mitigation. This leads to improved efficiency, cost reduction, accuracy, and real-time visibility.

These agents are the basic building blocks that allow developers to gain access to the tools and resources provided by the uAgents Framework, enabling them to create and participate in intelligent and self-managed systems that can be used in various real-world domains.
These Agents are the foundation for developers to leverage the uAgents Framework, enabling the creation of intelligent, self-managed systems across various domains.

<ImageByTheme
darkSrc={DarkDecentralisedNetwork}
Expand All @@ -38,13 +38,13 @@ These agents are the basic building blocks that allow developers to gain access

## Why Agents

With the rise of Large Language Models (LLMs) and AI-related products, autonomous intelligent agents have become the link between these models and tools. They are revolutionizing the way we solve problems, make decisions and collaborate with each other.
With the rise of Large Language Models (LLMs) and AI-driven products, autonomous Agents bridge the gap between these tools, transforming how we solve problems, make decisions, and collaborate.

The financial industry is another example. In this scenario, the automation of trading transactions, risk assessment, fraud detection and customer support would be greatly aided by Agents. They can use predictive analytics to perform real-time market trend analysis, perform risk assessments for loans and investments, and create customized financial advice for clients based on their profiles and the state of the market. By continuously monitoring transactions and patterns, they could also help to detect fraud, strengthening security measures. Agents in the financial sector have the potential to simplify processes, provide insightful information and improve decision-making for both financial companies and individual investors.
For instance, within the financial sector, Agents can automate trading, risk assessment, fraud detection, and customer support operations. By leveraging predictive analytics, they can analyze market trends, assess risks for loans and investments, and potentially offer tailored financial advice. Agents can also enhance security by detecting fraud through continuous transaction monitoring. This simplifies processes, provides valuable insights, and supports better decision-making for both financial institutions and investors.

In this context, Fetch.ai introduces the **uAgents Framework**. Using this open-source framework, developers are able to create intelligent, autonomous agents and join a decentralized network of many agents to effectively tackle the challenges of the modern world. Agents only perform tasks specified by the developers, and these tasks can be precisely described by coding customizable behavior for specific use cases and scenarios.
Fetch.ai's uAgents Framework empowers developers to create Agents that can join a decentralized network to tackle real-world challenges. Developers can customize Agents behavior to perform precise tasks tailored to specific use cases.

The concept of agents refers to autonomous, decentralized systems that overcome conventional limitations. Agents provide a gateway to a future where intelligent agents, empowered by the Fetch network and the [AI Engine ↗️](/concepts/ai-engine/ai-engine-intro), can communicate, negotiate and collaborate to streamline complex tasks, solve complicated problems and improve decision-making processes in various fields.
The concept of Agents refers to autonomous, decentralized systems that overcome conventional limitations. Agents provide a gateway to a future where intelligent Agents, empowered by the Fetch network and the [AI Engine ↗️](/concepts/ai-engine/ai-engine-intro), can communicate, negotiate and collaborate to streamline complex tasks, solve complex problems and improve decision-making processes in various fields.

### Get started with Agents development!

Expand Down
36 changes: 13 additions & 23 deletions pages/guides/agents/intermediate/agent-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,27 @@ import { CodeGroup, CodeSegment, DocsCode, GithubCodeSegment } from "../../../..

# Hosted, Local, and Mailbox Agents

Agents can operate in multiple environments based on how they are created and deployed within the network. Understanding the difference between **Hosted**, **Local**, and **Mailbox Agents** is helpful for developers to correctly choose the right setup for their use cases and applications.
Agents operate in various environments depending on how they are created and deployed.

## Hosted Agents

[Hosted Agents ↗️](/guides/agentverse/creating-agentverse-agents/creating-a-hosted-agent) are cloud-based agents managed within the [Agentverse ↗️](https://agentverse.ai/). This allows developers to build, deploy, and run Agents without worrying about infrastructure management. The Agentverse ensures that your agents run as functions, executing routines and handling messages straightforwardly in response to specific triggers. This design keeps the operational costs of hosted agents low, which is passed on to the users.
Understanding the difference between **Hosted**, **Local**, and **Mailbox Agents** helps developers choose the right setup for their needs.

Agentverse provides a variety of tools to make agent development easy. First of all, the Agent Editor which allows you to write, edit, and manage your agents directly in the Agentverse environment. It includes essential features such as the Agent Logs, where you can view real-time outputs of your agent's execution, helping you monitor and debug your agents on the fly. The platform also offers storage and secrets management, enabling you to securely manage data and information. One important feature of hosted agents is _how they manage their state_. Since hosted agents do not run continuously, any global variable you define will always revert to its initialized value after each function call. For example, if you try to increment a global counter, its value will reset to the starting value every time the function is invoked. To persist data between calls, you must use the Agent Storage; this ensures key values are maintained across function executions. This is crucial for developing agents that require stateful behavior over time. .

When creating hosted agents, you can either start from a blank script or use one of the many predefined templates available. These templates cover a range of use cases, such as smart services or AI/ML integrations, allowing developers to quickly get started with agents designed to toss a coin, retrieve stock prices, or find nearby restaurants. The template system simplifies agent creation by providing a foundation, while also allowing for customization to meet specific requirements following the idea users have in mind.
## Hosted Agents

A key advantage of hosted agents is that they do not require local dependencies, making development more accessible. The system provides an integrated `agent.py` file, and although hosted agents can be created based on a restricted set of imports, they still offer significant flexibility for developers to create complex solutions.
[Hosted Agents ↗️](/guides/agentverse/creating-agentverse-agents/creating-a-hosted-agent) are cloud-based Agents managed within the [Agentverse ↗️](https://agentverse.ai/),enabling developers to deploy and manage Agents without handling infrastructure. These Agents function as lightweight, efficient tasks, resetting global variables after each call. To maintain state across calls, developers must use Agent Storage for stateful behavior.

For a better reference to these topics, check out the following resources:
Developers can start with blank scripts or use customizable templates for common use cases like retrieving stock prices or finding nearby restaurants. Hosted Agents are highly accessible, requiring no local dependencies, and include an `agent.py` file from which you can develop them straightforwardly. For a better reference to these topics, check out the following resources:

- [Creating Hosted Agents ↗️](/guides/agentverse/creating-agentverse-agents/creating-a-hosted-agent).
- [Agentverse: Allowed Imports ↗️](/guides/agentverse/creating-agentverse-agents/allowed-imports).
- [How Agents handle their state ↗️](/guides/agents/intermediate/hosted-agent).

## Local Agents

Local agents instead run directly on your machine or infrastructure; this gives you full control over environment, configuration, and execution. Unlike Agentverse hosted agents, local agents can continuously run processes that handle events, messages, and tasks in real-time without relying on an orchestrator. This setup allows for enhanced flexibility and dynamic behavior, as agents can manage their state across function calls without needing to store data externally. This feature makes them ideal for use cases where real-time processing and direct access to local resources are critical.

When developing local agents, you can leverage the entire uAgents Framework, which offers a wide range of tools to support agent-based development. Also, since local agents do not face the same constraints as hosted agents, you are free to use any Python package or custom module that fits your project; this increases flexibility in design, and enables the use of powerful libraries for machine learning, data processing, and external integrations that may not be supported on Agentverse.

A key benefit of local agents is their ability to maintain persistent state without external storage. Since they run continuously, global variables and internal states are maintained across multiple function executions. For instance, if you have a counter that increments every time a message is received, it will correctly retain its value throughout the agent's lifecycle. This contrasts with hosted agents, where global variables are re-initialized with each call and require storage to persist data.

Running a local agent involves setting up a Python environment on your machine, installing the necessary dependencies, and executing the agent script. Agents can run indefinitely, waiting for incoming messages or scheduled tasks, which makes them well-suited for applications that require constant monitoring, immediate response handling, or interactions with other agents in real-time.
Local Agents run on your machine or infrastructure, providing complete control over their environment, configuration, and execution. Unlike hosted Agents, they handle real-time events, messages, and tasks continuously, making them ideal for persistent state and direct access to local resources.

A local agent can also be run within a Docker container, making it easier to deploy agents in a production environment or across distributed systems. This is particularly useful when building functions that need to scale across multiple systems or require isolation from other processes.
Using the uAgents Framework, Local Agents integrate with any Python package or custom module, supporting advanced capabilities like machine learning and data processing. They maintain persistent state across function executions, unlike hosted Agents, where state resets after each call. Setting up a Local Agent requires a Python environment, dependencies, and running the Agent script. They can operate continuously or within Docker containers for scalability and isolation.

Local agents allow for deeper customization and optimization features; you can manage resource allocation, tune performance settings, and integrate directly with other services running on the same machine. This makes local agents the preferred choice for high-performance applications or scenarios where you need to closely manage system resources and agent behavior.
Local Agents are perfect for high-performance, real-time applications requiring deep customization, resource management, and seamless integration with local services.

Head over to the following resource for a better understanding of Agents and their applications:

Expand All @@ -43,11 +33,11 @@ Head over to the following resource for a better understanding of Agents and the

## Mailbox Agents

The [Agentverse Mailbox feature ↗️](/guides/agents/intermediate/mailbox) makes agents a hybrid between Hosted and Local Agents. This because Local Agents may not always be online all the time due to network outages, being behind a firewall, or intentionally going offline for resource management. It may also be that you need to create an Agent application using imports and tools that are currently not available in the Agentverse, and thus you need to design agents locally to guarantee fully operative and runnable application. To manage such scenarios, the **Mailbox** feature in Agentverse allows agents to receive messages while they are offline with ease. Once the agent comes back online, it can retrieve these messages from its mailbox.
The [Agentverse Mailbox feature ↗️](/guides/agents/intermediate/mailbox) makes Agents a hybrid between Hosted and Local types. This because Local Agents may not always be online all the time due to network outages, being behind a firewall, or intentionally going offline for resource management. To manage such scenarios, the **Mailbox** feature in Agentverse allows Agents to receive messages while they are offline with ease. Once the Agent comes back online, it can retrieve these messages from its mailbox.

Local agents can use a Mailbox to ensure that no messages are lost when they are temporarily disconnected from the network; the Mailbox acts as a message buffer, storing communications until the agent comes back online and ready to process them. Indeed, this feature enables interaction with other agents or functions without the agent being online continuously.
**Local Agents can use a Mailbox to ensure that no messages are lost when they are temporarily disconnected from the network**; the Mailbox acts as a message buffer, storing communications until the Agent comes back online and ready to process them. Indeed, this feature enables interaction with other Agents or functions without the Agent being online continuously.

In order to set up a mailbox for a local agent, you first need to create and configure a local agent. The agent's address is used to register it on the Agentverse, and then to generate a **Mailbox API key** for your agent. For instance, consider the following basic agent:
In order to set up a mailbox for a local Agent, you first need to create and configure a local Agent. The Agent's address is used to register it on the Agentverse, and then to generate a **Mailbox API key** for your Agent. For instance, consider the following basic Agent:

<GithubCodeSegment digest="67d527d8ecb6cc3ea76fdce279b2a78a">
<CodeSegment
Expand Down Expand Up @@ -92,6 +82,6 @@ In order to set up a mailbox for a local agent, you first need to create and con



Then, head over to the [Agentverse ↗️](https://agentverse.ai/) and navigate to the **My Agents** tab. Here, select **Local Agents** and click on **Connect Local Agent**. Paste your agent's address retrieved from running your local agent and follow the steps until you get a **Mailbox API Key**, which you will use to update your agent's configuration above. To test your Mailbox setup, you can create another agent (on Agentverse for instance) that sends messages to the Mailbox while the first agent is offline. When the first agent comes back online, it will retrieve and process the stored messages. For a complete example, check out this [guide ↗️](/guides/agentverse/agentverse-mailbox/utilising-the-mailbox).
Then, head over to the [Agentverse ↗️](https://agentverse.ai/) and navigate to the **My Agents** tab. Here, select **Local Agents** and click on **Connect Local Agent**. Paste your Agent's address retrieved from running your local Agent and follow the steps until you get a **Mailbox API Key**, which you will use to update your Agent's configuration above. To test your Mailbox setup, you can create another Agent (on Agentverse for instance) that sends messages to the Mailbox while the first Agent is offline. When the first agent comes back online, it will retrieve and process the stored messages. For a complete example, check out this [guide ↗️](/guides/agentverse/agentverse-mailbox/utilising-the-mailbox).

For a more complex example of an agent using a Mailbox, check out the following [guide ↗️](/guides/agents/intermediate/langchain-rag-agent).
For a more complex example of an Agent using a Mailbox, check out the following [guide ↗️](/guides/agents/intermediate/langchain-rag-agent).
Loading

0 comments on commit d8e19d4

Please sign in to comment.