Agent 开发框架

uAgents|Python 去中心化 AI Agent 开发框架

uAgents

Fetch.ai 推出的轻量 Python 库,用装饰器编写自主 Agent,并通过 Almanac 与 Agentverse 接入去中心化网络。

获取与使用

需要部署

按官方资料自行安装或部署

使用难度待核验
国内可用性待核验

2026-11-09 更新 · 本站尚未实测

项目介绍

Agent 开发框架 · 2026-11-09 更新 · 本站尚未实测

uAgents 是 Fetch.ai 开发的一个 Python 库,用于在代码中创建和运行自主 AI Agent。README 将其定位为“A fast and lightweight framework for creating decentralized agents with ease”。开发者通过简单的装饰器即可让 Agent 按周期执行任务,或对事件作出响应。

与常见的对话式应用不同,uAgents 的侧重点在于Agent 的运行、注册与通信:Agent 启动时会自动在 Almanac(部署于 Fetch.ai 区块链上的智能合约)注册,从而加入 uAgents 网络;消息与钱包由密码学机制保护;注册到 Agentverse 的 Agent 可向 Agentverse 面板上报启动/停止、消息收发和错误等遥测事件(可通过 report_events 开关控制)。

核心能力

点击能力名称查看输入、输出和原文依据。

  • 创建与托管 Agent:用少量 Python 代码定义 Agent,按时间间隔或事件触发任务。
  • 自动联网注册:启动时自动在 Almanac 智能合约完成注册。
  • 密码学安全:README 声明 Agent 消息与钱包经密码学保护,用于身份与资产防护。
  • 可观测性:Agentverse 注册后可上报运行与消息遥测,便于在面板中观察状态。
  • 生态接入:仓库包含 uagents-core,提供与 Fetch.ai 生态及 Agent 市场交互的核心能力。
  • 示例资源:官方另设 uAgent-Examples 仓库,收录内部与社区的开源应用示例。

实际应用场景

适用场景

  • 需要用 Python 快速搭建自主执行、按周期或事件驱动的 Agent。
  • 希望 Agent 具备可发现、可寻址、可通信的网络身份。
  • 需要把 Agent 接入 Fetch.ai 生态与 Agent 市场进行分发或协作。
  • 需要在 Agentverse 面板中观察 Agent 运行状态与消息流的团队。

注意:本仓库是开发框架,而非可直接下载使用的工作流文件或现成 Agent 应用;要获得具体功能仍需自行编写代码。

安装与接入

README 给出的前置条件与安装方式如下(Python 版本范围为 3.10 至 3.13):

pip install uagents

运行一个最小 Agent 的基本流程是:从 uagents 导入 Agent 与 Context,创建 Agent 实例(可传入 name,并可选用 seed 或环境变量固定地址),使用 @alice.on_interval(period=2.0) 注册周期任务,最后调用 alice.run() 启动,再用 python agent.py 运行。若不提供 seed,私钥会以 private_keys.json 形式与名称一起存放在本地;若连名称都不提供,则每次运行都会生成新地址。

更完整的安装说明、通信、存储、广播等主题请参考官方文档 uagents.fetch.ai/docs。仓库未提供 MCP 服务配置或客户端配置文件,相关接入方式待核验。

使用条件与限制

是否需要部署
需自行准备运行环境,具体要求见正文
是否需要注册
账号和认证要求见正文;未明确说明的项目仍待核验
是否需要 API Key
待核验
费用与额度
费用边界见正文,项目许可不代表模型或托管服务免费
所需权限
待核验
许可证与服务条款
待核验

权限费用与限制

  • 网络依赖:默认行为涉及 Almanac 智能合约和 Agentverse,属于境外区块链与托管服务,可用性、延迟与合规性需自行评估,国内网络环境下的实际可用性待核验。
  • 密钥与资产:Agent 私钥与钱包由使用者自行保管,README 明确提示软件按“as-is”提供、不承担数据丢失等风险;请勿在不可信环境中暴露 seed。
  • 费用:README 未说明 Almanac 注册、Agentverse 或链上操作是否产生费用,也未给出任何价格,相关费用需向官方核验。
  • 模型:README 未指定必须或推荐使用的大模型/API Key,也未列举模型清单;是否可对接国内模型无资料依据,待核验。
  • 功能边界:遥测上报、Agentverse 面板等能力依赖官方托管服务,其具体条款与数据处理方式待核验。

国内使用情况

网友核验 用户经验分享

与站长实测独立,不代表官方认证或本站已实测。

我要核验
0 位参与者0 份有效分项记录

最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。

分项统计、有效期与样本量
核验项目有效人数成功 / 部分 / 失败 / 无法判断成功率最近核验 / 有效期
官方网站访问00 / 0 / 0 / 0样本不足暂无 / 7 天
GitHub 仓库访问00 / 0 / 0 / 0样本不足暂无 / 7 天
安装与运行00 / 0 / 0 / 0样本不足暂无 / 30 天
官方服务国内连接 / MCP 连接00 / 0 / 0 / 0样本不足暂无 / 30 天
国内网络情况00 / 0 / 0 / 0样本不足暂无 / 7 天
国内模型兼容性00 / 0 / 0 / 0样本不足暂无 / 30 天
自定义 API00 / 0 / 0 / 0样本不足暂无 / 30 天
海外服务依赖
00 / 0 / 0 / 0样本不足暂无 / 30 天
海外账号要求
00 / 0 / 0 / 0样本不足暂无 / 30 天
中文界面
00 / 0 / 0 / 0样本不足暂无 / 30 天
客户端兼容性00 / 0 / 0 / 0样本不足暂无 / 30 天
账号及费用信息
00 / 0 / 0 / 0样本不足暂无 / 30 天

