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:
- Visit Base Sepolia Faucet
- Enter your wallet address
- 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/docswhen 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:
- Fork the repository
- Create a feature branch
- Make your changes
- 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
- Built with FastAPI
- Payments via x402 Protocol
- Beautiful console with Rich
Made with โค๏ธ by Ahsen Tahir
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38205bdfc7426c857bb76e975d0a7752fa7c3e06aaaa1fd56344c805287505c6
|
|
| MD5 |
7eb864508f3a5fbf9ad7ad591eafc60b
|
|
| BLAKE2b-256 |
878e7009cfdede52e4bef7e87324ddb7625332491ece38a76b513f88aa39c3a2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c2336698c70ce1f2df338bb5d4d18cd71d1c65d5fd8f10c5ba095ebc2c49e16
|
|
| MD5 |
42b2ea9b29bb9fd8bd5298f9924b8f23
|
|
| BLAKE2b-256 |
d58583efc2379e09f50948196a628d0f142a8d2dcb6462ff166cf38f036bc155
|