Skip to main content

IntelliComm Protocol (ICP) - Intelligent Communication Framework with x402 payment integration.

Project description

IntelliComm Protocol (ICP)

A powerful Python framework for intelligent communication protocol with x402 payment integration.

โœจ Features

  • ๐Ÿค– Agent-based architecture - Register and execute intelligent agents
  • ๐Ÿ’ฐ x402 Payment Protocol - Monetize your agents with crypto payments
  • ๐Ÿ”Œ Dual Protocol Support - Socket-based (legacy) and HTTP (with payments)
  • ๐ŸŽจ Beautiful Console Output - Rich terminal UI with colors and panels
  • ๐Ÿ”’ Secure Payments - Blockchain-based payments via Ethereum/Base/Solana
  • โš™๏ธ Per-Agent Configuration - Configure payments for individual agents
  • ๐Ÿš€ Easy to Use - Simple decorators and intuitive API

๐Ÿ†• What's New: x402 Payment Integration

IntelliComm Protocol now supports x402 payment protocol, allowing you to:

  • โœ… Require payment for specific agents (per-agent pricing)
  • โœ… Accept crypto payments on multiple networks (Base, Ethereum, Solana)
  • โœ… Automatic payment handling on the client side
  • โœ… Test with testnet and deploy to mainnet
  • โœ… Beautiful console output showing payment status

๐Ÿ“ Project Structure

IntelliComm-Protocol-ICP/
โ”œโ”€โ”€ intellicomm/                 # Core Python framework package
โ”‚   โ”œโ”€โ”€ __init__.py              # Package exports
โ”‚   โ”œโ”€โ”€ models.py                # Data models (Request, Response)
โ”‚   โ”œโ”€โ”€ server.py                # Socket-based server (legacy)
โ”‚   โ”œโ”€โ”€ client.py                # Socket-based client (legacy)
โ”‚   โ”œโ”€โ”€ http_server.py           # HTTP server with x402 payments โญ NEW
โ”‚   โ”œโ”€โ”€ http_client.py           # HTTP client with x402 payments โญ NEW
โ”‚   โ”œโ”€โ”€ payments.py              # Payment configuration & utilities โญ NEW
โ”‚   โ”œโ”€โ”€ agent.py                 # Agent implementations
โ”‚   โ””โ”€โ”€ utils.py                 # Helper functions
โ”œโ”€โ”€ tests/                       # Example & test files
โ”‚   โ”œโ”€โ”€ run_server.py            # Socket-based server example
โ”‚   โ”œโ”€โ”€ run_client.py            # Socket-based client example
โ”‚   โ”œโ”€โ”€ run_http_server.py       # HTTP server with payments example โญ NEW
โ”‚   โ””โ”€โ”€ run_http_client.py       # HTTP client with payments example โญ NEW
โ”œโ”€โ”€ env.example                  # Environment configuration template โญ NEW
โ”œโ”€โ”€ PAYMENT_GUIDE.md            # Complete payment integration guide โญ NEW
โ”œโ”€โ”€ requirements.txt             # Python dependencies
โ””โ”€โ”€ README.md                    # This file

๐Ÿš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/yourusername/IntelliComm-Protocol-ICP.git
cd IntelliComm-Protocol-ICP

# Install dependencies
pip install -r requirements.txt

# Configure environment (for payment features)
cp env.example .env
# Edit .env with your wallet details

Basic Usage (Socket-based - No Payments)

Server:

from intellicomm import Server

server = Server(host='localhost', port=5555)

@server.agent()
def greet(params):
    """Simple greeting agent"""
    name = params.get("name", "Guest")
    return {"greeting": f"Hello, {name}!"}

server.start()

Client:

from intellicomm import Client

client = Client(host='localhost', port=5555)
response = client.execute_agent("greet", {"name": "Alice"})
print(response.result)

HTTP with Payments (x402)

Server:

from intellicomm import HttpServer

server = HttpServer(host='0.0.0.0', port=8000)

