uAgents is a Python library from Fetch.ai for building autonomous agents. You define an agent as a Python object and attach behaviour with decorators, such as @agent.on_interval for scheduled work or event handlers that react to incoming messages. On startup, each agent registers on the Almanac, a smart contract on the Fetch.ai blockchain, which makes it discoverable by other agents.
Every agent has a cryptographic identity. Passing a seed phrase fixes its address across runs; otherwise the private key is stored locally in private_keys.json, and an unnamed agent gets a new address on every run. Messages and wallets are cryptographically secured. The library supports Python 3.10 to 3.13.
The repository also contains uagents-core, a package of core definitions for building agent-like software that integrates with the Fetch.ai ecosystem and agent marketplace (Agentverse), and a separate uAgent-Examples repository collects sample agents and integrations, including ASI:One-compatible agents.
Features
- Decorator-based handlers: interval tasks and event handlers declared directly on the agent object
- Almanac registration: automatic registration on the Fetch.ai blockchain contract for discovery
- Deterministic addresses: seed-derived identities for stable agent addresses
- Agent communication: synchronous send/receive and broadcast messaging between agents
- Storage: per-agent persistent storage
- Protocols: message protocols that agents publish and other agents can discover
- uagents-core: lower-level definitions for integrating non-uAgents software with the Fetch.ai marketplace
