Skip to main content

Lightweight framework for rapid agent-based development

Project description

uAgents: AI Agent Framework

Official Website Unit Tests GitHub Repo stars Twitter Follow

uAgents is a library developed by Fetch.ai that allows for creating autonomous AI agents in Python. With simple and expressive decorators, you can have an agent that performs various tasks on a schedule or takes action on various events.

🚀 Features

  • 🤖 Easy creation and management: Create any type of agent you can think of and put into code.
  • 🔗 Connected: On startup, each agent automatically joins the fast growing network of uAgents by registering on the Almanac, a smart contract deployed on the Fetch.ai blockchain.
  • 🔒 Secure: uAgent messages and wallets are cryptographically secured, so their identities and assets are protected.

⚡ Quickstart

Installation

Get started with uAgents by installing it for Python 3.9 to 3.12:

pip install uagents

Running a Demo

Creating an Agent

Build your first uAgent using the following script:

from uagents import Agent, Context
alice = Agent(name="alice", seed="alice recovery phrase")

Include a seed parameter when creating an agent to set fixed addresses, or leave it out to generate a new random address each time.

Giving it a task

Give it a simple task, such as a greeting:

@alice.on_interval(period=2.0)
async def say_hello(ctx: Context):
    ctx.logger.info(f'hello, my name is {ctx.agent.name}')

if __name__ == "__main__":
    alice.run()

Running the Agent

So far, your code should look like this:

from uagents import Agent, Context

alice = Agent(name="alice", seed="alice recovery phrase")

@alice.on_interval(period=2.0)
async def say_hello(ctx: Context):
    ctx.logger.info(f'hello, my name is {ctx.agent.name}')

if __name__ == "__main__":
    alice.run()

Run it using:

python agent.py

You should see the results in your terminal.

📖 Documentation

Please see the official documentation for full setup instructions and advanced features.

🌱 Examples

The examples folder contains several examples of how to create and run various types of agents.

🌲 Integrations

The integrations folder contains examples that provide a more in depth use of the uAgents library.

Python Library

Go to the python folder for details on the Python uAgents library.

✨ Contributing

All contributions are welcome! Remember, contribution includes not only code, but any help with docs or issues raised by other developers. See our contribution guidelines for more details.

📄 Development Guidelines

Read our development guidelines to learn some useful tips related to development.

❓ Issues, Questions, and Discussions

We use GitHub Issues for tracking requests and bugs, and GitHub Discussions for general questions and discussion.

🛡 Disclaimer

This project, uAgents, is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to unexpected behavior, data loss, or any other issues that may arise. The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this

License

The uAgents project is licensed under Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uagents-0.12.4.tar.gz (46.1 kB view details)

Uploaded Source

Built Distribution

uagents-0.12.4-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file uagents-0.12.4.tar.gz.

File metadata

  • Download URL: uagents-0.12.4.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1022-azure

File hashes

Hashes for uagents-0.12.4.tar.gz
Algorithm Hash digest
SHA256 c156493efc4995c5cda853a69336ce1f7d836a1aa8a833190a513cbf1933f7af
MD5 a9ac6b8bce24f6e8f8a4e38336cd1b21
BLAKE2b-256 8eda1847378c2f1ee1e1809619c3c7cbb611e319a212bc71ba26a9df3057d919

See more details on using hashes here.

File details

Details for the file uagents-0.12.4-py3-none-any.whl.

File metadata

  • Download URL: uagents-0.12.4-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Linux/6.5.0-1022-azure

File hashes

Hashes for uagents-0.12.4-py3-none-any.whl
Algorithm Hash digest
SHA256 52e228572e6deb233c74880dbb0305f587e2ade78e3937615b679e0ec8d4fa19
MD5 6b3b172c0de4e556a31ddff4d6f25c60
BLAKE2b-256 a2524a3d7b70e53179376972fd28c67b90fca3f53dddef4789160a4fb43fca63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page