成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。

最近有效核验

暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。

查看全部有效核验 →

国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。

官方网站访问
尚未实测 待核验
GitHub 仓库访问
尚未实测 待核验
官方服务国内连接
尚未实测 待核验
国内网络情况
尚未实测 待核验
国内模型兼容性
尚未实测 待核验
自定义 API
尚未实测 待核验
海外服务依赖
尚未实测 待核验
海外账号要求
尚未实测 待核验
中文界面
尚未实测 待核验
国内最后核验时间
尚未实测

许可与国内使用

仓库代码采用 Apache License 2.0,README 与 LICENSE 文件均有明确声明。该许可覆盖仓库中的源代码;它不代表 Fetch.ai 的区块链网络、Almanac 合约、Agentverse 托管服务或任何第三方模型同样免费或可自由使用,这些服务的使用条款需单独核验。

公开仓库不等于全部相关服务开源免费。域名与官方站点不构成服务部署地域的说明,国内访问与合规适用性待核验。仓库当前未被归档,最近更新时间可查,但长期维护承诺需以官方信息为准。

项目资料与来源

官方网站 ↗

GitHub 仓库 ↗

官方文档 ↗

字段依据与待核验事项

access:来源确认 · Get started with uAgents by installing it for Python 3.10 to 3.13: pip install uagents

project_type:来源确认 · uAgents is a library developed by Fetch.ai that allows for creating autonomous AI agents in Python.

原始 README(折叠技术参考)
# uAgents: AI Agent Framework

[![Official Website](https://img.shields.io/badge/Official%20Website-fetch.ai-blue?style=flat&logo=world&logoColor=white)](https://fetch.ai) [![GitHub Repo stars](https://img.shields.io/github/stars/Fetchai/uAgents?style=social)](https://github.com/Fetchai/uAgents/stargazers) [![Twitter Follow](https://img.shields.io/twitter/follow/fetch_ai?style=social)](https://twitter.com/fetch_ai)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Tests](https://img.shields.io/github/actions/workflow/status/Fetchai/uAgents/ci-tests.yml?label=Tests)](https://github.com/Fetchai/uAgents/actions/workflows/ci-tests.yml) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/uagents)](https://pypi.org/project/uagents/)

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.
- 📊 **Observable**: Agents registered on Agentverse automatically report start/stop, message (sent/received), and error telemetry events to the Agentverse dashboard (toggle with `report_events`).

## ⚡ 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:

```python3
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:

```python3
@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:

```python3
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:

```bash
python agent.py
```

You should see the results in your terminal.

## 📖 Documentation

Please see the [official documentation](https://uagents.fetch.ai/docs) for full setup instructions and advanced features.

- [👋 Introduction](https://uagents.fetch.ai/docs)
- [💻 Installation](https://uagents.fetch.ai/docs/getting-started/install)
- Tutorials
  - [🤖 Create an Agent](https://uagents.fetch.ai/docs/getting-started/create)
  - [🛣️ Agent Communication](https://uagents.fetch.ai/docs/guides/communication)
  - [🍽️ ASI:One Compatible Agent](https://uagents.fetch.ai/docs/examples/asi-1)
- Key Concepts:
  - [📍Addresses](https://uagents.fetch.ai/docs/getting-started/address)
  - [💾 Storage](https://uagents.fetch.ai/docs/guides/storage)
  - [📝 Synchronous Communication](https://uagents.fetch.ai/docs/guides/send_receive)
  - [🌐 Agent Broadcast](https://uagents.fetch.ai/docs/guides/broadcast)

## 🌱 Examples and Integrations

The [`uAgent-Examples`](https://github.com/fetchai/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`](https://github.com/fetchai/uAgents/tree/main/python) folder for details on the Python uAgents library.

## uAgents Core

The [`uagents-core`](https://github.com/fetchai/uAgents/tree/main/python/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](https://github.com/fetchai/uAgents/blob/main/CONTRIBUTING.md) for more details.

### 📄 Development Guidelines

Read our [development guidelines](https://github.com/fetchai/uAgents/blob/main/DEVELOPING.md) to learn some useful tips related to development.

### ❓ Issues, Questions, and Discussions

We use [GitHub Issues](https://github.com/fetchai/uAgents/issues) for tracking requests and bugs, and [GitHub Discussions](https://github.com/fetchai/uAgents/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](https://github.com/fetchai/uAgents/blob/main/LICENSE).
历史前置条件说明(补充参考)

Python 3.10–3.13;通过 pip 安装 uagents;默认运行涉及 Fetch.ai 区块链 Almanac 与 Agentverse 等境外服务;Agent 私钥/seed 需自行保管;是否需要模型或 API Key、费用标准、国内网络可用性均待核验。

项目来源与清单版权许可

https://github.com/fetchai/uAgents

https://github.com/fetchai

整理来源:https://github.com/slavakurilyak/awesome-ai-agents

清单版权与许可:

MIT License

Copyright (c) 2024 Slava Kurilyak

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.