Skip to main content

uAgents: AI Agent Framework

Official Website GitHub Repo stars Twitter Follow Ruff Tests PyPI - Python Version

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 implement it in 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.10 to 3.13:

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")

Include a seed parameter when creating an agent to set a fixed address, for example from an environment variable:

import os
alice = Agent(name="alice", seed=os.getenv("ALICE_SEED_PHRASE"))

Otherwise the agent's private key will be stored locally alongside its name in private_keys.json. If you create the agent without a name alice = Agent(), a new address will be generated each time you run the agent.

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 and Integrations

The uAgent-Examples repository contains several examples of how to create and run various types of agents as well as more intricate integrations. This is the official place for internal and community open source applications built on uAgents.

Python Library

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

uAgents Core

The uagents-core folder contains core definitions and functionalities to build 'agent' like software which can interact and integrate with Fetch.ai ecosystem and agent marketplace.

✨ 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 software.

License

The uAgents project is licensed under Apache License 2.0.

Release files for uagents 0.25.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uagents 0.25.5
File Size Uploaded
uagents-0.25.5.tar.gz 959.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for uagents 0.25.5
File Interpreter ABI Platform
uagents-0.25.5-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / uagents-0.25.5.tar.gz

Download URL uagents-0.25.5.tar.gz
Size 959.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a81784b411975c473930e7d82e0ebbf3068a5fa0677b79d5604d0326dedac574
BLAKE2b-256 checksum
How to use checksums
3373f1e8c3bf11eea5097936ef67f26ddad3b028b27286a1ef9cc7364223b3e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / uagents-0.25.5-py3-none-any.whl

Download URL uagents-0.25.5-py3-none-any.whl
Size 84.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23a9868fa16860e13ff48e7f78a7e7f3abb6454fc78b495648454f3fbd2325d1
BLAKE2b-256 checksum
How to use checksums
f49585accf37ed44487f395297d6671956f885875f14d38c48188a47083369cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.25.5 This release

2 release files

0.25.3

2 release files

0.25.2

2 release files

0.25.1

2 release files

0.25.0

2 release files

0.24.2

2 release files

0.24.1

2 release files

0.23.7

2 release files

0.23.6

2 release files

0.23.5

2 release files

0.23.4

2 release files

0.23.3

2 release files

0.23.2

2 release files

0.22.9

2 release files

0.22.8

2 release files

0.22.7

2 release files

0.22.5

2 release files

0.22.4

2 release files

0.22.3

2 release files

0.22.1

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.2

2 release files

0.16.1

2 release files

0.15.2

2 release files

0.14.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page