Agents - uAgents Framework
Introduction
The uAgents Framework is a python library designed to facilitate the development of Agents. Agents in a multi-agent system can communicate with any, and all agents in the system to solve problems, execute tasks and transact.
Head over to the uagents package to download it and start developing your Agents!
Current version of the uAgents package is .
Getting into Agents
Agents are programs designed to operate freely and communicate with whomever they’re programmed to. Agents can connect, search, and transact in order to create dynamic markets, and they can be programmed to interact both within their local network or with other agents across all networks. Because they’re siloed, and decentralized they can safely accomplish particular activities and objectives without requiring human participation. We have a very simple guide in our documentation that gets you started on building an Agent to be part of the Network.
At the simplest level, and agent would work as follows:
Agents come online, they register (or not) and then send and receive messages.
Using the above workflow as reference, many Agent can come together to become multi-Agents workflows, where single Agents call one another to complete a task. That can create a chain of Agents relying on responses from other Agents. Agents that you design could be programmed to contact known Agents, whereas in a dynamic marketplace you may need an agent that you haven’t created, searching and interacting with that Agent may be the more optimal strategy.
Get to know more about: registering, searching
and communication
.
A simple Agent using the uagents
library could be:
from uagents import Agent, Context, Model
agent = Agent(name="concept", seed="secret_seed_phrase_concept", endpoint="127.0.0.1", port="8001")
class Message(Model):
message : str
@agent.on_message(model=Message)
async def print_message(ctx: Context, msg : Message):
ctx.logger.info(f"Message received: {msg.message}")
if __name__ == "__main__":
agent.run()
This Agent defines its communication method as receiving any Object of Class Message
, with a value for message
of type string
. You can see how this agent behaves, and how to extend this in our guides.
Agents can be inserted to existing systems with the ability to simplify the way we see complicated systems. As an 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.
You can view the source code for an Agent that monitors inventory levels in our examples.
Agents thrive on IoT devices such as Raspberry Pi, and there are some great examples of multi-Agent simulations using Agents on Raspberry Pi available on Github.
LLMs
Agents can wrap and orchestrate LLMs to create personalized Agents for any task. 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.
Integrating LLMs into an Agent is relatively trivial, we have a guide for that too!
In this context, a standout example is ASI-1 Mini, which is an LLM created by Fetch.ai. Unlike general-purpose models, ASI-1 Mini is designed to connect directly with Agents that act as domain experts. This enables ASI-1 to answer specialized questions, make real-world reservations, and serve as an intelligent gateway into an organic multi-Agent ecosystem. Check out the ASI-1 Mini documentation for a better understanding, or head over to this example
for a practical visualization.
Getting started with Agent development!
Visit the GitHub repository to see the source code for Agents, and to keep up-to-date with any update made to the uAgents Framework.
From there, view the examples on uAgents repository, or start reading our guides, we’d recommend starting with agent to agent communication.
Agentverse
Fetch.ai has invested heavily into a toolset to help you build and deploy Agents with ease. Once you’re familiar with Agents and the uAgents Framework, check out Agentverse to host your Agents in the cloud.