@server.agent()  # Free agent
def free_service(params):
    """Free service - no payment required"""
    return {"data": "free content"}

@server.agent(payment_required=True, price="$0.001")  # Paid agent
def premium_service(params):
    """Premium service - requires $0.001 payment"""
    return {"data": "premium content"}

server.start()

Client:

from intellicomm import HttpClient
import asyncio

async def main():
    client = HttpClient(base_url="http://localhost:8000")
    
    # Call free service
    response = await client.execute_agent("free_service", {})
    print(response.result)
    
    # Call paid service (payment handled automatically!)
    response = await client.execute_agent("premium_service", {})
    print(response.result)

asyncio.run(main())

๐Ÿ’ฐ Payment Configuration

Environment Setup

Create a .env file (copy from env.example):

# Client wallet (for making payments)
WALLET_PRIVATE_KEY=0x1234567890abcdef...

# Server address (for receiving payments)
PAYMENT_ADDRESS=0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7

# Network (testnet for development)
NETWORK=base-sepolia

# Facilitator (optional, uses default)
FACILITATOR_URL=https://x402.org/facilitator

Getting Test Funds

For Base Sepolia testnet:

  1. Visit Base Sepolia Faucet
  2. Enter your wallet address
  3. Receive test ETH

๐Ÿ“š Documentation

  • PAYMENT_GUIDE.md - Complete guide to x402 payment integration
  • env.example - Environment configuration template
  • API Docs - Auto-generated at http://localhost:8000/docs when server runs

๐Ÿงช Examples

Run the example server with payments:

python tests/run_http_server.py

In another terminal, run the client:

python tests/run_http_client.py

๐Ÿ”‘ Key Features

Per-Agent Payment Configuration

Configure payment requirements for each agent individually:

@server.agent()  # Free
def free_agent(params):
    return {"data": "free"}

@server.agent(payment_required=True, price="$0.001")  # Costs $0.001
def cheap_agent(params):
    return {"data": "cheap"}

@server.agent(payment_required=True, price="$0.010")  # Costs $0.010
def premium_agent(params):
    return {"data": "premium"}

Automatic Payment Handling

Clients automatically handle payment flows - no manual transaction code needed:

# Just call the agent - payment is automatic!
response = await client.execute_agent("premium_agent", {})

Multiple Networks Supported

  • base-sepolia (testnet) - Recommended for development
  • base-mainnet (production)
  • ethereum-sepolia / ethereum-mainnet
  • solana-devnet / solana-mainnet

๐Ÿ› ๏ธ Development

Project Status

โœ… Core framework complete
โœ… Socket-based communication
โœ… HTTP layer with FastAPI
โœ… x402 payment integration
โœ… Beautiful console output
๐Ÿ”„ Documentation in progress

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

MIT License - See LICENSE file for details

๐Ÿค Support

  • ๐Ÿ“ง Email: ahsentahir007@gmail.com
  • ๐Ÿ“– Documentation: See PAYMENT_GUIDE.md
  • ๐Ÿ› Issues: GitHub Issues

๐ŸŒŸ Acknowledgments


Made with โค๏ธ by Ahsen Tahir

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

intellicomm-0.0.2.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

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

intellicomm-0.0.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file intellicomm-0.0.2.tar.gz.

File metadata

  • Download URL: intellicomm-0.0.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for intellicomm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 38205bdfc7426c857bb76e975d0a7752fa7c3e06aaaa1fd56344c805287505c6
MD5 7eb864508f3a5fbf9ad7ad591eafc60b
BLAKE2b-256 878e7009cfdede52e4bef7e87324ddb7625332491ece38a76b513f88aa39c3a2

See more details on using hashes here.

File details

Details for the file intellicomm-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: intellicomm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for intellicomm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c2336698c70ce1f2df338bb5d4d18cd71d1c65d5fd8f10c5ba095ebc2c49e16
MD5 42b2ea9b29bb9fd8bd5298f9924b8f23
BLAKE2b-256 d58583efc2379e09f50948196a628d0f142a8d2dcb6462ff166cf38f036bc155

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