Skip to main content

Foundation framework for the Web of Agents - build, serve and monetize AI agents

Project description

WebAgents - core framework for the Web of Agents

Build, Serve and Monetize AI Agents

WebAgents is a powerful opensource framework for building connected AI agents with a simple yet comprehensive API. Put your AI agent directly in front of people who want to use it, with built-in discovery, authentication, and monetization.

PyPI version Python 3.10+ License

🚀 Key Features

  • 🧩 Modular Skills System - Combine tools, prompts, hooks, and HTTP endpoints into reusable packages
  • 🤝 Agent-to-Agent Delegation - Delegate tasks to other agents via natural language. Powered by real-time discovery, authentication, and micropayments for safe, accountable, pay-per-use collaboration across the Web of Agents.
  • 🔍 Real-Time Discovery - Agents discover each other through intent matching - no manual integration
  • 💰 Built-in Monetization - Earn credits from priced tools with automatic billing
  • 🔐 Trust & Security - Secure authentication and scope-based access control
  • 🌐 Protocol agnostic connectivity - Deploy agents as standard chat completion endpoints with coming support for OpenAI Responses/Realtime, ACP, A2A and other common AI communication protocols and frameworks.
  • 🔌 Build or Integrate - Build from scratch with WebAgents, or integrate existing agents from popular SDKs and platforms into the Web of Agents (e.g., Azure AI Foundry, Google Vertex AI, CrewAI, n8n, Zapier).

With WebAgents delegation, your agent is as powerful as the whole ecosystem, and capabilities of your agent grow together with the whole ecosystem.

📦 Installation

pip install webagents

WebAgents includes everything you need: core framework, LLM integration, and ecosystem skills (MongoDB, Supabase, PostgreSQL, CrewAI, X.com, etc.)

🏃‍♂️ Quick Start

Create Your First Agent

from webagents import BaseAgent

# Create a basic agent
agent = BaseAgent(
    name="assistant",
    instructions="You are a helpful AI assistant.",
    model="litellm/gpt-4o-mini"  # Automatically creates LLM skill
)

# Run chat completion
messages = [{"role": "user", "content": "Hello! What can you help me with?"}]
response = await agent.run(messages=messages)
print(response["choices"][0]["message"]["content"])

Serve Your Agent

Deploy your agent as an OpenAI-compatible API server:

from webagents.server.core.app import create_server
import uvicorn

# Create server with your agent
server = create_server(agents=[agent])

# Run the server
uvicorn.run(server.app, host="0.0.0.0", port=8000)

Test your agent API:

curl -X POST http://localhost:8000/assistant/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages": [{"role": "user", "content": "Hello!"}]}'

🧩 Skills Framework

Skills combine tools, prompts, hooks, and HTTP endpoints into easy-to-integrate packages:

from webagents.agents.skills.base import Skill
from webagents.agents.tools.decorators import tool, prompt, hook, http
from webagents.agents.skills.robutler.payments.skill import pricing

class NotificationsSkill(Skill):        
    @prompt(scope=["owner"])
    def get_prompt(self) -> str:
        return "You can send notifications using send_notification()."
    
    @tool(scope="owner")
    @pricing(credits_per_call=0.01)
    async def send_notification(self, title: str, body: str) -> str:
        # Your API integration
        return f"✅ Notification sent: {title}"
    
    @hook("on_message")
    async def log_messages(self, context):
        # React to incoming messages
        return context
    
    @http("/webhook", method="post")
    async def handle_webhook(self, request):
        # Custom HTTP endpoint
        return {"status": "received"}

Core Skills - Essential functionality:

  • LLM Skills: OpenAI, Anthropic, LiteLLM integration
  • Memory Skills: Short-term, long-term, and vector memory
  • MCP Skill: Model Context Protocol integration

Platform Skills - WebAgents ecosystem:

  • Discovery: Real-time agent discovery and routing
  • Authentication: Secure agent-to-agent communication
  • Payments: Monetization and automatic billing
  • Storage: Persistent data and messaging

Ecosystem Skills - External integrations:

  • Google: Calendar, Drive, Gmail integration
  • Database: SQL and NoSQL database access
  • Workflow: CrewAI, N8N, Zapier automation

💰 Monetization

Add payments to earn credits from your agent:

from webagents.agents.core.base_agent import BaseAgent
from webagents.agents.skills.robutler.payments.skill import PaymentSkill, pricing
from webagents.agents.tools.decorators import tool

# Define a priced tool (fixed pricing)
@tool
@pricing(credits_per_call=0.01, reason="Image generation")
def generate_thumbnail(url: str, size: int = 256) -> dict:
    """Create a thumbnail for a public image URL."""
    # ... your processing logic here ...
    return {"url": url, "thumbnail_size": size, "status": "created"}


agent = BaseAgent(
    name="thumbnail-generator",
    model="litellm/gpt-4o-mini",
    skills={
        "payments": PaymentSkill(),
    },
    # Auto-register priced tool as capability
    capabilities=[generate_thumbnail],
)

🔧 Environment Setup

Set up your API keys for LLM providers:

export OPENAI_API_KEY="your-openai-key"

# Robutler API key for payments
export WEBAGENTS_API_KEY="your-webagents-key"

Get your WEBAGENTS_API_KEY at https://robutler.ai/developer

🌐 Web of Agents

WebAgents enables dynamic real-time orchestration where each AI agent acts as a building block for other agents:

  • 🚀 Real-Time Discovery: Think DNS for agent intents - agents find each other through natural language
  • 🔐 Trust & Security: Secure authentication with audit trails for all transactions
  • 💡 Delegation by Design: Seamless delegation across agents, enabled by real-time discovery, scoped authentication, and micropayments. No custom integrations or API keys to juggle—describe the need, and the right agent is invoked on demand.

📚 Documentation

Native/Built-in Tools

The Python adapters support provider-native tools alongside standard function tools. When convert_tools() receives a mixed array:

  • Function tools (type: "function") are converted to the provider's format
  • Native tools (any other type) are passed through to the provider API

Example:

tools = [
    {"type": "function", "function": {"name": "get_weather", "parameters": {...}}},
    {"type": "web_search"},  # Provider-native tool
]

Google adapter wraps function tools in function_declarations and emits native tools as separate entries. Anthropic adapter converts function tools to name/description/input_schema and passes native tools through.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support


Focus on what makes your agent unique instead of spending time on plumbing.

Built with ❤️ by the WebAgents team and community contributors.

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

webagents-0.3.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webagents-0.3.0-py3-none-any.whl (808.9 kB view details)

Uploaded Python 3

File details

Details for the file webagents-0.3.0.tar.gz.

File metadata

  • Download URL: webagents-0.3.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for webagents-0.3.0.tar.gz
Algorithm Hash digest
SHA256 db88621378c40cb16ebd008065af5ac491f9cb288ec632bfc494888cf4b8bdfa
MD5 33952dca8a50e4460573f1b49725328e
BLAKE2b-256 bbbc5efa678a191c11cd05d51972c113ea1a957726e70ac241f0a5aa65bb1033

See more details on using hashes here.

File details

Details for the file webagents-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: webagents-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 808.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for webagents-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18cee7fe172a00992eb2cf4855c88621731e0859f53650551392ccdac43b4ec5
MD5 a8f47abc515ec8b854e5ee10b71faca2
BLAKE2b-256 2c0850495dc39d05ee9d688b49a494d3e3813f75b34449697ec5804e4d47054b

See more details on using hashes here.

Supported by

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