> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.agentverse.ai/v-2/llms.txt
> - v1: https://docs.agentverse.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.agentverse.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.agentverse.ai/_mcp/server.

## Support for Agents Code

Whenever you code your Agents on Agentverse, you will have to do this in the [Hosted Code Editor](/documentation/create-agents/hosted-code-editor) (**Build** tab). The editor allows you to create any Agent application using a set of different imports available on the Agentverse platform. This resource helps you in understanding what's available and what's not.

On Agentverse, you can now import the `Agent` class and create your agent with `my_agent = Agent(...)`. Note that this is simply a wrapper for your pre-loaded `agent` instance, so any custom configuration you add to the Agent will be ignored. This is because the configuration, seed, name, and address for hosted Agents is already set, and is not allowed to be overwritten.

Additionally, you can now use `agent.run()` method, but this is also not required. Clicking `Run` will cause your agent to run whether you include this command or not. The main reason for supporting this is to unify local and hosted Agent code, so that your Agent code can run as either local or hosted without any modifications.

**Exceptions**:

* Use of `Bureau` is not allowed as each Agent project can contain only a single Agent.

### uagents

Build fast and lightweight for decentralized scenarios using the `uagents` Framework. Check out the [uAgents](https://uagents.fetch.ai/docs) documentation:

* **Available classes**: `Model`, `Context`, `Protocol`.

  **Example**:

  **`copy`**

  ```python copy
  from uagents import Context, Model

  class Message(Model):
      text: str

  @agent.on_interval(period=2.0)
  async def print_message(ctx: Context):
      msg = Message(text=f"Hello there my wallet address is {ctx.wallet}.")
      print(msg.text)
  ```

### requests

This package allows you to interact with HTTP requests and responses.

* **Available functions**: `get`, `post`, `put`, `patch`, `delete`.

  **Example**:

  **`copy`**

  ```python copy
  import requests

  response = requests.get('https://api.github.com')
  if response.status_code == 200:
      print('Success!')
  elif response.status_code == 404:
      print('Not Found.')

  print(response.headers)
  ```

### cosmpy

A Python library for interacting with Cosmos-based blockchains. Checkout the [CosmPy](https://network.fetch.ai/docs/guides/cosmpy/installation) documentation:

* **Full access to all functions and features**.

  **Example**:

  **`copy`**

  ```python copy
  from cosmpy import aerial

  # Define network configuration, faucet and ledger
  network = aerial.client.NetworkConfig.fetchai_stable_testnet()
  faucet_api = aerial.faucet.FaucetApi(network)
  ledger = aerial.client.LedgerClient(network)

  MINIMUM_BALANCE = 100000000000000000

  @agent.on_interval(period=20.0)
  async def get_tokens(ctx: Context):

      agent_balance = ledger.query_bank_balance(ctx.wallet)

      if agent_balance < MINIMUM_BALANCE:
          print("Providing wealth to agent...")
          faucet_api.get_wealth(ctx.wallet)
  ```

### pydantic

A package to ensure data validation and settings management. It simplifies the process of defining and validating data models by providing a way to declare and enforce data types, constraints, and validation rules on Python data structures.

* **Full access to all functions and features**.

  **Example**:

  **`copy`**

  ```python copy
  from pydantic import BaseModel

  data = {
      "name": "alice",
      "age": 21
  }

  class User(BaseModel):
      name: str
      age: int

  user = User(**data)

  print(user)
  ```

### pymongo

`pymongo` allows Python applications to interact with MongoDB databases, making it easy to perform various database operations such as inserting, updating, deleting, and querying documents.

* **Full access to all functions and features**.

  **Example**:

  **`copy`**

  ```python copy
  from pymongo import MongoClient

  # Connect to MongoDB server
  client = MongoClient('mongodb://localhost:27017/')

  # Access a specific database
  db = client['my_database']

  # Access a specific collection within the database
  collection = db['my_collection']

  # Insert a document into the collection
  document = {'name': 'John', 'age': 30, 'city': 'New York'}
  collection.insert_one(document)

  # Query documents from the collection
  query = {'city': 'New York'}
  result = collection.find(query)

  # Print the documents returned by the query
  for doc in result:
    print(doc)

  # Close the connection to MongoDB
  client.close()
  ```

### bs4 (BeautifulSoup)

`bs4` make it easy to parse and interact with HTML and XML documents for web scraping or data extraction.

**Example**:

**`copy`**

```python copy
from bs4 import BeautifulSoup
import requests

# Fetch the content of a webpage
response = requests.get("https://example.com")

# Parse the HTML content
soup = BeautifulSoup(response.content, "html.parser")

# Extract and print the page title
print(soup.title.string)

```

### langchain-anthropic

`langchain-anthropic` contains the LangChain integration for Anthropic's generative models:

**Example**:

**`copy`**

```python copy
from langchain_anthropic import ChatAnthropic
from langchain_core.messages import AIMessage, HumanMessage

model = ChatAnthropic(model="claude-3-opus-20240229", temperature=0, max_tokens=1024)

message = HumanMessage(content="What is the capital of France?")

response = model.invoke([message])

```

### langchain-community

`langchain-community` contains third-party integrations that implement the base interfaces defined in LangChain Core, making them ready-to-use in any LangChain application. It is automatically installed by langchain, but can also be used separately:

**Example**:

**`copy`**

```python copy
import bs4
from langchain_community.document_loaders import WebBaseLoader

# Only keep post title, headers, and content from the full HTML.
bs4_strainer = bs4.SoupStrainer(class_=("post-title", "post-header", "post-content"))
loader = WebBaseLoader(
    web_paths=("https://lilianweng.github.io/posts/2023-06-23-agent/",),
    bs_kwargs={"parse_only": bs4_strainer},
)
docs = loader.load()

len(docs[0].page_content)
```

### langchain-core

`langchain-core` contains the base abstractions that power the rest of the LangChain ecosystem:

**Example**:

**`copy`**

```python copy
from langchain_core.messages import HumanMessage
from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatGoogleGenerativeAI(model="gemini-2.5-pro")

# example
message = HumanMessage(
    content=[
        {"type": "text", "text": "What's in this image?"},
        {"type": "image_url", "image_url": "https://picsum.photos/seed/picsum/200/300"},
    ]
)
llm.invoke([message])

```

### langchain-google-genai

`langchain-google-genai` contains the LangChain integrations for Gemini through their generative-ai SDK:

**Example**:

**`copy`**

```python copy
from langchain_core.messages import HumanMessage
from langchain_google_genai import ChatGoogleGenerativeAI

llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash-image")

message = HumanMessage(
    content=[
        {"type": "text", "text": "Describe this image in one sentence."},
        {"type": "image_url", "image_url": "https://picsum.photos/seed/picsum/200/300"},
    ]
)
llm.invoke([message])

```

### langchain-google-vertexai

`langchain-google-vertexai` contains the LangChain integrations for Google Cloud generative models:

**Example**:

**`copy`**

```python copy
from langchain_core.messages import HumanMessage
from langchain_google_vertexai import ChatVertexAI

llm = ChatVertexAI(model_name="gemini-2.5-pro")

message = HumanMessage(
    content=[
        {"type": "text", "text": "What's in this image?"},
        {"type": "image_url", "image_url": {"url": "https://picsum.photos/seed/picsum/200/300"}},
    ]
)
llm.invoke([message])

```

### langchain-openai

`langchain-openai` contains the LangChain integrations for OpenAI through their `openai` SDK:

**Example**:

**`copy`**

```python copy
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gpt-4o",
    temperature=0,
    max_tokens=None,
    timeout=None,
    max_retries=2,
    # api_key="...",  # if you prefer to pass api key in directly instaed of using env vars
    # base_url="...",
    # organization="...",
    # other params...
)
```

### langchain-text-splitters

`langchain-text-splitters` contains utilities for splitting into chunks a wide variety of text documents:

**Example**:

**`copy`**

```python copy
from langchain_text_splitters import RecursiveCharacterTextSplitter

text_splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000, chunk_overlap=200, add_start_index=True
)
all_splits = text_splitter.split_documents(docs)

len(all_splits)
```

### langchain

`langchain` assists in the development of applications integrating with LLMs:

**Example**:

**`copy`**

```python copy
import bs4
from langchain import hub
from langchain_chroma import Chroma
from langchain_community.document_loaders import WebBaseLoader
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnablePassthrough
from langchain_openai import OpenAIEmbeddings
from langchain_text_splitters import RecursiveCharacterTextSplitter

# Load, chunk and index the contents of the blog.
loader = WebBaseLoader(
    web_paths=("https://lilianweng.github.io/posts/2023-06-23-agent/",),
    bs_kwargs=dict(
        parse_only=bs4.SoupStrainer(
            class_=("post-content", "post-title", "post-header")
        )
    ),
)
docs = loader.load()

text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
splits = text_splitter.split_documents(docs)
vectorstore = Chroma.from_documents(documents=splits, embedding=OpenAIEmbeddings())

# Retrieve and generate using the relevant snippets of the blog.
retriever = vectorstore.as_retriever()
prompt = hub.pull("rlm/rag-prompt")

def format_docs(docs):
    return "\n\n".join(doc.page_content for doc in docs)

rag_chain = (
    {"context": retriever | format_docs, "question": RunnablePassthrough()}
    | prompt
    | llm
    | StrOutputParser()
)

rag_chain.invoke("What is Task Decomposition?")
```

### nltk

`nltk` is a package for natural language processing.

**Example**:

**`copy`**

```python copy
import nltk
nltk.download('punkt')

from nltk.tokenize import word_tokenize

text = "This is an example sentence, showing off the tokenization process."

tokens = word_tokenize(text)

print(tokens)

# ['This', 'is', 'an', 'example', 'sentence', ',', 'showing', 'off', 'the', 'tokenization', 'process', '.']
```

### openai

`openai` provides easy access to the OpenAI REST API. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.

**Example**:

**`copy`**

```python copy
import os
from openai import OpenAI

client = OpenAI(
    # This is the default and can be omitted
    api_key=os.environ.get("OPENAI_API_KEY"),
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Say this is a test",
        }
    ],
    model="gpt-3.5-turbo",
)
```

### tenacity

`tenacity` is a general-purpose retrying library to simplify the task of adding retry behavior to just about anything.

**Example**:

**`copy`**

```python copy
import random
from tenacity import retry

@retry
def do_something_unreliable():
    if random.randint(0, 10) > 1:
        raise IOError("Broken sauce, everything is hosed!!!111one")
    else:
        return "Awesome sauce!"

print(do_something_unreliable())
```

### unstructured

`unstructured` is a library for processing and extracting data from unstructured file formats such as PDFs, Word documents, and more.

**Example**:

**`copy`**

```python copy
from unstructured.partition.auto import partition

elements = partition(filename="example-docs/fake-email.eml")
print("\n\n".join([str(el) for el in elements]))
```

### validators

`validators` is a Python library designed for data validation. It provides simple functions to verify the validity of various types of data:

**Example**:

**`copy`**

```python copy
import validators
print(validators.email('someone@example.com'))  # True
print(validators.email('invalid-email'))  # ValidationFailure

```

### web3

`web3` is a Python library for interacting with the Ethereum blockchain. It provides functionalities for sending transactions, interacting with smart contracts, and querying blockchain data:

**Example**:

**`copy`**

```py copy
from web3 import Web3

w3 = Web3(Web3.HTTPProvider("https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID"))

print(w3.is_connected())  # True if connected to Ethereum network

```

### anthropic

`anthropic` is a Python SDK for interacting with Anthropic's AI models, such as Claude. It allows developers to send prompts, configure responses, and integrate natural language processing into their applications.

**Example**:

**`copy`**

```py copy
from anthropic import Anthropic

client = Anthropic(api_key="YOUR_ANTHROPIC_API_KEY")

response = client.messages.create(
    model="claude-3-haiku-20240307",
    max_tokens=50,
    messages=[
        {"role": "user", "content": "Tell me a joke about cats"}
    ]
)

print(response.content[0].text)
```

### mcp

`mcp` (Model Context Protocol) is a specification and set of tools for connecting AI models with external data sources, applications, and tools through a unified protocol. It allows developers to integrate AI assistants with structured APIs and real-time services.

**Example**:

**`copy`**

```py copy
from mcp import Client

# Connect to an MCP server
client = Client("ws://localhost:5000")
client.connect()

# Send a query to a connected MCP tool
response = client.request("weather.get_forecast", {"location": "London"})
print(response)
```

### httpx

`httpx` is a fully featured HTTP client for Python, supporting HTTP/1.1, HTTP/2, connection pooling, timeouts, streaming, and async requests. It’s a modern alternative to `requests` with built-in async support.

**Example**:

**`copy`**

```py copy
import httpx

# Synchronous request
response = httpx.get("https://api.github.com")
print(response.status_code, response.json())

# Asynchronous request
import asyncio

async def fetch():
    async with httpx.AsyncClient() as client:
        resp = await client.get("https://api.github.com")
        print(resp.status_code, resp.json())

asyncio.run(fetch())

```

### asyncpg

`asyncpg` is an asynchronous PostgreSQL client library for Python, designed for high-performance database interactions.

**Example**:

**`copy`**

```py copy
import asyncio
import asyncpg

async def main():
    conn = await asyncpg.connect("postgresql://user:password@localhost/dbname")
    rows = await conn.fetch("SELECT 1 AS num")
    print(rows)
    await conn.close()

asyncio.run(main())
```

### faiss-cpu

`faiss-cpu` is a library for efficient similarity search and clustering of dense vectors, optimized for CPUs.

**Example**:

**`copy`**

```py copy
import faiss
import numpy as np

data = np.random.random((5, 3)).astype("float32")
index = faiss.IndexFlatL2(3)
index.add(data)

D, I = index.search(data, 2)
print(I)
```

### google-genai

`google-genai` is Google’s client for accessing Gemini models and other generative AI features.

**Example**:

**`copy`**

```py copy
from google import genai

client = genai.Client(api_key="your_api_key")

resp = client.models.generate_content(
    model="gemini-2.5-flash",
    contents="Say hello from the latest Gemini model!"
)

print(resp.text)

```

### huggingface-hub

`huggingface-hub` provides utilities to interact with the Hugging Face Hub, allowing you to download and upload models, datasets, and spaces.

**Example**:

**`copy`**

```py copy
from huggingface_hub import snapshot_download

local_dir = snapshot_download(repo_id="bert-base-uncased")
print(local_dir)
```

### langgraph

`langgraph` is a framework for building stateful, graph-based workflows around LLMs using LangChain primitives.

**Example**:

**`copy`**

```py copy
from langgraph.graph import StateGraph, END

builder = StateGraph(dict)

def step(state): 
    print("Running step with:", state)
    return {"done": True}

builder.add_node("start", step)
builder.set_entry_point("start")
builder.add_edge("start", END)

graph = builder.compile()
graph.invoke({"input": "hello"})
```

### pypdf

`pypdf` is a pure-Python library for reading, manipulating, and writing PDFs.

**Example**:

**`copy`**

```py copy
from pypdf import PdfReader

reader = PdfReader("example.pdf")
print(len(reader.pages))
print(reader.pages[0].extract_text())
```

## Additional Supported Packages

### uagents-core

It contains the core components and abstractions used by the uAgents framework.

### agentverse-client

Client library for interacting with the Agentverse platform.

### aiofiles

Asynchronous file handling for Python.

### aiohappyeyeballs

Implements the "Happy Eyeballs" algorithm for concurrent IPv4/IPv6 connection attempts.

### aiohttp

Asynchronous HTTP client/server framework.

### aiohttp-retry

Retry support for aiohttp requests.

### aiosignal

Signal handling helpers for asyncio programs.

### annotated-types

Runtime-usable type annotations, extending Python typing.

### anyio

Asynchronous compatibility layer across asyncio, trio, and curio.

### attrs

Declarative, boilerplate-free class creation library.

### backoff

Function decorator for retrying with exponential backoff.

### beautifulsoup4

HTML and XML parser for web scraping.

### bech32

Implementation of Bech32 encoding/decoding, used in blockchain addresses.

### bitarray

Efficient arrays of booleans stored as bits.

### Bottleneck

Fast array operations for NumPy.

### cachetools

Extensible caching collections and decorators.

### certifi

Root certificates for SSL validation.

### cffi

Foreign Function Interface for calling C code from Python.

### chardet

Character encoding detector.

### charset-normalizer

Alternative to chardet for encoding detection.

### ckzg

Cryptographic library for polynomial commitments (KZG).

### click

Package for creating command-line interfaces.

### coincurve

Cryptographic library for elliptic curve operations (secp256k1).

### cryptography

General-purpose cryptography library for Python.

### cytoolz

Cython implementation of toolz for fast functional utilities.

### dataclasses-json

JSON support for dataclasses.

### distlib

Distribution utilities for Python packaging.

### distro

Linux distribution information library.

### dnspython

DNS toolkit for Python.

### docstring_parser

Parse Python docstrings into structured data.

### ecdsa

Elliptic Curve Digital Signature Algorithm library.

### eciespy

Elliptic Curve Integrated Encryption Scheme for Python.

### emoji

Library for handling emojis in Python.

### eth_abi

Ethereum ABI encoding/decoding.

### eth-account

Ethereum account management.

### eth-hash

Ethereum-specific hashing utilities.

### eth-keyfile

Ethereum keyfile management.

### eth-keys

Ethereum key utilities.

### eth-rlp

Ethereum RLP encoding/decoding.

### eth-typing

Ethereum-specific typing definitions.

### eth-utils

General Ethereum utilities.

### ffmpeg

Python wrapper for executing FFmpeg commands for audio/video processing.

### filelock

Cross-platform file locking library.

### filetype

Infer file type and MIME type from binary data.

### frozenlist

Immutable list implementation for async frameworks.

### fsspec

Filesystem specification for unified file access.

### google-ai-generativelanguage

Google API client for Generative Language models.

### google-api-core

Core utilities for Google API clients.

### google-auth

Authentication library for Google APIs.

### google-cloud-aiplatform

Google Cloud AI Platform client library.

### google-cloud-bigquery

BigQuery client library.

### google-cloud-core

Shared library for Google Cloud Python clients.

### google-cloud-resource-manager

Client for Google Cloud Resource Manager.

### google-cloud-storage

Client for Google Cloud Storage.

### google-crc32c

CRC32C checksum implementation.

### google-resumable-media

Support for resumable uploads and downloads.

### googleapis-common-protos

Common protocol buffer definitions for Google APIs.

### greenlet

Lightweight in-process concurrent coroutines.

### grpc-google-iam-v1

IAM policy API client for gRPC.

### grpcio

gRPC framework for Python.

### grpcio-status

Status code utilities for gRPC.

### h11

HTTP/1.1 protocol library.

### hexbytes

Hexadecimal byte representation for Ethereum.

### html5lib

HTML parser based on the WHATWG specification.

### httpcore

Low-level HTTP client library used by httpx.

### httpx-sse

Server-Sent Events (SSE) extension for httpx.

### idna

Internationalized Domain Names in Applications (IDNA) support.

### jiter

Fast JSON parser.

### joblib

Lightweight pipelining and parallelism library.

### jsonpatch

Implementation of JSON Patch standard.

### jsonpointer

Implementation of JSON Pointer standard.

### jsonschema

Validation of JSON documents against schemas.

### jsonschema-specifications

Base specifications for JSON Schema.

### langdetect

Language detection library.

### langgraph-checkpoint

Checkpointing utilities for LangGraph.

### langgraph-prebuilt

Prebuilt components for LangGraph workflows.

### langgraph-sdk

SDK for working with LangGraph.

### langsmith

LangChain observability and evaluation platform.

### lru-dict

Fast, pure-Python LRU (Least Recently Used) dictionary.

### lxml

High-performance XML and HTML library.

### marshmallow

Object serialization/deserialization library.

### multidict

Multi-value dictionary implementation.

### mypy_extensions

Extensions to Python typing for mypy.

### numexpr

Fast array expression evaluator.

### numpy

Core scientific computing library.

### olefile

Parser for OLE (Object Linking and Embedding) files.

### orjson

Fast JSON parser and serializer.

### ormsgpack

Optimized MessagePack serializer/deserializer.

### packaging

Utilities for version and dependency handling.

### parsimonious

PEG parser library.

### pip

Python package installer.

### platformdirs

Determine platform-specific directories.

### propcache

Property caching decorator.

### proto-plus

Pythonic interface to protocol buffers.

### protobuf

Google’s protocol buffers implementation.

### psutil

Process and system monitoring utilities.

### py-ecc

Elliptic curve cryptography for Ethereum.

### pyarrow

Apache Arrow Python bindings.

### pyasn1

ASN.1 data structures and codecs.

### pyasn1_modules

Common ASN.1 modules.

### pycparser

C parser in pure Python.

### pycryptodome

Cryptographic library as a drop-in for PyCrypto.

### pydantic_core

Core validation logic for Pydantic.

### pydantic-settings

Settings management with Pydantic.

### PyJWT

JSON Web Token implementation in Python.

### python-dateutil

Date/time utilities.

### python-dotenv

Loads environment variables from .env files.

### python-iso639

Utilities for ISO 639 language codes.

### python-magic

File type identification using libmagic.

### python-multipart

Multipart parsing for form-data (file uploads).

### python-oxmsg

OXMSG file parser.

### pyunormalize

Unicode text normalization utilities.

### PyYAML

YAML parser and emitter.

### RapidFuzz

Fuzzy string matching.

### referencing

JSON schema reference resolution.

### regex

Alternative regular expression engine.

### requests-toolbelt

Extensions for the requests library.

### rlp

Recursive Length Prefix (RLP) encoding for Ethereum.

### rpds-py

Immutable data structures in Rust for Python.

### rsa

RSA cryptographic library.

### shapely

Geometry manipulation and analysis library.

### six

Compatibility utilities between Python 2 and 3.

### sniffio

Detect currently running async library.

### sortedcontainers

Sorted collection types.

### soupsieve

CSS selector library for BeautifulSoup.

### SQLAlchemy

SQL toolkit and ORM.

### sse-starlette

Server-Sent Events (SSE) support for Starlette.

### starlette

ASGI framework for building web apps.

### tiktoken

Tokenizer for OpenAI models.

### toolz

Functional programming utilities.

### tqdm

Progress bar library.

### typing_extensions

Backports of newer typing features.

### typing-inspect

Inspection utilities for typing objects.

### typing-inspection

Additional runtime inspection for typing.

### uagents-adapter

Adapter tools for uAgents framework.

### uagents-ai-engine

AI Engine integration for uAgents.

### unstructured-client

Client library for the Unstructured data processing API.

### urllib3

HTTP client library.

### uvicorn

ASGI server implementation.

### virtualenv

Virtual environment manager.

### webencodings

Web encoding standards for HTML/CSS.

### websockets

WebSocket client and server library.

### wrapt

Function decorators and wrappers.

### yarl

URL parsing and manipulation library.

### zstandard

Zstandard compression library.